From 6092afc74d08ebd797476c5c434c43712c0bf62d Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Sun, 11 Feb 2024 21:57:56 +0000 Subject: [PATCH] Build: Country submodule now has production target When country was converted to a submodule (by me) the production installation target was hacked onto the kernel subdirectory Makefile which wasn't ideal. Introduce a production target into the country Makefile that does the installation. Since we want the submodule to be buildable standalone, we can't include the variable definitions from the upper level, such as $(DIRSEP) and $(CP), so the caller has to pass those in at build time if using the production target. Tested on Linux (GCC + Watcom) and DOS (Watcom) --- build.bat | 7 +++++++ kernel/makefile | 8 +------- makefile | 7 +++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/build.bat b/build.bat index c0a627a..f638dfc 100644 --- a/build.bat +++ b/build.bat @@ -118,6 +118,13 @@ cd ..\kernel %MAKE% production if errorlevel 1 goto abort-cd +echo. +echo Process COUNTRY +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +echo. +cd ..\country +%MAKE% DIRSEP=\ CP=copy production +if errorlevel 1 goto abort-cd + echo. echo Process SETVER +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ echo. diff --git a/kernel/makefile b/kernel/makefile index 3018b41..4f5fe9e 100644 --- a/kernel/makefile +++ b/kernel/makefile @@ -27,7 +27,7 @@ OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) $(OBJS7) $(OBJS8) # *Explicit Rules* -production: ../bin/$(TARGET).sys ../bin/country.sys +production: ../bin/$(TARGET).sys ../bin/$(TARGET).sys: kernel.sys $(CP) kernel.sys ..$(DIRSEP)bin @@ -42,12 +42,6 @@ kernel.sys: kernel.exe ../utils/exeflat.exe ../utils/upxentry.bin ../utils/upxde kernel.exe: $(TARGET).lnk $(OBJS) $(LIBS) $(LINK) @$(TARGET).lnk; -../bin/country.sys: - # warning, both cd and -C options required, cd for wmake, -C for gmake - cd ..$(DIRSEP)country - $(MAKE) -C ..$(DIRSEP)country all - $(CP) ..$(DIRSEP)country$(DIRSEP)country.sys ..$(DIRSEP)bin$(DIRSEP)country.sys - clobber: clean -$(RM) kernel.exe kernel.sys status.me diff --git a/makefile b/makefile index 0f1aeb0..fd3e58b 100644 --- a/makefile +++ b/makefile @@ -67,8 +67,12 @@ export ifeq ($(OS),Windows_NT) BUILDENV ?= windows +DIRSEP=\ +CP=copy else BUILDENV ?= linux +DIRSEP=/ +CP=cp endif ifeq ($(BUILDENV),windows) @@ -115,6 +119,7 @@ all: cd boot && $(MAKE) production cd sys && $(MAKE) production cd kernel && $(MAKE) production + cd country && $(MAKE) DIRSEP=$(DIRSEP) CP=$(CP) production cd setver && $(MAKE) production $(MAKEREMOVE) @@ -126,6 +131,7 @@ clean: cd boot && $(MAKE) clean cd sys && $(MAKE) clean cd kernel && $(MAKE) clean + cd country && $(MAKE) clean cd setver && $(MAKE) clean $(MAKEREMOVE) @@ -137,5 +143,6 @@ clobber: cd boot && $(MAKE) clobber cd sys && $(MAKE) clobber cd kernel && $(MAKE) clobber + cd country && $(MAKE) clobber cd setver && $(MAKE) clobber $(MAKEREMOVE)