From 0005762c2d16510424e7423bef93967238e797a0 Mon Sep 17 00:00:00 2001 From: b Date: Sun, 9 Jul 2023 08:33:48 +0000 Subject: [PATCH] configuration tool is now a submodule --- .gitmodules | 3 +++ config | 1 + makefile | 18 ++++++++++-------- makefile.1.mak | 18 ++++++++++-------- 4 files changed, 24 insertions(+), 16 deletions(-) create mode 160000 config diff --git a/.gitmodules b/.gitmodules index 2c3fd5a..9998965 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "exec"] path = exec url = ../../botm/exec +[submodule "config"] + path = config + url = ../../botm/config diff --git a/config b/config new file mode 160000 index 0000000..1c21433 --- /dev/null +++ b/config @@ -0,0 +1 @@ +Subproject commit 1c21433837c5bc34100f04bbfeb8ce403844e91d diff --git a/makefile b/makefile index e1a2399..277394e 100644 --- a/makefile +++ b/makefile @@ -20,6 +20,7 @@ TARGET = debug # when want to change target run this first: # make -B TARGET=target_name makefile endif +PERL = perl CC =gcc CF =-g -Wall @@ -38,9 +39,7 @@ TMP_PATH = /botm/tmp/test-post CONFIGFILE = settings-$(TARGET).txt settings.txt # The configuration tool -# http://bicyclesonthemoon.info/git/botm-config -CONFIGURE = /botm/bin/config/configure.pl -CONFIGURE_CMD = $(PERL) $(CONFIGURE) $(CONFIGFILE) +CONFIGURE_CMD = $(PERL) ./configure.pl $(CONFIGFILE) # keep these 2 lists in the same order!: GENERATE_FROM=\ @@ -77,15 +76,18 @@ botm-common/botm_common.pm all: $(BIN) setuid exec -makefile: makefile.1.mak $(CONFIGFILE) +makefile: makefile.1.mak $(CONFIGFILE) configure.pl $(CONFIGURE_CMD) < makefile.1.mak > makefile + +configure.pl: $(CONFIGFILE) config/configure.1.pl + $(PERL) config/configure.1.pl target=direct settings-$(TARGET).txt config/settings.txt --in config/configure.1.pl --out configure.pl -$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) +$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) configure.pl $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE) -$(PERL_WRAP_EXEC): %: exec/exec.c exec/settings.txt - $(PERL) $(CONFIGURE) path=$(BIN_PATH) target=$*.pl exec/settings.txt --in exec/exec.c --out $*.c +$(PERL_WRAP_EXEC): %: exec/exec.c exec/settings.txt configure.pl + $(PERL) configure.pl path=$(BIN_PATH) target=$*.pl exec/settings.txt --in exec/exec.c --out $*.c $(CC) $(CF) -o $@ $*.c exec: $(EXEC) @@ -116,7 +118,7 @@ endif install: all cp_bin cp_lib clean: - $(RM) -f $(TO_GENERATE) $(PERL_WRAP_EXEC) $(PERL_WRAP_EXEC:=.c) + $(RM) -f configure.pl $(TO_GENERATE) $(PERL_WRAP_EXEC) $(PERL_WRAP_EXEC:=.c) PHONY: all clean install cp_bin cp_lib diff --git a/makefile.1.mak b/makefile.1.mak index d894999..f258dde 100644 --- a/makefile.1.mak +++ b/makefile.1.mak @@ -20,6 +20,7 @@ TARGET = debug ###MAKE_TARGET: # when want to change target run this first: # make -B TARGET=target_name makefile endif +PERL = perl ###MAKE_CC: CC=gcc ###MAKE_CF: CF=-g -Wall @@ -38,9 +39,7 @@ endif CONFIGFILE = settings-$(TARGET).txt settings.txt # The configuration tool -# http://bicyclesonthemoon.info/git/botm-config -CONFIGURE = /botm/bin/config/configure.pl ###MAKE_CONFIGURE: -CONFIGURE_CMD = $(PERL) $(CONFIGURE) $(CONFIGFILE) +CONFIGURE_CMD = $(PERL) ./configure.pl $(CONFIGFILE) # keep these 2 lists in the same order!: GENERATE_FROM=\ @@ -77,15 +76,18 @@ botm-common/botm_common.pm all: $(BIN) setuid exec -makefile: makefile.1.mak $(CONFIGFILE) +makefile: makefile.1.mak $(CONFIGFILE) configure.pl $(CONFIGURE_CMD) < makefile.1.mak > makefile + +configure.pl: $(CONFIGFILE) config/configure.1.pl + $(PERL) config/configure.1.pl target=direct settings-$(TARGET).txt config/settings.txt --in config/configure.1.pl --out configure.pl -$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) +$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) configure.pl $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE) -$(PERL_WRAP_EXEC): %: exec/exec.c exec/settings.txt - $(PERL) $(CONFIGURE) path=$(BIN_PATH) target=$*.pl exec/settings.txt --in exec/exec.c --out $*.c +$(PERL_WRAP_EXEC): %: exec/exec.c exec/settings.txt configure.pl + $(PERL) configure.pl path=$(BIN_PATH) target=$*.pl exec/settings.txt --in exec/exec.c --out $*.c $(CC) $(CF) -o $@ $*.c exec: $(EXEC) @@ -116,7 +118,7 @@ endif install: all cp_bin cp_lib clean: - $(RM) -f $(TO_GENERATE) $(PERL_WRAP_EXEC) $(PERL_WRAP_EXEC:=.c) + $(RM) -f configure.pl $(TO_GENERATE) $(PERL_WRAP_EXEC) $(PERL_WRAP_EXEC:=.c) PHONY: all clean install cp_bin cp_lib -- 2.30.2