Closed angband-import closed 4 years ago
Modified by takkaria on 19 Mar 2007 00:34 UTC
Comment by takkaria on 21 Mar 2007 22:25 UTC Take a look at UnAngband: src/commondefs.inc and Makefiles.osx, Makefile.cyg, Makefile.std, and Makefile.lcc.
Some of the OS-level defines can go in the makefiles, using output of uname to get the OS type for those myriad *NIX systems:
uname = $(shell uname)
ifeq ($(uname),linux)
OSFLAGS = -DLINUX
endif
or in makefile.osx:
OSFLAGS=-DMACH_O_CARBON
Modified by takkaria on 22 Mar 2007 20:31 UTC
Comment by takkaria on 24 Mar 2007 00:48 UTC Add "Makefile.inc", which contains a set of object file definitions and dependencies which can be shared amongst as many makefiles as possible. (It serves the same purpose as commondefs.inc in UnAngband, but with this name grouped with makefiles when sorting alphabetically.)
I've rewritten Makefile.std to be much more friendly, and made std, osx, con, cyg, dos, ibm, lcc use Makefile.inc for definitions. I've also removed gtk and lsl.
Remaining unchanged are: Makefile.ami, Makefile.emx, Makefile.bcc, Makefile.wat, and Makefile.win. I plan to remove ami and emx at some point fairly soon (last ports 2003/2001). I doubt win works (it references a file "itsybits.obj" which isn't distributed), leaving bcc and wat. These two should be fairly easy to update manually for now, so no need for complex scripts.
Comment by takkaria on 24 Mar 2007 01:02 UTC Closed with [14a3670] (SVN r3).
Reported by takkaria on 19 Mar 2007 00:34 UTC Problem: we have makefile proliferation, which is hard to manage -- removing or adding a file requires too much effort. We need a makefile template system, and scripts to turn templates into real makefiles.
To fix: