| 1 | : $Name: 1_6_0 $ |
|---|
| 2 | case $CONFIG in |
|---|
| 3 | '') |
|---|
| 4 | if 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 | elif test -f ../../../../config.sh; then TOP=../../../..; |
|---|
| 9 | else |
|---|
| 10 | echo "Can't find config.sh."; exit 1 |
|---|
| 11 | fi |
|---|
| 12 | . $TOP/config.sh |
|---|
| 13 | ;; |
|---|
| 14 | esac |
|---|
| 15 | : This forces SH files to create target in same directory as SH file. |
|---|
| 16 | : This is so that make depend always knows where to find SH derivatives. |
|---|
| 17 | case "$0" in |
|---|
| 18 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
|---|
| 19 | esac |
|---|
| 20 | |
|---|
| 21 | echo "Extracting Makefile (with variable substitutions)" |
|---|
| 22 | |
|---|
| 23 | : This section of the file will have variable substitutions done on it. |
|---|
| 24 | : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. |
|---|
| 25 | : Protect any dollar signs and backticks that you do not want interpreted |
|---|
| 26 | : by putting a backslash in front. You may delete these comments. |
|---|
| 27 | $spitshell >Makefile <<!GROK!THIS! |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | CC=$cc |
|---|
| 41 | CCFLAGS=$optimize $ccflags -I.. -I../hdrs |
|---|
| 42 | LDFLAGS=$ldflags |
|---|
| 43 | CLIBS=$libs $cryptlib |
|---|
| 44 | LNS=$lns |
|---|
| 45 | !GROK!THIS! |
|---|
| 46 | |
|---|
| 47 | : In the following dollars and backticks do not need the extra backslash. |
|---|
| 48 | $spitshell >>Makefile <<'!NO!SUBS!' |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | SHELL=/bin/sh |
|---|
| 53 | BUILDDATE=\"\`date\`\" |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | all: dune.h options.h game/mush.cnf |
|---|
| 57 | @echo "Making all in src." |
|---|
| 58 | (cd src; make all "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 59 | "BUILDDATE=$(BUILDDATE)" \ |
|---|
| 60 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 61 | @echo "If the make was successful, use 'make install' to install links" |
|---|
| 62 | |
|---|
| 63 | dune.h: dune.h.dist |
|---|
| 64 | @echo "Please use 'make update' to update your dune.h file from dune.h.dist" |
|---|
| 65 | @echo "Or you may cp dune.h.dist to dune.h and edit it." |
|---|
| 66 | exit 1 |
|---|
| 67 | |
|---|
| 68 | options.h: options.h.dist |
|---|
| 69 | @echo "Please use 'make update' to update your options.h file from options.h.dist" |
|---|
| 70 | @echo "You must cp options.h.dist to options.h and edit it." |
|---|
| 71 | exit 1 |
|---|
| 72 | |
|---|
| 73 | install: game/mush.cnf netmud mkindx |
|---|
| 74 | -rm -f game/netmush |
|---|
| 75 | -rm -f game/mkindx |
|---|
| 76 | (cd game; \ |
|---|
| 77 | $(LNS) ../src/netmud netmush; \ |
|---|
| 78 | $(LNS) ../src/mkindx mkindx) |
|---|
| 79 | @echo "If you plan to run multiple MUSHes, consider running 'make customize'" |
|---|
| 80 | |
|---|
| 81 | netmud: |
|---|
| 82 | (cd src; make netmud "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 83 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 84 | |
|---|
| 85 | mkindx: |
|---|
| 86 | (cd src; make mkindx "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 87 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 88 | |
|---|
| 89 | portmsg: |
|---|
| 90 | (cd src; make portmsg "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 91 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 92 | |
|---|
| 93 | concentrate: |
|---|
| 94 | (cd src; make concentrate "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 95 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 96 | |
|---|
| 97 | install_conc: concentrate |
|---|
| 98 | -rm -f game/concentrate |
|---|
| 99 | (cd game; $(LNS) ../src/concentrate concentrate) |
|---|
| 100 | |
|---|
| 101 | announce: |
|---|
| 102 | (cd src; make announce "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 103 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 104 | |
|---|
| 105 | rwho_made: |
|---|
| 106 | (cd src/RWHO; make CC="$(CC)" CCFLAGS="$(CCFLAGS)") |
|---|
| 107 | (cd src; touch rwho_made) |
|---|
| 108 | |
|---|
| 109 | ident_made: |
|---|
| 110 | (cd src/IDENT; make CC="$(CC)" CCFLAGS="$(CCFLAGS)") |
|---|
| 111 | (cd src; touch ident_made) |
|---|
| 112 | |
|---|
| 113 | dump: |
|---|
| 114 | (cd src; make dump "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 115 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 116 | |
|---|
| 117 | extract: |
|---|
| 118 | (cd src; make extract "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 119 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 120 | |
|---|
| 121 | decompress: |
|---|
| 122 | (cd src; make decompress "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 123 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 124 | |
|---|
| 125 | safety: |
|---|
| 126 | cp src/*.c /var/pennmush-bak/src |
|---|
| 127 | cp hdrs/*.h /var/pennmush-bak/hdrs |
|---|
| 128 | cp * /var/pennmush-bak |
|---|
| 129 | |
|---|
| 130 | distdepend: |
|---|
| 131 | (cd src; make depend "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 132 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 133 | |
|---|
| 134 | # REQUIRES GNU INDENT! DON'T INDENT WITH ANYTHING ELSE! |
|---|
| 135 | indent: |
|---|
| 136 | (cd src; make indent) |
|---|
| 137 | |
|---|
| 138 | protoize: |
|---|
| 139 | (cd src; make protoize "CCFLAGS=$(CCFLAGS)") |
|---|
| 140 | |
|---|
| 141 | !NO!SUBS! |
|---|
| 142 | |
|---|
| 143 | : This section of the file will have variable substitutions done on it. |
|---|
| 144 | : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. |
|---|
| 145 | : Protect any dollar signs and backticks that you do not want interpreted |
|---|
| 146 | : by putting a backslash in front. You may delete these comments. |
|---|
| 147 | $spitshell >>Makefile <<!GROK!THIS! |
|---|
| 148 | |
|---|
| 149 | customize: update-conf |
|---|
| 150 | -@$perl customize.pl |
|---|
| 151 | |
|---|
| 152 | update-conf: game/mushcnf.dst |
|---|
| 153 | -@$perl update-cnf.pl game/mush.cnf game/mushcnf.dst |
|---|
| 154 | |
|---|
| 155 | game/mush.cnf: game/mushcnf.dst |
|---|
| 156 | -@$perl update-cnf.pl game/mush.cnf game/mushcnf.dst |
|---|
| 157 | |
|---|
| 158 | update: update-hdr update-conf |
|---|
| 159 | |
|---|
| 160 | update-hdr: |
|---|
| 161 | -@$perl update.pl options.h options.h.dist |
|---|
| 162 | -@$perl update.pl dune.h dune.h.dist |
|---|
| 163 | |
|---|
| 164 | !GROK!THIS! |
|---|
| 165 | |
|---|
| 166 | : In the following dollars and backticks do not need the extra backslash. |
|---|
| 167 | $spitshell >>Makefile <<'!NO!SUBS!' |
|---|
| 168 | |
|---|
| 169 | clean: |
|---|
| 170 | (cd src; make clean) |
|---|
| 171 | (cd game; rm -f netmush mkindx) |
|---|
| 172 | |
|---|
| 173 | distclean: |
|---|
| 174 | (cd src; make distclean) |
|---|
| 175 | (cd hdrs; rm -f *.orig *~ \#* *.rej *.bak) |
|---|
| 176 | (cd game; rm -rf *.log netmush mkindx *.orig *~ *.bak mush.cnf) |
|---|
| 177 | (cd game/txt; make clean) |
|---|
| 178 | |
|---|
| 179 | totallyclean: distclean |
|---|
| 180 | (cd hdrs; rm -rf *.rej) |
|---|
| 181 | (cd src; rm -rf *.rej) |
|---|
| 182 | -rm -f Makefile |
|---|
| 183 | |
|---|
| 184 | distci: distclean ci-src ci-game |
|---|
| 185 | |
|---|
| 186 | ci-src: |
|---|
| 187 | -(yes . | ci -l -f -N$(NAME) FAQ* BUGS CHANGE* READ* Configure \ |
|---|
| 188 | configure update.pl customize.pl Makefile.SH Patchlevel \ |
|---|
| 189 | *.dist src/Makefile src/IDENT/* src/RWHO/* src/*.c hdrs/* hints/* ) |
|---|
| 190 | |
|---|
| 191 | ci-game: |
|---|
| 192 | -(yes . | ci -l -f -N$(NAME) game/restart game/mushcnf.dst \ |
|---|
| 193 | game/txt/* game/txt/nws/* game/txt/evt/* game/txt/hlp/* ) |
|---|
| 194 | |
|---|
| 195 | diffs: |
|---|
| 196 | -(rcsdiff -c -r$(OLD) Patchlevel FAQ* BUGS CHANGE* READ* Configure \ |
|---|
| 197 | configure update.pl customize.pl Makefile.SH \ |
|---|
| 198 | *.dist src/Makefile src/IDENT/* src/RWHO/* src/*.c hdrs/*.h hints/* >> /tmp/diffs) |
|---|
| 199 | |
|---|
| 200 | etags: |
|---|
| 201 | (cd src; make etags) |
|---|
| 202 | |
|---|
| 203 | ctags: |
|---|
| 204 | (cd src; make ctags) |
|---|
| 205 | |
|---|
| 206 | dist.tar.Z: distclean dist.tar |
|---|
| 207 | compress /tmp/dist.tar |
|---|
| 208 | |
|---|
| 209 | dist.tar.gz: distclean dist.tar |
|---|
| 210 | gzip /tmp/dist.tar |
|---|
| 211 | |
|---|
| 212 | dist.tar: distclean |
|---|
| 213 | (tar -cvFFfX /tmp/dist.tar exclude.tar \ |
|---|
| 214 | Patchlevel FAQ* BUGS CHANGE* READ* Configure configure \ |
|---|
| 215 | update*.pl customize.pl Makefile.SH config_h.SH confmagic.h \ |
|---|
| 216 | options.h.dist dune.h.dist src hdrs game hints win32) |
|---|
| 217 | (pgp -sb /tmp/dist.tar) |
|---|
| 218 | |
|---|
| 219 | CSRImalloc.tar.Z: |
|---|
| 220 | (cd src/CSRI; make clean) |
|---|
| 221 | (tar -cvFFf /tmp/CSRImalloc.tar `cat exclude.tar`) |
|---|
| 222 | compress /tmp/CSRImalloc.tar |
|---|
| 223 | |
|---|
| 224 | !NO!SUBS! |
|---|
| 225 | chmod 755 Makefile |
|---|