-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
52 lines (43 loc) · 1.09 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
48
49
50
51
52
#
# Hello2D Game Engine
# yoyo 2015 ShenZhen China
# repo:https://github.com/play175/Hello2D
# website:http://yoyo.play175.com
# MIT Licensed
#
APP = h2d.exe
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst 3rdparty/%.c,3rdparty/%.o,$(wildcard 3rdparty/*.c))
OBJS += $(patsubst core/%.c,core/%.o,$(wildcard core/*.c))
OBJS += $(patsubst widget/%.c,widget/%.o,$(wildcard widget/*.c))
INCLUDE = -I.
INCLUDE += -I./3rdparty
INCLUDE += -I./core
INCLUDE += -I./widget
LIB = -L. -lgdi32
RM = rm
CC = gcc
CFLAGS = -std=gnu99
LDFLAGS = ${LIB} ${WARNS}
RC = windres
release : WARNS = -Wno-unknown-pragmas -Wl,--subsystem,windows
release : CFLAGS += -D NDEBUG
release : LDFLAGS += -O4 -s
release : clean ${APP}
strip ${APP}
upx ${APP}
debug : WARNS = -Wall -Wl,--subsystem,console
debug : CFLAGS += -g
debug : LDFLAGS += -g
debug : ${APP}
${APP} : ${OBJS}
${CC} -o $@ ${OBJS} ${LDFLAGS}
clean :
$(RM) *.o -f
$(RM) core/*.o -f
$(RM) 3rdparty/*.o -f
$(RM) widget/*.o -f
%.o : %.c ${HEADERS}
${CC} ${CFLAGS} ${INCLUDE} -c $< -o $@
resource.o : resource.rc resource.h
${RC} ${INCLUDE} -i $< -o $@