| 1 | case $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 | ;; |
|---|
| 13 | esac |
|---|
| 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. |
|---|
| 16 | case "$0" in |
|---|
| 17 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
|---|
| 18 | esac |
|---|
| 19 | |
|---|
| 20 | echo "Extracting Makefile (with variable substitutions)" |
|---|
| 21 | |
|---|
| 22 | if test "x$OSTYPE" = "xmsys"; then |
|---|
| 23 | INSTALL_LINKS="$lns ../src/netmud.exe netmush" |
|---|
| 24 | else |
|---|
| 25 | INSTALL_LINKS="$lns ../src/netmud netmush; \ |
|---|
| 26 | $lns ../src/info_slave info_slave" |
|---|
| 27 | fi |
|---|
| 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 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | $make_set_make |
|---|
| 48 | CC=$cc |
|---|
| 49 | CCFLAGS=$optimize -I.. -I../hdrs $ccflags $warnings |
|---|
| 50 | LDFLAGS=$ldflags |
|---|
| 51 | CLIBS=$libs $cryptlib $libssl $libmysqlclient |
|---|
| 52 | INSTALL=$install |
|---|
| 53 | INSTALLDIR=$installdir |
|---|
| 54 | CP=$cp |
|---|
| 55 | CHMOD=$chmod |
|---|
| 56 | INSTALL_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 | |
|---|
| 64 | SHELL=/bin/sh |
|---|
| 65 | |
|---|
| 66 | GLOBAL_INSTALL=/usr/libexec/pennmush |
|---|
| 67 | |
|---|
| 68 | all: 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 | |
|---|
| 75 | config.h: Configure |
|---|
| 76 | @echo "Looks like your Configure has been updated." |
|---|
| 77 | @echo "Run that first." |
|---|
| 78 | exit 1 |
|---|
| 79 | |
|---|
| 80 | options.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 | |
|---|
| 85 | autogen: hdrs/cmds.h hdrs/funs.h hdrs/switches.h |
|---|
| 86 | |
|---|
| 87 | hdrs/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 | |
|---|
| 90 | hdrs/switches.h: src/SWITCHES Patchlevel |
|---|
| 91 | (cd utils; sh mkcmds.sh switches) |
|---|
| 92 | |
|---|
| 93 | src/switchinc.c: src/SWITCHES Patchlevel |
|---|
| 94 | (cd utils; sh mkcmds.sh switches) |
|---|
| 95 | |
|---|
| 96 | hdrs/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 | |
|---|
| 99 | hdrs/patches.h: patches/* |
|---|
| 100 | (cd utils; sh mkcmds.sh patches) |
|---|
| 101 | |
|---|
| 102 | install: 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 | |
|---|
| 109 | netmud: |
|---|
| 110 | (cd src; make netmud "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 111 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 112 | |
|---|
| 113 | access: |
|---|
| 114 | utils/make_access_cnf.sh game |
|---|
| 115 | |
|---|
| 116 | pennmush.pot: |
|---|
| 117 | (cd src; make ../po/pennmush.pot) |
|---|
| 118 | |
|---|
| 119 | localized: |
|---|
| 120 | -echo "Localizing for your locale..." |
|---|
| 121 | -(cd po; make localized) |
|---|
| 122 | |
|---|
| 123 | portmsg: |
|---|
| 124 | (cd src; make portmsg "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 125 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 126 | |
|---|
| 127 | announce: |
|---|
| 128 | (cd src; make announce "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 129 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 130 | |
|---|
| 131 | ssl_slave: |
|---|
| 132 | (cd src; make ssl_slave "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 133 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \ |
|---|
| 134 | "MAKEFLAGS=$(MAKEFLAGS)") |
|---|
| 135 | |
|---|
| 136 | versions: CHANGES* |
|---|
| 137 | -@rm -rf CHANGES*~ CHANGES*bak |
|---|
| 138 | @utils/mkvershlp.pl game/txt/hlp CHANGES* |
|---|
| 139 | |
|---|
| 140 | safety: |
|---|
| 141 | $(CP) src/*.c /var/pennmush-bak/src |
|---|
| 142 | $(CP) hdrs/*.h /var/pennmush-bak/hdrs |
|---|
| 143 | $(CP) * /var/pennmush-bak |
|---|
| 144 | |
|---|
| 145 | distdepend: hdrs/funs.h hdrs/cmds.h |
|---|
| 146 | (cd src; make depend "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 147 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 148 | |
|---|
| 149 | local-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 | |
|---|
| 156 | indent: |
|---|
| 157 | @(cd src; make indent) |
|---|
| 158 | |
|---|
| 159 | protoize: |
|---|
| 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 | |
|---|
| 170 | customize: update-conf |
|---|
| 171 | -@$perl utils/customize.pl |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | GAMEDIR=game |
|---|
| 177 | |
|---|
| 178 | update-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 | |
|---|
| 204 | update: update-hdr update-conf |
|---|
| 205 | |
|---|
| 206 | update-hdr: |
|---|
| 207 | -@$touch options.h.dist |
|---|
| 208 | -@$perl utils/update.pl options.h options.h.dist |
|---|
| 209 | |
|---|
| 210 | test: netmud |
|---|
| 211 | (cd test; $perl alltests.pl) |
|---|
| 212 | |
|---|
| 213 | !GROK!THIS! |
|---|
| 214 | |
|---|
| 215 | : In the following dollars and backticks do not need the extra backslash. |
|---|
| 216 | $spitshell >>Makefile <<'!NO!SUBS!' |
|---|
| 217 | |
|---|
| 218 | clean: |
|---|
| 219 | (cd src; make clean) |
|---|
| 220 | (cd game; rm -f netmush info_slave) |
|---|
| 221 | |
|---|
| 222 | distclean: |
|---|
| 223 | (cd hdrs; rm -f *.orig *~ \ |
|---|
| 224 | (cd utils; rm -f *.orig *~ \ |
|---|
| 225 | (cd game; rm -rf *.log netmush info_slave *.orig *.rej *~ *.bak mush.cnf) |
|---|
| 226 | (cd os2; rm -rf *.rej *.orig *~ *.bak) |
|---|
| 227 | (cd src; make distclean; rm -f Makefile) |
|---|
| 228 | (cd game/txt; make clean) |
|---|
| 229 | (rm -rf .config Makefile config.h config.sh options.h) |
|---|
| 230 | |
|---|
| 231 | totallyclean: distclean |
|---|
| 232 | (cd hdrs; rm -rf *.rej) |
|---|
| 233 | (cd src; rm -rf *.rej) |
|---|
| 234 | -rm -f Makefile |
|---|
| 235 | |
|---|
| 236 | distci: distclean ci-src ci-game |
|---|
| 237 | |
|---|
| 238 | ci-src: |
|---|
| 239 | -(yes . | ci -l -f -N$(NAME) FAQ* BUGS COPY* CHANGE* READ* MANIFEST \ |
|---|
| 240 | Configure utils/* Makefile.SH Patchlevel config_h.SH confmagic.h \ |
|---|
| 241 | *.dist src/Makefile src/SWITCHES src/*.c src/*.dst \ |
|---|
| 242 | hdrs/* hints/* os2/*) |
|---|
| 243 | |
|---|
| 244 | ci-game: |
|---|
| 245 | -(yes . | ci -l -f -N$(NAME) game/restart game/mushcnf.dst \ |
|---|
| 246 | game/access.README \ |
|---|
| 247 | game/txt/* game/txt/nws/* game/txt/evt/* game/txt/hlp/* ) |
|---|
| 248 | |
|---|
| 249 | diffs: |
|---|
| 250 | @make indent > /dev/null 2>&1 |
|---|
| 251 | @make versions > /dev/null 2>&1 |
|---|
| 252 | @make touchswitches > /dev/null 2>&1 |
|---|
| 253 | @make autogen > /dev/null 2>&1 |
|---|
| 254 | @(prcs diff -r$(VS) -N pennmush `cat MANIFEST` | grep -v 'Index:') |
|---|
| 255 | |
|---|
| 256 | checkin: versions autogen |
|---|
| 257 | @prcs checkin |
|---|
| 258 | |
|---|
| 259 | commit: indent |
|---|
| 260 | @svn commit |
|---|
| 261 | |
|---|
| 262 | patch: versions |
|---|
| 263 | @make-patch-header |
|---|
| 264 | @make diffs |
|---|
| 265 | |
|---|
| 266 | etags: |
|---|
| 267 | (cd src; make etags) |
|---|
| 268 | |
|---|
| 269 | ctags: |
|---|
| 270 | (cd src; make ctags) |
|---|
| 271 | |
|---|
| 272 | dist.tar.Z: distclean dist.tar |
|---|
| 273 | compress /tmp/dist.tar |
|---|
| 274 | |
|---|
| 275 | dist.tar.gz: distclean dist.tar |
|---|
| 276 | gzip /tmp/dist.tar |
|---|
| 277 | |
|---|
| 278 | touchswitches: |
|---|
| 279 | @touch src/SWITCHES |
|---|
| 280 | |
|---|
| 281 | dist.tar: indent distclean versions touchswitches autogen |
|---|
| 282 | makedist -c pennmush |
|---|
| 283 | tar -cvf /tmp/dist.tar pennmush |
|---|
| 284 | -pgp -sb /tmp/dist.tar |
|---|
| 285 | -rm -rf pennmush |
|---|
| 286 | |
|---|
| 287 | CSRImalloc.tar.Z: |
|---|
| 288 | (cd src/CSRI; make clean) |
|---|
| 289 | (tar -cvFFf /tmp/CSRImalloc.tar `cat exclude.tar`) |
|---|
| 290 | compress /tmp/CSRImalloc.tar |
|---|
| 291 | |
|---|
| 292 | globalinstall: install |
|---|
| 293 | (cd game/txt; make clean compose.sh) |
|---|
| 294 | $(INSTALLDIR) $(GLOBAL_INSTALL) |
|---|
| 295 | $(CP) -R game/* $(GLOBAL_INSTALL) |
|---|
| 296 | rm -f $(GLOBAL_INSTALL)/netmush $(GLOBAL_INSTALL)/info_slave |
|---|
| 297 | $(INSTALL) config.sh $(GLOBAL_INSTALL)/config.sh |
|---|
| 298 | $(INSTALL) src/netmud $(GLOBAL_INSTALL)/netmush |
|---|
| 299 | $(INSTALL) src/info_slave utils/ln-dir.sh $(GLOBAL_INSTALL) |
|---|
| 300 | $(CHMOD) a+rX -R $(GLOBAL_INSTALL) |
|---|
| 301 | @echo "** Files installed in $(GLOBAL_INSTALL). Feel free to move them." |
|---|
| 302 | @echo "** You can run $(GLOBAL_INSTALL)/ln-dir.sh to create a user directory," |
|---|
| 303 | @echo "** or symlink that to somewhere easier to run. You may wish to strip them." |
|---|
| 304 | |
|---|
| 305 | !NO!SUBS! |
|---|
| 306 | chmod 644 Makefile |
|---|