Update Makefiles to better deal with git_hash.h for DOS compilation.
authorDavid Griffith <dave@661.org>
Wed, 2 Oct 2019 23:22:35 +0000 (16:22 -0700)
committerDavid Griffith <dave@661.org>
Wed, 2 Oct 2019 23:22:35 +0000 (16:22 -0700)
Makefile
Makefile.tc

index 38129ffd3f78dd02d1c5d64b1a676fec540710a7..e92cf4d04614c9832bf331912535616a7301a5ec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -266,7 +266,7 @@ $(SFROTZ_BIN): $(COMMON_LIB) $(SDL_LIB) $(BLORB_LIB) $(COMMON_LIB)
        @echo "** Done building Frotz with SDL interface."
 
 dos: $(DOS_BIN)
-$(DOS_BIN): $(COMMON_DEFINES) $(HASH)
+$(DOS_BIN): $(HASH)
        @echo
        @echo "  ** Cannot cross-compile for DOS yet"
        @echo "  ** For now, I'm just making $(COMMON_DEFINES) and $(HASH)"
index 785dea0762ba84b46c2863e208c70cf894460f52..a0cc3fc6c4ef3932c8ad6db4d24b9b1a60683a03 100644 (file)
@@ -19,6 +19,7 @@ VERSION = "2.45pre"
 VER = -DVERSION=$(VERSION)\r
 \r
 DEFS = src\common\defs.h\r
+HASH = src\common\git_hash.h\r
 \r
 DOS_DIR = src\dos\r
 DOS_OBJECTS =   $(DOS_DIR)\bcinit.o \\r
@@ -54,9 +55,27 @@ CORE_OBJECTS =  $(CORE_DIR)\buffer.o \
 \r
 .SUFFIXES: .c .o .h\r
 \r
-all:   defs frotz\r
+all:   hash defs frotz\r
 \r
-defs: $(DEFS)\r
+# I can't figure out how Turbo Make does conditional tests on files, so\r
+# for now this will have to do to alert the builder of the need to first\r
+# do "make hash" within a Unix build environment.\r
+#\r
+hash: $(HASH)\r
+$(HASH):\r
+       @echo ******************************************************************************\r
+       @echo ******************************************************************************\r
+       @echo **  To build for DOS, you must first do "make hash" in Unix.\r
+       @echo **  That's why you may see a complaint about being unable to open 'git_hash.h'.\r
+       @echo **  If you're building from zip archive rather than a git repository, then\r
+       @echo **  git_hash.h will already be prepared.\r
+       @echo **  Eventually there will be an option to cross-compile using Watcom C from a\r
+       @echo **  Unix build environment.\r
+       @echo ******************************************************************************\r
+       @echo ******************************************************************************\r
+       @echo.\r
+\r
+defs: $(HASH) $(DEFS)\r
 $(DEFS):\r
        @echo "** Generating $@"\r
        @echo "#ifndef COMMON_DEFINES_H" > $@\r