-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathMakefile.noauto
132 lines (106 loc) · 2.56 KB
/
Makefile.noauto
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
## Uncomment if you have gcc
#CC = gcc
#CFLAGS = -Wall -g -O2
#LDFLAGS =
#LDLIBS =
#CFLAGS += -Dsysconfdir=\"/etc\"
CFLAGS = -DDEBUG=1 -DENABLE_DUMP=1
## NOTE: if you get errors when linking qstat (missing symbols or
## libraries), then modify LDFLAGS or LDLIBS
SRC = \
utils.c \
xform.c \
config.c \
debug.c \
hcache.c \
md5.c \
qserver.c \
qstat.c \
template.c \
display_json.c \
ut2004.c \
a2s.c \
packet_manip.c \
gs3.c \
gs2.c \
gps.c \
ts2.c \
doom3.c \
tm.c \
haze.c \
wic.c \
ottd.c \
fl.c \
tee.c \
ts3.c \
bfbc2.c \
ventrilo.c \
cube2.c \
mumble.c \
terraria.c \
crysis.c \
dirtybomb.c \
starmade.c \
farmsim.c \
ksp.c \
tf.c \
armyops.c
SOURCES = \
version.h \
$(SRC)
OBJ = $(SRC:.c=.obj)
O = $(SRC:.c=.o)
SOLARIS_LIBS = -lsocket -lnsl
WINDOWS_LIBS = wsock32.lib
OS2_LIBS = so32dll.lib tcp32dll.lib
EMX_LIBS = -lsocket
ifdef MAKEDIR: # gmake: false; nmake: unused target
!ifdef MAKEDIR # gmake: not seen; nmake: true
# nmake specific code
LINK = link.exe
LFLAGS = /nologo
CFLAGS = $(CFLAGS) /nologo
PHONY = .phony
.phony:
.version: $(PHONY)
call scripts/gen-version.cmd
version.h: .version
!else # and now the other
else
# gnu make targets
.PHONY: .compiler_flags
.compiler_flags:
echo '$(CFLAGS)' | cmp -s - $@ || echo '$(CFLAGS)' > $@
.PHONY: .version
.version:
@ver=$$(./scripts/version.sh); \
echo "$$ver" | cmp -s - $@ || echo "$$ver" > $@
version.h: .version
@ver=$$(cat .version); \
file=$$(sed "s/CHANGEME/$$ver/g" ./version.h.tmpl); \
echo "$$file" | cmp -s - $@ || echo "$$file" > $@
endif # gmake: close condition; nmake: not seen
!endif : # gmake: unused target; nmake close conditional
all: qstat
qstat: .compiler_flags version.h $(O)
$(CC) $(CFLAGS) -o qstat $(O) $(LDFLAGS) $(LDLIBS)
solaris: .compiler_flags $(SOURCES)
$(CC) $(CFLAGS) -o qstat $(SRC) $(LDFLAGS) $(LDLIBS) $(SOLARIS_LIBS)
aix sgi freebsd macosx osx openbsd irix linux: qstat
hp hpux: .compiler_flags $(SOURCES)
$(CC) $(CFLAGS) -Ae -o qstat $(SRC) $(LDFLAGS) $(LDLIBS)
win32: windows
.c.obj:
$(CC) $(CFLAGS) -c $<
# windows dynamic rebuild but doesn't handle a QSTAT_VERSION change.
# use the clean target to force a rebuild.
qstat.exe: version.h $(OBJ)
$(LINK) $(LFLAGS) $(OBJ) $(WINDOWS_LIBS) /out:$@
# windows release forced
windows: $(SOURCES)
$(CC) $(CFLAGS) $(SRC) /Feqstat.exe $(WINDOWS_LIBS)
# windows debug forced
windows_debug: $(SOURCES)
$(CC) $(CFLAGS) /Zi $(SRC) /Feqstat.exe $(WINDOWS_LIBS) /link /fixed:no /incremental:no
clean:
-rm -f qstat core qstat.exe *.pdb .compiler_flags .version version.h $(O) $(OBJ)