-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwindows.mak
101 lines (76 loc) · 1.3 KB
/
windows.mak
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#
# MinGW (pure MinGW i.e. no MSYS) make file
#
#
# Source files
#
SRC=\
action.c \
ansiterm.c \
bill.c \
config.c \
create.c \
data.c \
diag.c \
display.c \
fortune.c \
global.c \
help.c \
iventory.c\
io.c \
main.c \
monster.c \
moreobj.c \
movem.c \
object.c \
regen.c \
savelev.c \
scores.c \
spheres.c \
spells.c \
store.c \
sysdep.c \
tgoto.c \
tok.c
#
# goal: debug
#
ifeq ($(MAKECMDGOALS),debug)
CFLAGS=-Wall -Wextra -ansi -pedantic -Wpointer-arith \
-Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement \
-Wshadow -Wmissing-declarations -Wold-style-definition -Wredundant-decls \
-g -D_FORTIFY_SOURCE=2 -DDEBUG -DWINDOWS
LDFLAGS=-lpdcurses
STRIP_BINARY=no
#
# goal: release
#
else ifeq ($(MAKECMDGOALS),release)
CFLAGS=-Os -Wall -fomit-frame-pointer -DWINDOWS
LDFLAGS=-Wl,-O1 -lpdcurses
STRIP_BINARY=yes
endif
OBJ=$(SRC:.c=.o)
EXE=larn.exe
CC=gcc
RM=del
.PHONY : build
build: $(EXE)
@echo Build complete!
ifeq ($(STRIP_BINARY),yes)
@echo Stripping binary..
@strip $(EXE)
endif
.PHONY: debug
debug: build
.PHONY: release
release: build
.PHONY : clean
clean:
-$(RM) *.o
-$(RM) *.exe
%.o: %.c
@echo Building $<
@$(CC) $(CFLAGS) -o $@ -c $<
$(EXE): $(OBJ)
@$(CC) $(OBJ) $(LDFLAGS) -o $@