From 3a0d586a8aafef8cd878a37cfc00a2e3ff9e8ce3 Mon Sep 17 00:00:00 2001 From: b Date: Sat, 10 Sep 2022 17:27:40 +0000 Subject: [PATCH] Makefile and target configurations --- makefile | 47 +++++++++++++++++++++++++++++++++++++++++++ makefile.1.mak | 47 +++++++++++++++++++++++++++++++++++++++++++ settings-debug.txt | 8 ++++++++ settings-release.txt | 9 +++++++++ settings.txt | 9 +++++++++ settings_template.txt | 0 6 files changed, 120 insertions(+) create mode 100644 makefile create mode 100644 makefile.1.mak create mode 100644 settings-debug.txt create mode 100644 settings-release.txt create mode 100644 settings.txt delete mode 100644 settings_template.txt diff --git a/makefile b/makefile new file mode 100644 index 0000000..ebf16be --- /dev/null +++ b/makefile @@ -0,0 +1,47 @@ +ifndef TARGET +TARGET = debug +# available targets: +# debug +# release +# when want to change target run this first: +# make -B TARGET=release makefile +endif + +CONFIGFILE = settings-$(TARGET).txt settings.txt + +PERL = /usr/bin/perl +CHMOD = /usr/bin/chmod +CP = /usr/bin/cp +RM = /usr/bin/rm +MKDIR = /usr/bin/mkdir + +BIN_DIR = /botm/bin/test-configure + + +CONFIGURE = $(PERL) ./configure.pl $(CONFIGFILE) + +all: exec + +makefile: makefile.1.mak configure.pl $(CONFIGFILE) + $(CONFIGURE) < makefile.1.mak > makefile + +exec: configure.pl + $(CHMOD) +x configure.pl + +bin_dir: + $(MKDIR) -p $(BIN_DIR) + +cp_bin: configure.pl exec | bin_dir + $(CP) configure.pl $(BIN_DIR) + +rm_bin: + $(RM) -rf $(BIN_DIR) + +install: cp_bin + +uninstall: rm_bin + +clean: + +PHONY: all exec bin_dir cp_bin rm_bin install uninstall clean + diff --git a/makefile.1.mak b/makefile.1.mak new file mode 100644 index 0000000..ddd7abc --- /dev/null +++ b/makefile.1.mak @@ -0,0 +1,47 @@ +ifndef TARGET +TARGET = debug ###make_target: +# available targets: +# debug +# release +# when want to change target run this first: +# make -B TARGET=release makefile +endif + +CONFIGFILE = settings-$(TARGET).txt settings.txt + +###make_perl: PERL = perl +###make_chmod: CHMOD = chmod +###make_cp: CP = cp +###make_rm: RM = rm +###make_mkdir: MKDIR = mkdir + +###make_bin_dir: BIN_DIR = /botm/bin/configure + + +CONFIGURE = $(PERL) ./configure.pl $(CONFIGFILE) + +all: exec + +makefile: makefile.1.mak configure.pl $(CONFIGFILE) + $(CONFIGURE) < makefile.1.mak > makefile + +exec: configure.pl + $(CHMOD) +x configure.pl + +bin_dir: + $(MKDIR) -p $(BIN_DIR) + +cp_bin: configure.pl exec | bin_dir + $(CP) configure.pl $(BIN_DIR) + +rm_bin: + $(RM) -rf $(BIN_DIR) + +install: cp_bin + +uninstall: rm_bin + +clean: + +PHONY: all exec bin_dir cp_bin rm_bin install uninstall clean + diff --git a/settings-debug.txt b/settings-debug.txt new file mode 100644 index 0000000..3f4e49e --- /dev/null +++ b/settings-debug.txt @@ -0,0 +1,8 @@ +target: debug +bin_dir: /botm/bin/test-configure + +perl: /usr/bin/perl +chmod: /usr/bin/chmod +cp: /usr/bin/cp +rm: /usr/bin/rm +mkdir: /usr/bin/mkdir diff --git a/settings-release.txt b/settings-release.txt new file mode 100644 index 0000000..957db6e --- /dev/null +++ b/settings-release.txt @@ -0,0 +1,9 @@ +target: release +bin_dir: /botm/bin/configure + +perl: /usr/bin/perl +chmod: /usr/bin/chmod +cp: /usr/bin/cp +rm: /usr/bin/rm +mkdir: /usr/bin/mkdir + diff --git a/settings.txt b/settings.txt new file mode 100644 index 0000000..88f922f --- /dev/null +++ b/settings.txt @@ -0,0 +1,9 @@ +make_target = TARGET = $target + +make_perl = PERL = $perl +make_chmod = CHMOD = $chmod +make_cp = CP = $cp +make_rm = RM = $rm +make_mkdir = MKDIR = $mkdir + +make_bin_dir = BIN_DIR = $bin_dir \ No newline at end of file diff --git a/settings_template.txt b/settings_template.txt deleted file mode 100644 index e69de29..0000000 -- 2.30.2