forked from KS-Presto/Wolf4SDL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
108 lines (83 loc) · 2.04 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
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
101
102
103
104
105
106
107
108
CONFIG ?= config.default
-include $(CONFIG)
BINARY ?= nakedwolf3d
PREFIX ?= /usr/local
MANPREFIX ?= $(PREFIX)
UNAME := $(shell uname -s)
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL) -m 555 -s
INSTALL_MAN ?= $(INSTALL) -m 444
INSTALL_DATA ?= $(INSTALL) -m 444
SDL_CONFIG ?= sdl2-config
CFLAGS_SDL ?= $(shell $(SDL_CONFIG) --cflags)
LDFLAGS_SDL ?= $(shell $(SDL_CONFIG) --libs)
CFLAGS += $(CFLAGS_SDL)
CFLAGS += -Wall
CFLAGS += -g
CFLAGS += -Wpointer-arith
CFLAGS += -Wreturn-type
CFLAGS += -Wwrite-strings
CFLAGS += -Wcast-align
CCFLAGS += $(CFLAGS)
CCFLAGS += -Werror-implicit-function-declaration
CCFLAGS += -Wimplicit-int
CCFLAGS += -Wsequence-point
CXXFLAGS += $(CFLAGS)
LDFLAGS += $(LDFLAGS_SDL)
LDFLAGS += -lSDL2_mixer
SRCS :=
SRCS += fmopl.cpp
SRCS += id_ca.cpp
SRCS += id_in.cpp
SRCS += id_pm.cpp
SRCS += id_sd.cpp
SRCS += id_us_1.cpp
SRCS += id_vh.cpp
SRCS += id_vl.cpp
SRCS += signon.cpp
SRCS += wl_act1.cpp
SRCS += wl_act2.cpp
SRCS += wl_agent.cpp
SRCS += wl_draw.cpp
SRCS += wl_game.cpp
SRCS += wl_inter.cpp
SRCS += wl_main.cpp
SRCS += wl_menu.cpp
SRCS += wl_play.cpp
SRCS += wl_state.cpp
SRCS += wl_text.cpp
SRCS += crt.cpp
DEPS = $(filter %.d, $(SRCS:.c=.d) $(SRCS:.cpp=.d))
OBJS = $(filter %.o, $(SRCS:.c=.o) $(SRCS:.cpp=.o))
.SUFFIXES:
.SUFFIXES: .c .cpp .d .o
Q ?= @
all: $(BINARY)
ifndef NO_DEPS
depend: $(DEPS)
ifeq ($(findstring $(MAKECMDGOALS), clean depend Data),)
-include $(DEPS)
endif
endif
$(BINARY): $(OBJS)
@echo '===> LD $@'
$(Q)$(CXX) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@
.c.o:
@echo '===> CC $<'
$(Q)$(CC) $(CCFLAGS) -c $< -o $@
.cpp.o:
@echo '===> CXX $<'
$(Q)$(CXX) $(CXXFLAGS) -c $< -o $@
.c.d:
@echo '===> DEP $<'
$(Q)$(CC) $(CCFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
.cpp.d:
@echo '===> DEP $<'
$(Q)$(CXX) $(CXXFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
clean distclean:
@echo '===> CLEAN'
$(Q)rm -fr $(DEPS) $(OBJS) $(BINARY)
install: $(BINARY)
@echo '===> INSTALL'
$(Q)$(INSTALL) -d $(PREFIX)/bin
$(Q)$(INSTALL_PROGRAM) $(BINARY) $(PREFIX)/bin