some parallel Make glitches noticed
observed: parallel build attempts of makedefs that trampled over one another. attempted workaround: Add a dependency as per Pat R's suggestion. observed: Concurrent header file movement collisions were sometimes causing file busy errors and build failures. workaround: Eliminate tile.h header file movement from the Makefile build so that the collisions won't occur with that particular file. Leave the header file tile.h in win/share as it is in the distribution and just adjust the include path in the rule for the specific files that use it. observed: tiletxt.c created on-the-fly from Makefile echo statements sometimes resulted in garbled and duplicate content in it when parallel makes were involved, and that caused a build failure. workaround: Instead of creating a tiletxt.c on-the-fly via echo statements in the Makefile, simplify things and use that same #include "tilemap.c" approach but make it an actual file in the distribution. That makes it available for other platforms too.
This commit is contained in:
@@ -599,7 +599,7 @@ all: $(GAME)
|
|||||||
pregame:
|
pregame:
|
||||||
$(PREGAME)
|
$(PREGAME)
|
||||||
|
|
||||||
$(GAME): pregame $(SYSTEM)
|
$(GAME): pregame $(MAKEDEFS) $(SYSTEM)
|
||||||
@echo "$(GAME) is up to date."
|
@echo "$(GAME) is up to date."
|
||||||
|
|
||||||
Sysunix: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
|
Sysunix: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ all: $(ALLDEP)
|
|||||||
$(GAME): lua_support
|
$(GAME): lua_support
|
||||||
( cd src ; $(MAKE) $(GAME) )
|
( cd src ; $(MAKE) $(GAME) )
|
||||||
|
|
||||||
lua_support: $(TOPLUALIB) include/nhlua.h
|
lua_support: include/nhlua.h
|
||||||
@true
|
@true
|
||||||
$(LUATOP)/liblua.a: $(LUAHEADERS)/lua.h
|
$(LUATOP)/liblua.a: $(LUAHEADERS)/lua.h
|
||||||
( cd $(LUATOP) \
|
( cd $(LUATOP) \
|
||||||
@@ -129,6 +129,9 @@ $(LUATOP)/liblua.a: $(LUAHEADERS)/lua.h
|
|||||||
lib/lua/liblua.a: $(LUATOP)/liblua.a
|
lib/lua/liblua.a: $(LUATOP)/liblua.a
|
||||||
@( if test -d lib/lua ; then true ; else mkdir -p lib/lua ; fi )
|
@( if test -d lib/lua ; then true ; else mkdir -p lib/lua ; fi )
|
||||||
cp $(LUATOP)/liblua.a $@
|
cp $(LUATOP)/liblua.a $@
|
||||||
|
#include/nhlua.h: $(TOPLUALIB)
|
||||||
|
# ( cd src ; $(MAKE) LUAHEADERS="$(LUAHEADERS)" ../include/nhlua.h )
|
||||||
|
|
||||||
include/nhlua.h: $(TOPLUALIB)
|
include/nhlua.h: $(TOPLUALIB)
|
||||||
echo '/* nhlua.h - generated by top Makefile */' > $@
|
echo '/* nhlua.h - generated by top Makefile */' > $@
|
||||||
@echo '#include "../$(LUAHEADERS)/lua.h"' >> $@
|
@echo '#include "../$(LUAHEADERS)/lua.h"' >> $@
|
||||||
|
|||||||
+16
-26
@@ -264,7 +264,7 @@ lintdgn:
|
|||||||
recover: $(RECOVOBJS)
|
recover: $(RECOVOBJS)
|
||||||
$(CLINK) $(LFLAGS) -o recover $(RECOVOBJS) $(LIBS)
|
$(CLINK) $(LFLAGS) -o recover $(RECOVOBJS) $(LIBS)
|
||||||
|
|
||||||
recover.o: recover.c $(CONFIG_H) ../include/date.h
|
recover.o: recover.c $(CONFIG_H)
|
||||||
$(CC) $(CFLAGS) -c recover.c -o $@
|
$(CC) $(CFLAGS) -c recover.c -o $@
|
||||||
|
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ recover.o: recover.c $(CONFIG_H) ../include/date.h
|
|||||||
dlb: $(DLBOBJS)
|
dlb: $(DLBOBJS)
|
||||||
$(CLINK) $(LFLAGS) -o dlb $(DLBOBJS) $(LIBS)
|
$(CLINK) $(LFLAGS) -o dlb $(DLBOBJS) $(LIBS)
|
||||||
|
|
||||||
dlb_main.o: dlb_main.c $(CONFIG_H) ../include/dlb.h ../include/date.h
|
dlb_main.o: dlb_main.c $(CONFIG_H) ../include/dlb.h
|
||||||
$(CC) $(CFLAGS) -c dlb_main.c -o $@
|
$(CC) $(CFLAGS) -c dlb_main.c -o $@
|
||||||
|
|
||||||
|
|
||||||
@@ -317,44 +317,35 @@ tilemap: tilemap.o $(OBJDIR)/objects.o $(OBJDIR)/monst.o $(OBJDIR)/drawing.o
|
|||||||
../src/tile.c: tilemap
|
../src/tile.c: tilemap
|
||||||
./tilemap
|
./tilemap
|
||||||
|
|
||||||
../include/tile.h: ../win/share/tile.h
|
|
||||||
cp ../win/share/tile.h ../include/tile.h
|
|
||||||
tiletext.o: ../win/share/tiletext.c $(CONFIG_H) ../include/tile.h
|
tiletext.o: ../win/share/tiletext.c $(CONFIG_H) ../include/tile.h
|
||||||
$(CC) $(CFLAGS) -c ../win/share/tiletext.c -o $@
|
$(CC) $(CFLAGS) -c ../win/share/tiletext.c -o $@
|
||||||
tiletxt.c: ./Makefile
|
tiletxt.o: ../win/share/tiletxt.c $(HACK_H)
|
||||||
@echo '/* alternate compilation for tilemap.c to create tiletxt.o' > tiletxt.c
|
$(CC) $(CFLAGS) -I../win/share -c ../win/share/tiletxt.c -o $@
|
||||||
@echo ' that does not rely on "cc -c -o tiletxt.o tilemap.c"' >> tiletxt.c
|
|
||||||
@echo ' since many pre-POSIX compilers did not support that */' >> tiletxt.c
|
|
||||||
echo '#define TILETEXT' >> tiletxt.c
|
|
||||||
echo '#include "../win/share/tilemap.c"' >> tiletxt.c
|
|
||||||
@echo '/*tiletxt.c*/' >> tiletxt.c
|
|
||||||
tiletxt.o: tiletxt.c ../win/share/tilemap.c $(HACK_H)
|
|
||||||
$(CC) $(CFLAGS) -c tiletxt.c -o $@
|
|
||||||
tilemap.o: ../win/share/tilemap.c $(HACK_H)
|
tilemap.o: ../win/share/tilemap.c $(HACK_H)
|
||||||
$(CC) $(CFLAGS) -c ../win/share/tilemap.c -o $@
|
$(CC) $(CFLAGS) -c ../win/share/tilemap.c -o $@
|
||||||
|
|
||||||
gifread.o: ../win/share/gifread.c $(CONFIG_H) ../include/tile.h
|
gifread.o: ../win/share/gifread.c $(CONFIG_H) ../win/share/tile.h
|
||||||
$(CC) $(CFLAGS) -c ../win/share/gifread.c -o $@
|
$(CC) $(CFLAGS) -I../win/share -c ../win/share/gifread.c -o $@
|
||||||
ppmwrite.o: ../win/share/ppmwrite.c $(CONFIG_H) ../include/tile.h
|
ppmwrite.o: ../win/share/ppmwrite.c $(CONFIG_H) ../win/share/tile.h
|
||||||
$(CC) $(CFLAGS) -c ../win/share/ppmwrite.c -o $@
|
$(CC) $(CFLAGS) -I../win/share -c ../win/share/ppmwrite.c -o $@
|
||||||
|
|
||||||
tile2bmp.o: ../win/share/tile2bmp.c $(HACK_H) ../include/tile.h
|
tile2bmp.o: ../win/share/tile2bmp.c $(HACK_H) ../win/share/tile.h
|
||||||
$(CC) $(CFLAGS) -c ../win/share/tile2bmp.c -o $@
|
$(CC) $(CFLAGS) -I../win/share -c ../win/share/tile2bmp.c -o $@
|
||||||
|
|
||||||
tile2x11.o: ../win/X11/tile2x11.c $(HACK_H) ../include/tile.h \
|
tile2x11.o: ../win/X11/tile2x11.c $(HACK_H) ../win/share/tile.h \
|
||||||
../include/tile2x11.h
|
../include/tile2x11.h
|
||||||
$(CC) $(CFLAGS) -c ../win/X11/tile2x11.c -o $@
|
$(CC) $(CFLAGS) -I../win/share -c ../win/X11/tile2x11.c -o $@
|
||||||
|
|
||||||
tile2img.o: ../win/gem/tile2img.c $(HACK_H) ../include/tile.h \
|
tile2img.o: ../win/gem/tile2img.c $(HACK_H) ../win/share/tile.h \
|
||||||
../include/bitmfile.h
|
../include/bitmfile.h
|
||||||
$(CC) $(CFLAGS) -c ../win/gem/tile2img.c -o $@
|
$(CC) $(CFLAGS) -I../win/share -c ../win/gem/tile2img.c -o $@
|
||||||
xpm2img.o: ../win/gem/xpm2img.c $(HACK_H) ../include/bitmfile.h
|
xpm2img.o: ../win/gem/xpm2img.c $(HACK_H) ../include/bitmfile.h
|
||||||
$(CC) $(CFLAGS) -c ../win/gem/xpm2img.c -o $@
|
$(CC) $(CFLAGS) -c ../win/gem/xpm2img.c -o $@
|
||||||
bitmfile.o: ../win/gem/bitmfile.c ../include/bitmfile.h
|
bitmfile.o: ../win/gem/bitmfile.c ../include/bitmfile.h
|
||||||
$(CC) $(CFLAGS) -c ../win/gem/bitmfile.c -o $@
|
$(CC) $(CFLAGS) -c ../win/gem/bitmfile.c -o $@
|
||||||
|
|
||||||
tile2beos.o: ../win/BeOS/tile2beos.cpp $(HACK_H) ../include/tile.h
|
tile2beos.o: ../win/BeOS/tile2beos.cpp $(HACK_H) ../win/share/tile.h
|
||||||
$(CXX) $(CFLAGS) -c ../win/BeOS/tile2beos.cpp -o $@
|
$(CXX) $(CFLAGS) -I../win/share -c ../win/BeOS/tile2beos.cpp -o $@
|
||||||
|
|
||||||
# note: tileedit.cpp was developed for Qt2 and will not compile using Qt5
|
# note: tileedit.cpp was developed for Qt2 and will not compile using Qt5
|
||||||
tileedit.o: ../win/Qt/tileedit.cpp
|
tileedit.o: ../win/Qt/tileedit.cpp
|
||||||
@@ -415,7 +406,6 @@ clean:
|
|||||||
-rm -f *.o
|
-rm -f *.o
|
||||||
|
|
||||||
spotless: clean
|
spotless: clean
|
||||||
-rm -f ../include/tile.h tiletxt.c
|
|
||||||
-rm -f makedefs recover dlb
|
-rm -f makedefs recover dlb
|
||||||
-rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp \
|
-rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp \
|
||||||
tilemap tileedit tile2bmp
|
tilemap tileedit tile2bmp
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
tiletxt.c
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/* alternate compilation for tilemap.c to create tiletxt.o
|
||||||
|
that does not rely on "cc -c -o tiletxt.o tilemap.c"
|
||||||
|
since many pre-POSIX compilers did not support that */
|
||||||
|
#define TILETEXT
|
||||||
|
#include "tilemap.c"
|
||||||
|
/*tiletxt.c*/
|
||||||
Reference in New Issue
Block a user