root/1.8.2/trunk/Makefile.SH

Revision 1171, 8.7 KB (checked in by shawnw, 12 months ago)

Prep for 1.8.2p8

  • Property svn:executable set to *
Line 
1case $CONFIG in
2'')
3    if test -f config.sh; then TOP=.;
4    elif test -f ../config.sh; then TOP=..;
5    elif test -f ../../config.sh; then TOP=../..;
6    elif test -f ../../../config.sh; then TOP=../../..;
7    elif test -f ../../../../config.sh; then TOP=../../../..;
8    else
9        echo "Can't find config.sh."; exit 1
10    fi
11    . $TOP/config.sh
12    ;;
13esac
14: This forces SH files to create target in same directory as SH file.
15: This is so that make depend always knows where to find SH derivatives.
16case "$0" in
17*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
18esac
19
20echo "Extracting Makefile (with variable substitutions)"
21
22if test "x$OSTYPE" = "xmsys"; then
23  INSTALL_LINKS="$lns ../src/netmud.exe netmush"
24else
25  INSTALL_LINKS="$lns ../src/netmud netmush; \
26                 $lns ../src/info_slave info_slave"
27fi
28
29: This section of the file will have variable substitutions done on it.
30: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
31: Protect any dollar signs and backticks that you do not want interpreted
32: by putting a backslash in front.  You may delete these comments.
33$spitshell >Makefile <<!GROK!THIS!
34# Makefile for PennMUSH
35
36# - System configuration - #
37
38#
39# This section of the file should be automatically configured by
40# the Configure script. If it doesn't work, you might try starting
41# from the Makefile.old that's included instead, and reporting
42# your problem (including this Makefile) to pennmush-bugs@pennmush.org
43#
44# If you want to profile the code, add -pg -a -DPROFILING to CCFLAGS
45# and (probably) remove -O
46#
47$make_set_make
48CC=$cc
49CCFLAGS=$optimize -I.. -I../hdrs $ccflags $warnings
50LDFLAGS=$ldflags
51CLIBS=$libs $cryptlib $libssl $libmysqlclient
52INSTALL=$install
53INSTALLDIR=$installdir
54CP=$cp
55CHMOD=$chmod
56INSTALL_LINKS=$INSTALL_LINKS
57!GROK!THIS!
58
59: In the following dollars and backticks do not need the extra backslash.
60$spitshell >>Makefile <<'!NO!SUBS!'
61
62
63# stupid SYS V shell
64SHELL=/bin/sh
65# Where to install with 'make globalinstall'
66GLOBAL_INSTALL=/usr/libexec/pennmush
67
68all: config.h options.h autogen game/mush.cnf
69    @echo "Making all in src."
70    (cd src; make all "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \
71    "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \
72    "MAKEFLAGS=$(MAKEFLAGS)")
73    @echo "If the make was successful, use 'make install' to install links."
74
75config.h: Configure
76    @echo "Looks like your Configure has been updated."
77    @echo "Run that first."
78    exit 1
79
80options.h: options.h.dist
81    @echo "Please use 'make update' to update your options.h file from options.h.dist"
82    @echo "You must cp options.h.dist to options.h and edit it."
83    exit 1
84
85autogen: hdrs/cmds.h hdrs/funs.h hdrs/switches.h
86
87hdrs/cmds.h: src/cmds.c src/command.c src/cque.c src/help.c src/set.c src/sql.c Patchlevel
88    (cd utils; sh mkcmds.sh commands)
89
90hdrs/switches.h: src/SWITCHES Patchlevel
91    (cd utils; sh mkcmds.sh switches)
92
93src/switchinc.c: src/SWITCHES Patchlevel
94    (cd utils; sh mkcmds.sh switches)
95
96hdrs/funs.h: src/fun*.c src/bsd.c src/conf.c src/extmail.c src/help.c src/wiz.c src/sql.c Patchlevel
97    (cd utils; sh mkcmds.sh functions)
98
99hdrs/patches.h: patches/*
100    (cd utils; sh mkcmds.sh patches)
101
102install: localized all
103    -rm -f game/netmush
104    -rm -f game/info_slave
105    (cd game; $(INSTALL_LINKS))
106    (cd game/txt; make)
107    @echo "If you plan to run multiple MUSHes, consider running 'make customize'"
108
109netmud:
110    (cd src; make netmud "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \
111    "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" )
112
113access:
114    utils/make_access_cnf.sh game
115
116pennmush.pot:
117    (cd src; make ../po/pennmush.pot)
118
119localized:
120    -echo "Localizing for your locale..."
121    -(cd po; make localized)
122
123portmsg:
124    (cd src; make portmsg "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \
125    "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" )
126
127announce:
128    (cd src; make announce "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \
129    "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" )
130
131ssl_slave:
132    (cd src; make ssl_slave "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \
133    "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \
134    "MAKEFLAGS=$(MAKEFLAGS)")
135
136versions: CHANGES*
137    -@rm -rf CHANGES*~ CHANGES*bak
138    @utils/mkvershlp.pl game/txt/hlp CHANGES*
139
140safety:
141    $(CP) src/*.c /var/pennmush-bak/src
142    $(CP) hdrs/*.h /var/pennmush-bak/hdrs
143    $(CP) * /var/pennmush-bak
144
145distdepend: hdrs/funs.h hdrs/cmds.h
146    (cd src; make depend "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \
147    "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" )
148
149local-files:
150    $(CP) -f src/cmdlocal.dst src/cmdlocal.c
151    $(CP) -f src/flaglocal.dst src/flaglocal.c
152    $(CP) -f src/funlocal.dst src/funlocal.c
153    $(CP) -f src/local.dst src/local.c
154
155# REQUIRES GNU INDENT! DON'T INDENT WITH ANYTHING ELSE!
156indent:
157    @(cd src; make indent)
158
159protoize:
160    (cd src; make protoize "CCFLAGS=$(CCFLAGS)")
161
162!NO!SUBS!
163
164: This section of the file will have variable substitutions done on it.
165: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
166: Protect any dollar signs and backticks that you do not want interpreted
167: by putting a backslash in front.  You may delete these comments.
168$spitshell >>Makefile <<!GROK!THIS!
169
170customize: update-conf
171    -@$perl utils/customize.pl
172
173# The default place to find the runtime files is in this directory,
174# but it can be overridden with env variables so people can use
175# other game directories.
176GAMEDIR=game
177
178update-conf: game/mushcnf.dst game/aliascnf.dst game/restrictcnf.dst game/namescnf.dst
179    -@$touch game/mushcnf.dst
180    -@$perl utils/update-cnf.pl \$(GAMEDIR)/mush.cnf game/mushcnf.dst
181    -@$touch game/aliascnf.dst
182    -@$perl utils/update-cnf.pl \$(GAMEDIR)/alias.cnf game/aliascnf.dst
183    -@$touch game/restrictcnf.dst
184    -@$perl utils/update-cnf.pl \$(GAMEDIR)/restrict.cnf game/restrictcnf.dst
185    -@if [ ! -f \$(GAMEDIR)/names.cnf ]; then \$(CP) game/namescnf.dst \$(GAMEDIR)/names.cnf; fi
186
187\$(GAMEDIR)/alias.cnf: game/aliascnf.dst
188    -@$touch game/aliascnf.dst
189    -@$perl utils/update-cnf.pl \$(GAMEDIR)/alias.cnf game/aliascnf.dst
190
191\$(GAMEDIR)/restrict.cnf: game/restrictcnf.dst
192    -@$touch game/restrictcnf.dst
193    -@$perl utils/update-cnf.pl \$(GAMEDIR)/restrict.cnf game/restrictcnf.dst
194
195\$(GAMEDIR)/names.cnf: game/namescnf.dst
196    if [ ! -f game/names.cnf ]; then \
197        \$(CP) game/namescnf.dst \$(GAMEDIR)/names.cnf \
198    fi
199
200\$(GAMEDIR)/mush.cnf: game/mushcnf.dst
201    -@$touch game/mushcnf.dst
202    -@$perl utils/update-cnf.pl \$(GAMEDIR)/mush.cnf game/mushcnf.dst
203
204update: update-hdr update-conf
205
206update-hdr:
207    -@$touch options.h.dist
208    -@sleep 2
209    -@$perl utils/update.pl options.h options.h.dist
210
211test: netmud
212    (cd test; $perl alltests.pl)
213
214!GROK!THIS!
215
216: In the following dollars and backticks do not need the extra backslash.
217$spitshell >>Makefile <<'!NO!SUBS!'
218
219clean:
220    (cd src; make clean)
221    (cd game; rm -f netmush info_slave)
222
223distclean:
224    (cd hdrs; rm -f *.orig *~ \#* *.rej *.bak funs.h cmds.h buildinf.h patches.h)
225    (cd utils; rm -f *.orig *~ \#* *.rej *.bak mkcmds.sh)
226    (cd game; rm -rf *.log netmush info_slave *.orig *.rej *~ *.bak mush.cnf)
227    (cd os2; rm -rf *.rej *.orig *~ *.bak)
228    (cd src; make distclean; rm -f Makefile)
229    (cd game/txt; make clean)
230    (rm -rf .config Makefile config.h config.sh options.h)
231
232totallyclean: distclean
233    (cd hdrs; rm -rf *.rej)
234    (cd src; rm -rf *.rej)
235    -rm -f Makefile
236
237distci: distclean ci-src ci-game
238
239ci-src:
240    -(yes . | ci -l -f -N$(NAME) FAQ* BUGS COPY* CHANGE* READ* MANIFEST \
241      Configure utils/* Makefile.SH Patchlevel config_h.SH confmagic.h \
242      *.dist src/Makefile src/SWITCHES src/*.c src/*.dst \
243      hdrs/* hints/* os2/*)
244
245ci-game:
246    -(yes . | ci -l -f -N$(NAME) game/restart game/mushcnf.dst \
247      game/access.README \
248      game/txt/* game/txt/nws/* game/txt/evt/* game/txt/hlp/* )
249
250diffs:
251    @make indent > /dev/null 2>&1
252    @make versions > /dev/null 2>&1
253    @make touchswitches > /dev/null 2>&1
254    @make autogen > /dev/null 2>&1
255    @(prcs diff -r$(VS) -N pennmush `cat MANIFEST` | grep -v 'Index:')
256
257checkin: versions autogen
258    @prcs checkin
259
260commit: indent
261    @svn commit
262
263patch: versions
264    @make-patch-header
265    @make diffs
266
267etags:
268    (cd src; make etags)
269
270ctags:
271    (cd src; make ctags)
272
273dist.tar.Z: distclean dist.tar
274    compress /tmp/dist.tar
275
276dist.tar.gz: distclean dist.tar
277    gzip /tmp/dist.tar
278
279touchswitches:
280    @touch src/SWITCHES
281
282dist.tar: indent distclean versions touchswitches autogen
283    makedist -c pennmush
284    tar -cvf /tmp/dist.tar pennmush
285    -pgp -sb /tmp/dist.tar
286    -rm -rf pennmush
287
288CSRImalloc.tar.Z:
289    (cd src/CSRI; make clean)
290    (tar -cvFFf /tmp/CSRImalloc.tar `cat exclude.tar`)
291    compress /tmp/CSRImalloc.tar
292
293globalinstall: install
294    (cd game/txt; make clean compose.sh)
295    $(INSTALLDIR) $(GLOBAL_INSTALL)
296    $(CP) -R game/* $(GLOBAL_INSTALL)
297    rm -f $(GLOBAL_INSTALL)/netmush $(GLOBAL_INSTALL)/info_slave
298    $(INSTALL) config.sh $(GLOBAL_INSTALL)/config.sh
299    $(INSTALL) src/netmud $(GLOBAL_INSTALL)/netmush
300    $(INSTALL) src/info_slave utils/ln-dir.sh $(GLOBAL_INSTALL)
301    $(CHMOD) a+rX -R $(GLOBAL_INSTALL)
302    @echo "** Files installed in $(GLOBAL_INSTALL). Feel free to move them."
303    @echo "** You can run $(GLOBAL_INSTALL)/ln-dir.sh to create a user directory,"
304    @echo "** or symlink that to somewhere easier to run. You may wish to strip them."
305
306!NO!SUBS!
307chmod 644 Makefile
Note: See TracBrowser for help on using the browser.