-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathImakefile
164 lines (127 loc) · 4.43 KB
/
Imakefile
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
157
158
159
160
161
162
163
164
/* Do not edit. See INSTALL for details. */
#include "Netrek.tmpl"
TARGET = netrek
#if SystemV
EXTRA_LIBS = -lBSD
#endif
/* use -lX11 intead of $(XLIB) so Xext doesn't get included. */
SYS_LIBRARIES = -L/usr/lib/X11 -L/usr/X11/lib -lX11 $(MP_LIB) $(EXTRA_LIBS) -lm
EXTRA_INCLUDES = -I. -I./bitmaps $(MP_INCLUDE) $(EXTRA_INCS)
STD_HEADERS = Wlib.h bitmapstuff.h copyright.h copyright2.h data.h defs.h \
packets.h version.h struct.h netrek.h
#if ShortPackets
WTEXT = wtext.h
#endif
HEADERS = $(STD_HEADERS) $(WTEXT)
#if DynamicBitmaps
DYN_SRCS = bitmaps.c RotateBitmap.c
DYN_OBJS = bitmaps.o RotateBitmap.o
#endif
#if BD_
BD_SRCS = bd.c
BD_OBJS = bd.o
#endif
#if SPTest
SPTEST_SRCS = sptest.c
SPTEST_OBJS = sptest.o
#endif
#if RSA_
RSA_SRCS = rsa_box.c $(RSA_BOX_SRCS)
RSA_OBJS = rsa_box.o $(RSA_BOX_OBJS)
#endif
#if !HaveRandom
RAND_SRCS = random.c
RAND_OBJS = random.o
#endif
#if !HaveRInt
RINT_SRCS = rint.c
RINT_OBJS = rint.o
#endif
#if Feature
FEATURE_SRCS = feature.c feature_old.c macrowin.c distsend.c distress.c
FEATURE_OBJS = feature.o feature_old.o macrowin.o distsend.o distress.o
#endif
/* Dashboard is no longer optional */
DASHBOARD_SRCS = brmh-dashboard.c cow-dashboard.c text-dashboard.c
DASHBOARD_OBJS = brmh-dashboard.o cow-dashboard.o text-dashboard.o
#if FontBitmaps
FONTBITMAP_SRCS = fontbm.c
FONTBITMAP_OBJS = fontbm.o
#endif
#if ShortPackets
SP_SRCS = spwarning.c
SP_OBJS = spwarning.o
#endif
#if NetStat
NETSTAT_SRCS = netstat.c lagmeter.c
NETSTAT_OBJS = netstat.o lagmeter.o
#endif
#if Metaserver
META_SRCS = metaserver.c
META_OBJS = metaserver.o
#endif
#if Record || RecordDebug
RECORD_SRCS = recorder.c
RECORD_OBJS = recorder.o
#endif
SRCS = colors.c data.c death.c defaults.c defwin.c detonate.c dmessage.c \
enter.c entrywin.c findslot.c getdefaults.c getname.c \
getship.c helpwin.c inform.c input.c interface.c \
main.c mkdefault.c motdwin.c newwin.c option.c ping.c pingstats.c \
planetlist.c planets.c playerlist.c ranklist.c redraw.c reserved.c \
rotate.c sintab.c smessage.c socket.c stats.c udpopt.c util.c war.c \
warning.c x11window.c $(NETSTAT_SRCS) $(DYN_SRCS) $(BD_SRCS) \
$(SPTEST_SRCS) $(RSA_SRCS) $(RAND_SRCS) $(RINT_SRCS) $(FEATURE_SRCS) \
$(SP_SRCS) $(DASHBOARD_SRCS) $(FONTBITMAP_SRCS) $(META_SRCS) \
$(RECORD_SRCS)
OBJS = colors.o data.o death.o defaults.o defwin.o detonate.o dmessage.o \
enter.o entrywin.o findslot.o getdefaults.o getname.o \
getship.o helpwin.o inform.o input.o interface.o \
main.o mkdefault.o motdwin.o newwin.o option.o ping.o pingstats.o \
planetlist.o planets.o playerlist.o ranklist.o redraw.o reserved.o \
rotate.o sintab.o smessage.o socket.o stats.o udpopt.o util.o war.o \
warning.o x11window.o $(NETSTAT_OBJS) $(RAND_OBJS) $(RINT_OBJS) \
$(DYN_OBJS) $(BD_OBJS) $(SPTEST_OBJS) $(RSA_OBJS) $(FEATURE_OBJS) \
$(SP_OBJS) $(DASHBOARD_OBJS) $(FONTBITMAP_OBJS) $(META_OBJS) \
$(RECORD_OBJS)
AllTarget(randomize)
NormalProgramTarget(randomize,randomize.o $(RAND_OBJS),,,)
AllTarget($(TARGET))
NormalProgramTargetRandomize($(TARGET),$(OBJS),,,,./randomize)
InstallProgram($(TARGET),$(NETREK_BIN))
DependTarget()
#if RSA_
NormalProgramTarget(mkkey,mkkey.o $(RAND_OBJS),,,)
#endif
#ifdef SaberProgramTarget
SaberProgramTarget($(TARGET), $(SRCS), $(OBJS),$(LDLIBS),)
#endif
/* A test of the effects of putting all code in one file */
NormalProgramTarget(netrektest,BIG.o,,,)
BIG.c: protos.h
$(RM) allincludes.h
grep -h "^#include" $(SRCS) > allincludes.h
cat allincludes.h protos.h $(SRCS) > BIG
mv BIG BIG.c
protos.h:
$(RM) protos.h
cproto -e -f3 -m -D__STDC__ -D_NO_DEPEND -DCPROTO $(EXTRA_DEFINES) $(ALLINCLUDES) $(SRCS) > protos.h
World ::
$(MAKE) $(MFLAGS) depend
$(MAKE) $(MFLAGS) all
/* for dec: the -O4 flag doesn't work with -c. To build netrek, first
build randomize, mkkey, and rsa-client.c and then make netrek:
make randomize mkkey rsa-client.c
make CDEBUGFLAGS=-O4 netrek.dec
*/
netrek.dec:
$(RM) netrek
purify $(CC) $(CFLAGS) -o netrek `./randomize $(SRCS)` $(LDOPTIONS) \
$(LDLIBS) $(EXTRA_LOAD_FLAGS)
NormalProgramTarget(xdebug_packets,xdebug_packets.o,,XawClientLibs,-lm)
Protos(protos.h, $(SRCS))
#ifdef SaberProgramTarget
SaberProgramTarget(xdebug_packets, xdebug_packets.c, xdebug_packets.o,XawClientLibs,-lm)
#endif
proto-%:
cproto -p -m -s -f3 -D__STDC__ -D_NO_DEPEND -DCPROTO $(EXTRA_DEFINES) $(ALLINCLUDES) $* | grep static