From 23a671147f6aba3f4e00a04e73f71d8121dc128c Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 3 May 2015 00:47:10 -0700 Subject: [PATCH] tiles-related build stuff * Add missing entry for include/tile.h to (top)/Files; also add new entry for generated file util/tiletxt.c (Unix only); * Add several missing entries for tile utility programs that can be built by sys/unix/Makefile.utl to util/.gitignore; * Update sys/unix/Makefile.utl to build 'tilemap' differently so that it won't leave behind an unwanted subdirectory tree under OSX: util/tilemap.dSYM/ util/tilemap.dSYM/Contents/ util/tilemap.dSYM/Contents/Info.plist util/tilemap.dSYM/Contents/Resources/ util/tilemap.dSYM/Contents/Resources/DWARF/ util/tilemap.dSYM/Contents/Resources/DWARF/tilemap It now generates util/tiletxt.c on the fly, to be compiled into tiletxt.o, so that tilemap.c can be compiled in the ordinary manner and tilemap.o can be kept around for dependency checking. (Creating real source file win/share/tiletxt.c would be a little bit cleaner, but it's effectively two lines long so seems silly to be in the source distribution.) I looked to see whether I could find a linker or compiler option to suppress that stuff but failed. I'm sure something of the sort must exist but didn't pursue it. Someday I might actually learn about how OSX works.... --- Files | 4 ++++ sys/unix/Makefile.utl | 27 ++++++++++++++++++++------- util/.gitignore | 20 +++++++++++++------- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/Files b/Files index 658cfc3ee..be68c61ef 100644 --- a/Files +++ b/Files @@ -322,6 +322,8 @@ include: date.h onames.h pm.h vis_tab.h (files generated by yacc (or copied from sys/share) at compile time) dgn_comp.h lev_comp.h +(file for tiles support copied from win/share at compile time) +tile.h (files for win32 that are moved into include at compile time) win32api.h @@ -342,6 +344,8 @@ nethack.ico util: (files generated by lex and yacc (or copied from sys/share) at compile time) dgn_lex.c dgn_yacc.c lev_lex.c lev_yacc.c +(file generated for unix at compile time if various tiles utilities are built) +tiletxt.c (files generated for win32 at compile time) uudecode.exe diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index e1c677c2f..f73c94400 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -1,5 +1,5 @@ # Makefile for NetHack's utility programs. -# NetHack 3.5 Makefile.utl $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ +# NetHack 3.5 Makefile.utl $NHDT-Date: 1430639195 2015/05/03 07:46:35 $ $NHDT-Branch: master $:$NHDT-Revision: 1.19 $ # NetHack 3.5 Makefile.utl $Date: 2012/01/10 17:47:30 $ $Revision: 1.18 $ # Root of source tree: @@ -325,8 +325,13 @@ xpm2img.ttp: xpm2img.o bitmfile.o tile2beos: tile2beos.o $(TEXT_IO) $(CC) $(LFLAGS) -o tile2beos tile2beos.o $(TEXT_IO) -lbe -tilemap: ../win/share/tilemap.c $(HACK_H) - $(CC) $(CFLAGS) $(LFLAGS) -o tilemap ../win/share/tilemap.c $(LIBS) +#--compiling and linking in one step leaves extra debugging files (in their +# own subdirectories!) on OSX; compile and link separately to suppress +# that without mucking about with extra OS-specific CFLAGS and/or LFLAGS +#tilemap: ../win/share/tilemap.c $(HACK_H) +# $(CC) $(CFLAGS) $(LFLAGS) -o tilemap ../win/share/tilemap.c $(LIBS) +tilemap: tilemap.o + $(CC) $(LFLAGS) -o tilemap tilemap.o $(LIBS) ../src/tile.c: tilemap ./tilemap @@ -334,9 +339,17 @@ tilemap: ../win/share/tilemap.c $(HACK_H) cp ../win/share/tile.h ../include/tile.h tiletext.o: ../win/share/tiletext.c $(CONFIG_H) ../include/tile.h $(CC) $(CFLAGS) -c ../win/share/tiletext.c -tiletxt.o: ../win/share/tilemap.c $(HACK_H) - $(CC) $(CFLAGS) -c -DTILETEXT ../win/share/tilemap.c - mv tilemap.o tiletxt.o +tiletxt.c: ./Makefile + echo '/* alternate compilation for tilemap.c to create tiletxt.o' > tiletxt.c + 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 +tilemap.o: ../win/share/tilemap.c $(HACK_H) + $(CC) $(CFLAGS) -c ../win/share/tilemap.c gifread.o: ../win/share/gifread.c $(CONFIG_H) ../include/tile.h $(CC) $(CFLAGS) -c ../win/share/gifread.c @@ -402,7 +415,7 @@ clean: spotless: clean -rm -f lev_lex.c lev_yacc.c dgn_lex.c dgn_yacc.c -rm -f ../include/lev_comp.h ../include/dgn_comp.h - -rm -f ../include/tile.h + -rm -f ../include/tile.h tiletxt.c -rm -f makedefs lev_comp dgn_comp recover dlb -rm -f gif2txt txt2ppm tile2x11 tile2img.ttp xpm2img.ttp tilemap diff --git a/util/.gitignore b/util/.gitignore index 22139b7ab..6982f2d05 100644 --- a/util/.gitignore +++ b/util/.gitignore @@ -1,13 +1,19 @@ -dgn_yacc.c dgn_lex.c -makedefs -tilemap -dgn_comp +dgn_yacc.c lev_lex.c lev_yacc.c -tile2x11 +tiletxt.c +makedefs +dgn_comp lev_comp -tileedit -tile2bmp dlb recover +tilemap +tileedit +tile2x11 +tile2bmp +tile2beos +gif2txt +txt2ppm +tile2img.ttp +xpm2ppm.ttp