Opened 11 years ago

Closed 11 years ago

#2 closed change (fixed (in master))

Ease makefiles proliferation

Reported by: takkaria Owned by: takkaria
Milestone: 3.0.8 Keywords:
Cc:

Description (last modified by takkaria)

There is 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:

  1. Add template files (in src/tmpl/) where there are strings indicating where:
    • object files should be included
    • source files should be included
    • dependency information should be included
  2. Write scripts to do the search/replace (preferably using sed and sh).

Change History (5)

comment:1 Changed 11 years ago by takkaria

  • Description modified (diff)

comment:2 Changed 11 years ago by takkaria

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 

comment:3 Changed 11 years ago by takkaria

  • Owner set to takkaria
  • Status changed from new to assigned

comment:4 Changed 11 years ago by takkaria

  • Summary changed from Makefiles should be created from templates to Ease makefiles proliferation

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:5 Changed 11 years ago by takkaria

  • Resolution set to fixed
  • Status changed from assigned to closed

Closed with [14a3670] (SVN r3).

Note: See TracTickets for help on using tickets.