-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.osx
156 lines (128 loc) · 3.31 KB
/
Makefile.osx
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
CONFIG ?= config.default
-include $(CONFIG)
CC = gcc-mp-4.8
CXX = g++-mp-4.8 -std=c++11
BINARY ?= autowolf
PREFIX ?= /usr/local
MANPREFIX ?= $(PREFIX)
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL) -m 555 -s
INSTALL_MAN ?= $(INSTALL) -m 444
INSTALL_DATA ?= $(INSTALL) -m 444
SDL_CONFIG ?= sdl-config
CFLAGS_SDL ?= $(shell $(SDL_CONFIG) --cflags)
LDFLAGS_SDL ?= $(shell $(SDL_CONFIG) --libs)
CFLAGS += $(CFLAGS_SDL)
#CFLAGS += -Wall
#CFLAGS += -W
CFLAGS += -Wpointer-arith
CFLAGS += -Wreturn-type
CFLAGS += -Wwrite-strings
CFLAGS += -Wcast-align
ifdef GPL
CFLAGS += -DUSE_GPL
endif
CFLAGS += -DMEMMEM_NOT_DEFINED
CCFLAGS += $(CFLAGS)
CCFLAGS += -std=gnu99
CCFLAGS += -Werror-implicit-function-declaration
CCFLAGS += -Wimplicit-int
CCFLAGS += -Wsequence-point
CXXFLAGS += $(CFLAGS)
LDFLAGS += $(LDFLAGS_SDL)
LDFLAGS += -lSDL_mixer
ifneq (,$(findstring MINGW,$(shell uname -s)))
LDFLAGS += -static-libgcc
endif
SRCS :=
SRCS += src/ActorStates.cpp
SRCS += src/CheckSum.cpp
SRCS += src/Config.cpp
SRCS += src/DataFile.cpp
SRCS += src/DirectoryFile.cpp
SRCS += src/Exception.cpp
SRCS += src/dosbox/dbopl.cpp
SRCS += src/e_hashkeys.cpp
SRCS += src/HistoryRatio.cpp
SRCS += src/i_system.cpp
SRCS += src/i_video.cpp
SRCS += src/id_ca.cpp
SRCS += src/id_in.cpp
SRCS += src/id_pm.cpp
SRCS += src/id_sd.cpp
SRCS += src/id_us_1.cpp
SRCS += src/id_vh.cpp
SRCS += src/id_vl.cpp
SRCS += src/ioan_bas.cpp
SRCS += src/ioan_bot.cpp
SRCS += src/ioan_secret.cpp
SRCS += src/m_buffer.cpp
SRCS += src/macosx/CocoaFun.mm
SRCS += src/MapExploration.cpp
SRCS += src/MasterDirectoryFile.cpp
SRCS += src/obattrib.cpp
SRCS += src/PathArray.cpp
SRCS += src/Property.cpp
SRCS += src/PropertyFile.cpp
SRCS += src/PString.cpp
#SRCS += src/sdl_winmain.cpp
SRCS += src/signon.cpp
SRCS += src/SODFlag.cpp
SRCS += src/wl_act1.cpp
SRCS += src/wl_act2.cpp
SRCS += src/wl_agent.cpp
SRCS += src/wl_atmos.cpp
SRCS += src/wl_cloudsky.cpp
SRCS += src/wl_debug.cpp
SRCS += src/wl_dir3dspr.cpp
SRCS += src/wl_draw.cpp
SRCS += src/wl_floorceiling.cpp
SRCS += src/wl_game.cpp
SRCS += src/wl_inter.cpp
SRCS += src/wl_main.cpp
SRCS += src/wl_menu.cpp
SRCS += src/wl_parallax.cpp
SRCS += src/wl_play.cpp
SRCS += src/wl_shade.cpp
SRCS += src/wl_state.cpp
SRCS += src/wl_text.cpp
DEPS = $(filter %.d, $(SRCS:.c=.d) $(SRCS:.cpp=.d) $(SRCS:.m=.d) $(SRCS:.mm=.d))
OBJS = $(filter %.o, $(SRCS:.c=.o) $(SRCS:.cpp=.o) $(SRCS:.m=.o) $(SRCS:.mm=.o))
.SUFFIXES:
.SUFFIXES: .c .cpp .m .mm .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 $@
.m.o:
@echo '===> CC $<'
$(Q)$(CC) $(CCFLAGS) -c $< -o $@
.cpp.o:
@echo '===> CXX $<'
$(Q)$(CXX) $(CXXFLAGS) -c $< -o $@
.mm.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) $(BINARY).exe
install: $(BINARY)
@echo '===> INSTALL'
$(Q)$(INSTALL) -d $(PREFIX)/bin
$(Q)$(INSTALL_PROGRAM) $(BINARY) $(PREFIX)/bin