summaryrefslogtreecommitdiff
path: root/plugins/Db3x/Makefile
blob: 5a7563001f941a68b865ec5f4e4cc8001f12385d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
SRC = commonheaders.c \
      database.c \
	  dbcache.c \
	  dbcontacts.c \
	  dbevents.c \
	  dbheaders.c \
	  dbini.c \
	  dblists.c \
	  dbmodulechain.c \
	  dbsettings.c \
	  dbtime.c \
	  encrypt.c \
	  init.c
OBJ = $(SRC:.c=.o)
RES = resource.res
LIB = -lgdi32 -lversion -lcomctl32 -lcomdlg32 -lole32

CC = gcc
RC = windres
RM = rm

# Install location
ifdef DEBUG
BIN = ..\..\bin\debug\plugins\dbx_3x.dll
else
BIN = ..\..\bin\release\plugins\dbx_3x.dll
endif

# Defines
DEFINES = -DWIN32 -D__SEH_NOOP
ifdef DEBUG
DEFINES := $(DEFINES) -D_DEBUG
endif

# Flags
LFLAGS  = -shared 
RCFLAGS = --input-format rc --output-format coff
ifdef DEBUG
CFLAGS  = -g $(DEFINES) -I../../include
else
CFLAGS  = -O1 $(DEFINES) -I../../include
endif

# Targets
all : $(OBJ) $(RES)
	$(CC) $(LFLAGS) $(CFLAGS) -o $(BIN) $(OBJ) $(RES) $(LIB) -Wl

$(RES) : $(RES:.res=.rc) $(RES:.res=.h) Makefile
	$(RC) $(RCFLAGS) -o $(RES) -i $(RES:.res=.rc)

clean :
	$(RM) -f $(OBJ) $(RES)