parallel unix make bits

- Pat noticed that makedefs -z makes both vis_tab.[ch], but they could be
built by two makes via make -j, causing corruption
- make -j at top level failed for similar reasons, added several
dependencies to ensure a valid ordering
- these changes will cause extra things to be built if you "make"
individual targets at the top level, but have little effect it you're a
real power user and "make" the actual target in the right directory
This commit is contained in:
cohrs
2002-03-09 06:41:49 +00:00
parent d4d051af87
commit a35ca5e744
3 changed files with 18 additions and 16 deletions
+2 -2
View File
@@ -473,8 +473,8 @@ monstr.c: $(MAKEDEFS)
@( cd ../util ; $(MAKE) ../src/monstr.c ) @( cd ../util ; $(MAKE) ../src/monstr.c )
../include/vis_tab.h: $(MAKEDEFS) ../include/vis_tab.h: $(MAKEDEFS)
@( cd ../util ; $(MAKE) ../include/vis_tab.h ) @( cd ../util ; $(MAKE) ../include/vis_tab.h )
vis_tab.c: $(MAKEDEFS) # makedefs -z makes both vis_tab.h and vis_tab.c, but writes the .h first
@( cd ../util ; $(MAKE) ../src/vis_tab.c ) vis_tab.c: ../include/vis_tab.h
tile.c: ../win/share/tilemap.c $(HACK_H) tile.c: ../win/share/tilemap.c $(HACK_H)
@( cd ../util ; $(MAKE) ../src/tile.c ) @( cd ../util ; $(MAKE) ../src/tile.c )
+14 -12
View File
@@ -90,42 +90,45 @@ $(GAME):
all: $(GAME) Guidebook $(VARDAT) dungeon spec_levs check-dlb all: $(GAME) Guidebook $(VARDAT) dungeon spec_levs check-dlb
@echo "Done." @echo "Done."
# Note: many of the dependencies below are here to allow parallel make
# to generate valid output
Guidebook: Guidebook:
( cd doc ; $(MAKE) Guidebook ) ( cd doc ; $(MAKE) Guidebook )
manpages: manpages:
( cd doc ; $(MAKE) manpages ) ( cd doc ; $(MAKE) manpages )
data: data: $(GAME)
( cd dat ; $(MAKE) data ) ( cd dat ; $(MAKE) data )
rumors: rumors: $(GAME)
( cd dat ; $(MAKE) rumors ) ( cd dat ; $(MAKE) rumors )
oracles: oracles: $(GAME)
( cd dat ; $(MAKE) oracles ) ( cd dat ; $(MAKE) oracles )
# Note: options should have already been made with make, but... # Note: options should have already been made with make, but...
options: options: $(GAME)
( cd dat ; $(MAKE) options ) ( cd dat ; $(MAKE) options )
quest.dat: quest.dat: $(GAME)
( cd dat ; $(MAKE) quest.dat ) ( cd dat ; $(MAKE) quest.dat )
spec_levs: spec_levs: dungeon
( cd util ; $(MAKE) lev_comp ) ( cd util ; $(MAKE) lev_comp )
( cd dat ; $(MAKE) spec_levs ) ( cd dat ; $(MAKE) spec_levs )
( cd dat ; $(MAKE) quest_levs ) ( cd dat ; $(MAKE) quest_levs )
dungeon: dungeon: $(GAME)
( cd util ; $(MAKE) dgn_comp ) ( cd util ; $(MAKE) dgn_comp )
( cd dat ; $(MAKE) dungeon ) ( cd dat ; $(MAKE) dungeon )
x11tiles: x11tiles: $(GAME)
( cd util ; $(MAKE) tile2x11 ) ( cd util ; $(MAKE) tile2x11 )
( cd dat ; $(MAKE) x11tiles ) ( cd dat ; $(MAKE) x11tiles )
beostiles: beostiles: $(GAME)
( cd util ; $(MAKE) tile2beos ) ( cd util ; $(MAKE) tile2beos )
( cd dat ; $(MAKE) beostiles ) ( cd dat ; $(MAKE) beostiles )
@@ -141,7 +144,7 @@ mapbg.xpm:
nhsplash.xpm: nhsplash.xpm:
( cd dat ; $(MAKE) nhsplash.xpm ) ( cd dat ; $(MAKE) nhsplash.xpm )
nh16.img: nh16.img: $(GAME)
( cd util ; $(MAKE) tile2img.ttp ) ( cd util ; $(MAKE) tile2img.ttp )
( cd dat ; $(MAKE) nh16.img ) ( cd dat ; $(MAKE) nh16.img )
@@ -151,8 +154,7 @@ GEM_RSC.RSC:
title.img: title.img:
( cd dat ; $(MAKE) title.img ) ( cd dat ; $(MAKE) title.img )
check-dlb: check-dlb: options
( cd dat; $(MAKE) options )
@if egrep -s librarian dat/options ; then $(MAKE) dlb ; else true ; fi @if egrep -s librarian dat/options ; then $(MAKE) dlb ; else true ; fi
dlb: dlb:
+2 -2
View File
@@ -187,8 +187,8 @@ makedefs.o: makedefs.c $(CONFIG_H) ../include/permonst.h \
./makedefs -m ./makedefs -m
../include/vis_tab.h: makedefs ../include/vis_tab.h: makedefs
./makedefs -z ./makedefs -z
../src/vis_tab.c: makedefs # makedefs -z makes both vis_tab.h and vis_tab.c, but writes the .h first
./makedefs -z ../src/vis_tab.c: ../include/vis_tab.h
lintdefs: lintdefs:
@lint -axbh -I../include -DLINT $(MAKESRC) $(CMONOBJ) | sed '/_flsbuf/d' @lint -axbh -I../include -DLINT $(MAKESRC) $(CMONOBJ) | sed '/_flsbuf/d'