| 1 | # Makefile for PennMUSH |
|---|
| 2 | |
|---|
| 3 | # - System configuration - # |
|---|
| 4 | |
|---|
| 5 | VERSION=1.8.3 |
|---|
| 6 | PATCHLEVEL=7 |
|---|
| 7 | |
|---|
| 8 | # |
|---|
| 9 | # This section of the file should be automatically configured by |
|---|
| 10 | # the Configure script. If it doesn't work, you might try starting |
|---|
| 11 | # from the Makefile.old that's included instead, and reporting |
|---|
| 12 | # your problem (including this Makefile) to pennmush-bugs@pennmush.org |
|---|
| 13 | # |
|---|
| 14 | # If you want to profile the code, add -pg -a -DPROFILING to CCFLAGS |
|---|
| 15 | # and (probably) remove -O |
|---|
| 16 | # |
|---|
| 17 | MAKE=@MAKE@ |
|---|
| 18 | CC=@CC@ |
|---|
| 19 | |
|---|
| 20 | SQL_CFLAGS=@MYSQL_CFLAGS@ @POSTGRESQL_CFLAGS@ @SQLITE3_CFLAGS@ |
|---|
| 21 | SQL_LDFLAGS=@MYSQL_LDFLAGS@ @POSTGRESQL_LDFLAGS@ @SQLITE3_LDFLAGS@ |
|---|
| 22 | |
|---|
| 23 | CCFLAGS=@CFLAGS@ -I.. -I../hdrs @CPPFLAGS@ @PCRE_CFLAGS@ |
|---|
| 24 | LDFLAGS=@LDFLAGS@ |
|---|
| 25 | CLIBS=@LIBS@ @PCRE_LIBS@ -lgc -lpthread |
|---|
| 26 | INSTALL=@INSTALL@ |
|---|
| 27 | INSTALLDIR=$installdir |
|---|
| 28 | CP=@CP@ |
|---|
| 29 | CHMOD=@CHMOD@ |
|---|
| 30 | INSTALL_LINKS=@LN_S@ ../src/netmud netmush; @LN_S@ ../src/info_slave info_slave |
|---|
| 31 | |
|---|
| 32 | # stupid SYS V shell |
|---|
| 33 | SHELL=/bin/sh |
|---|
| 34 | # Where to install with 'make globalinstall' |
|---|
| 35 | GLOBAL_INSTALL=@libexecdir@ |
|---|
| 36 | |
|---|
| 37 | all: config.h options.h autogen game/mush.cnf |
|---|
| 38 | @echo "Making all in src." |
|---|
| 39 | (cd src; @MAKE@ all "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 40 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \ |
|---|
| 41 | "MAKEFLAGS=$(MAKEFLAGS)" "SQL_CFLAGS=$(SQL_CFLAGS)" \ |
|---|
| 42 | "SQL_LDFLAGS=$(SQL_LDFLAGS)") |
|---|
| 43 | @echo "If the make was successful, use 'make install' to install links." |
|---|
| 44 | |
|---|
| 45 | config.h: configure |
|---|
| 46 | @echo "Looks like your configure has been updated." |
|---|
| 47 | @echo "Run that first. If you did just run configure and" |
|---|
| 48 | @echo "it said that config.h was unchanged, 'touch config.h'" |
|---|
| 49 | @echo "to suppress this message and continue compiling." |
|---|
| 50 | @exit 1 |
|---|
| 51 | |
|---|
| 52 | options.h: options.h.dist |
|---|
| 53 | @echo "Please use 'make update' to update your options.h file from options.h.dist" |
|---|
| 54 | @echo "You must cp options.h.dist to options.h and edit it." |
|---|
| 55 | @exit 1 |
|---|
| 56 | |
|---|
| 57 | autogen: hdrs/cmds.h hdrs/funs.h hdrs/switches.h |
|---|
| 58 | |
|---|
| 59 | hdrs/cmds.h: src/cmds.c src/command.c src/cque.c src/help.c src/set.c src/sql.c Patchlevel |
|---|
| 60 | @PERL@ utils/mkcmds.pl commands |
|---|
| 61 | |
|---|
| 62 | hdrs/switches.h: src/SWITCHES Patchlevel |
|---|
| 63 | @PERL@ utils/mkcmds.pl switches |
|---|
| 64 | |
|---|
| 65 | src/switchinc.c: src/SWITCHES Patchlevel |
|---|
| 66 | @PERL@ utils/mkcmds.pl switches |
|---|
| 67 | |
|---|
| 68 | hdrs/funs.h: src/fun*.c src/bsd.c src/conf.c src/extmail.c src/help.c src/markup.c src/wiz.c src/sql.c Patchlevel |
|---|
| 69 | @PERL@ utils/mkcmds.pl functions |
|---|
| 70 | |
|---|
| 71 | hdrs/patches.h: patches/* |
|---|
| 72 | @PERL@ utils/mkcmds.pl patches |
|---|
| 73 | |
|---|
| 74 | install: localized all |
|---|
| 75 | -rm -f game/netmush |
|---|
| 76 | -rm -f game/info_slave |
|---|
| 77 | (cd game; $(INSTALL_LINKS)) |
|---|
| 78 | (cd game/txt; make) |
|---|
| 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 | "SQL_CFLAGS=$(SQL_CFLAGS)" "SQL_LDFLAGS=$(SQL_LDFLAGS)" \ |
|---|
| 84 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 85 | |
|---|
| 86 | access: |
|---|
| 87 | utils/make_access_cnf.sh game |
|---|
| 88 | |
|---|
| 89 | pennmush.pot: |
|---|
| 90 | (cd src; make ../po/pennmush.pot) |
|---|
| 91 | |
|---|
| 92 | localized: |
|---|
| 93 | -echo "Localizing for your locale..." |
|---|
| 94 | -(cd po; make localized) |
|---|
| 95 | |
|---|
| 96 | portmsg: |
|---|
| 97 | (cd src; make portmsg "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 98 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 99 | |
|---|
| 100 | ssl_slave: |
|---|
| 101 | (cd src; make ssl_slave "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 102 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \ |
|---|
| 103 | "MAKEFLAGS=$(MAKEFLAGS)") |
|---|
| 104 | |
|---|
| 105 | versions: CHANGES* |
|---|
| 106 | -@rm -rf CHANGES*~ CHANGES*bak |
|---|
| 107 | @utils/mkvershlp.pl game/txt/hlp CHANGES* |
|---|
| 108 | |
|---|
| 109 | safety: |
|---|
| 110 | $(CP) src/*.c /var/pennmush-bak/src |
|---|
| 111 | $(CP) hdrs/*.h /var/pennmush-bak/hdrs |
|---|
| 112 | $(CP) * /var/pennmush-bak |
|---|
| 113 | |
|---|
| 114 | distdepend: hdrs/funs.h hdrs/cmds.h |
|---|
| 115 | (cd src; @MAKE@ depend "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ |
|---|
| 116 | "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" ) |
|---|
| 117 | |
|---|
| 118 | local-files: |
|---|
| 119 | $(CP) -f src/cmdlocal.dst src/cmdlocal.c |
|---|
| 120 | $(CP) -f src/flaglocal.dst src/flaglocal.c |
|---|
| 121 | $(CP) -f src/funlocal.dst src/funlocal.c |
|---|
| 122 | $(CP) -f src/local.dst src/local.c |
|---|
| 123 | |
|---|
| 124 | # REQUIRES GNU INDENT! DON'T INDENT WITH ANYTHING ELSE! |
|---|
| 125 | indent: |
|---|
| 126 | @(cd src; make indent) |
|---|
| 127 | |
|---|
| 128 | customize: update-conf |
|---|
| 129 | -@@PERL@ utils/customize.pl |
|---|
| 130 | |
|---|
| 131 | # The default place to find the runtime files is in this directory, |
|---|
| 132 | # but it can be overridden with env variables so people can use |
|---|
| 133 | # other game directories. |
|---|
| 134 | GAMEDIR=game |
|---|
| 135 | |
|---|
| 136 | update-conf: game/mushcnf.dst game/aliascnf.dst game/restrictcnf.dst game/namescnf.dst |
|---|
| 137 | -@@TOUCH@ game/mushcnf.dst |
|---|
| 138 | -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/mush.cnf game/mushcnf.dst |
|---|
| 139 | -@@TOUCH@ game/aliascnf.dst |
|---|
| 140 | -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/alias.cnf game/aliascnf.dst |
|---|
| 141 | -@@TOUCH@ game/restrictcnf.dst |
|---|
| 142 | -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/restrict.cnf game/restrictcnf.dst |
|---|
| 143 | -@if [ ! -f $(GAMEDIR)/names.cnf ]; then $(CP) game/namescnf.dst $(GAMEDIR)/names.cnf; fi |
|---|
| 144 | |
|---|
| 145 | $(GAMEDIR)/alias.cnf: game/aliascnf.dst |
|---|
| 146 | -@@TOUCH@ game/aliascnf.dst |
|---|
| 147 | -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/alias.cnf game/aliascnf.dst |
|---|
| 148 | |
|---|
| 149 | $(GAMEDIR)/restrict.cnf: game/restrictcnf.dst |
|---|
| 150 | -@@TOUCH@ game/restrictcnf.dst |
|---|
| 151 | -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/restrict.cnf game/restrictcnf.dst |
|---|
| 152 | |
|---|
| 153 | $(GAMEDIR)/names.cnf: game/namescnf.dst |
|---|
| 154 | if [ ! -f game/names.cnf ]; then \ |
|---|
| 155 | $(CP) game/namescnf.dst $(GAMEDIR)/names.cnf \ |
|---|
| 156 | fi |
|---|
| 157 | |
|---|
| 158 | $(GAMEDIR)/mush.cnf: game/mushcnf.dst |
|---|
| 159 | -@@TOUCH@ game/mushcnf.dst |
|---|
| 160 | -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/mush.cnf game/mushcnf.dst |
|---|
| 161 | |
|---|
| 162 | update: update-hdr update-conf |
|---|
| 163 | |
|---|
| 164 | update-hdr: |
|---|
| 165 | -@@TOUCH@ options.h.dist |
|---|
| 166 | -@sleep 2 |
|---|
| 167 | -@@PERL@ utils/update.pl options.h options.h.dist |
|---|
| 168 | |
|---|
| 169 | test: netmud |
|---|
| 170 | (cd test; @PERL@ alltests.pl) |
|---|
| 171 | |
|---|
| 172 | clean: |
|---|
| 173 | (cd src; make clean) |
|---|
| 174 | (cd game; rm -f netmush info_slave) |
|---|
| 175 | |
|---|
| 176 | distclean: |
|---|
| 177 | (cd hdrs; rm -f *.orig *~ \#* *.rej *.bak funs.h cmds.h buildinf.h patches.h) |
|---|
| 178 | (cd utils; rm -f *.orig *~ \#* *.rej *.bak mkcmds.sh *.o) |
|---|
| 179 | (cd game; rm -rf *.log netmush info_slave *.orig *.rej *~ *.bak mush.cnf) |
|---|
| 180 | (cd src; make distclean; rm -f Makefile) |
|---|
| 181 | (cd game/txt; make clean) |
|---|
| 182 | (rm -rf .config Makefile config.h config.sh options.h) |
|---|
| 183 | |
|---|
| 184 | totallyclean: distclean |
|---|
| 185 | (cd hdrs; rm -rf *.rej) |
|---|
| 186 | (cd src; rm -rf *.rej) |
|---|
| 187 | -rm -f Makefile |
|---|
| 188 | |
|---|
| 189 | diffs: |
|---|
| 190 | @make indent > /dev/null 2>&1 |
|---|
| 191 | @make versions > /dev/null 2>&1 |
|---|
| 192 | @make touchswitches > /dev/null 2>&1 |
|---|
| 193 | @make autogen > /dev/null 2>&1 |
|---|
| 194 | @(prcs diff -r$(VS) -N pennmush `cat MANIFEST` | grep -v 'Index:') |
|---|
| 195 | |
|---|
| 196 | commit: indent |
|---|
| 197 | @svn commit |
|---|
| 198 | |
|---|
| 199 | patch: versions |
|---|
| 200 | @make-patch-header |
|---|
| 201 | @make diffs |
|---|
| 202 | |
|---|
| 203 | etags: |
|---|
| 204 | (cd src; make etags) |
|---|
| 205 | |
|---|
| 206 | ctags: |
|---|
| 207 | (cd src; make ctags) |
|---|
| 208 | |
|---|
| 209 | touchswitches: |
|---|
| 210 | @@TOUCH@ src/SWITCHES |
|---|
| 211 | |
|---|
| 212 | dist.tar: |
|---|
| 213 | svn checkout svn+ssh://svn.pennmush.org/svn/pennmush/$(VERSION)/trunk |
|---|
| 214 | sed -e "s#^#pennmush-$(VERSION)p$(PATCHLEVEL)/#" < trunk/MANIFEST \ |
|---|
| 215 | > DISTFILES |
|---|
| 216 | mv -f trunk pennmush-$(VERSION)p$(PATCHLEVEL) |
|---|
| 217 | tar -cvf dist.tar --files-from=DISTFILES |
|---|
| 218 | -gpg -sb /tmp/dist.tar |
|---|
| 219 | bzip2 -k /tmp/dist.tar |
|---|
| 220 | openssl dgst -sha1 -out /tmp/dist.tar.bz2.sha1 /tmp/dist.tar.bz2 |
|---|
| 221 | gzip -k /tmp/dist.tar |
|---|
| 222 | openssl dgst -sha1 -out /tmp/dist.tar.gz.sha1 /tmp/dist.tar.gz |
|---|
| 223 | -rm -rf pennmush-$(VERSION)p$(PATCHLEVEL) DISTFILES |
|---|
| 224 | |
|---|
| 225 | globalinstall: install |
|---|
| 226 | (cd game/txt; make clean compose.sh) |
|---|
| 227 | # $(INSTALLDIR) $(GLOBAL_INSTALL) |
|---|
| 228 | $(CP) -R game/* $(GLOBAL_INSTALL) |
|---|
| 229 | rm -f $(GLOBAL_INSTALL)/netmush $(GLOBAL_INSTALL)/info_slave |
|---|
| 230 | $(INSTALL) config.sh $(GLOBAL_INSTALL)/config.sh |
|---|
| 231 | $(INSTALL) src/netmud $(GLOBAL_INSTALL)/netmush |
|---|
| 232 | $(INSTALL) src/info_slave utils/ln-dir.sh $(GLOBAL_INSTALL) |
|---|
| 233 | $(CHMOD) a+rX -R $(GLOBAL_INSTALL) |
|---|
| 234 | @echo "** Files installed in $(GLOBAL_INSTALL). Feel free to move them." |
|---|
| 235 | @echo "** You can run $(GLOBAL_INSTALL)/ln-dir.sh to create a user directory," |
|---|
| 236 | @echo "** or symlink that to somewhere easier to run. You may wish to strip them." |
|---|