-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
47 lines (47 loc) · 1.17 KB
/
makefile
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
#BIN = /cygdrive/d/MinGWStudio/MinGw/bin/
#BIN = /cygdrive/c/mingw/bin/
CC = $(BIN)gcc
PRJ = luaext
#CFLAGS = -mno-cygwin
CFLAGS =
ifeq ($(notrace),1)
C_PROC=
else
C_PROC = -DENABLE_TRACE
endif
ifeq ($(test),1)
C_PROC += -DENABLE_TEST
endif
INCPATH = -I/usr/local/include
LIBPATH = -L/usr/local/lib
LIBS = -lcomctl32 -lole32 -lopengl32 -llua -liphlpapi -lgdi32
#LDFLAGS = -mwindows -mno-cygwin
LDFLAGS = -pipe -shared
DEPS = $(PRJ).dep
EXP = $(PRJ).exp
SRCS :=$(wildcard *.c)
HPPS :=$(wildcard *.h)
OBJS :=$(patsubst %.c,%.o,$(SRCS))
RRCS :=$(wildcard *.rc)
RRCS_OBJS :=$(patsubst %.rc,%.res,$(RRCS))
WINDRES = $(BIN)windres
all:$(PRJ).dll $(DEPS) tags
tags:$(SRCS) $(HPPS)
ctags -R .
$(PRJ).dll :$(OBJS) $(RRCS_OBJS) $(EXP)
$(CC) -o $@ $(EXP) $(OBJS) $(RRCS_OBJS) $(LIBPATH) $(LIBS) $(LDFLAGS)
$(EXP):$(PRJ).def
dlltool -e $@ -d $< --no-export-all-symbols
%.o:%.c
$(CC) $(CFLAGS) $(C_PROC) $(INCPATH) -c $<
%.res:%.rc
$(WINDRES) -O COFF -i "$<" -o "$@"
$(DEPS):$(SRCS) $(HPPS)
$(CC) -MM $(INCPATH) *.c >$(DEPS)
#-@if test ! -r "$(DEPS)";then echo>$(DEPS);fi
# makedepend -f$(DEPS)>&/dev/null *.c
-include $(DEPS)
install:
cp $(PRJ).dll bin/
clean:
-@rm *.o $(PRJ).dll *.dep *.exp