]> bicyclesonthemoon.info Git - botm/config/commitdiff
Makefile and target configurations
authorb <rowerynaksiezycu@gmail.com>
Sat, 10 Sep 2022 17:27:40 +0000 (17:27 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sat, 10 Sep 2022 17:27:40 +0000 (17:27 +0000)
makefile [new file with mode: 0644]
makefile.1.mak [new file with mode: 0644]
settings-debug.txt [new file with mode: 0644]
settings-release.txt [new file with mode: 0644]
settings.txt [new file with mode: 0644]
settings_template.txt [deleted file]

diff --git a/makefile b/makefile
new file mode 100644 (file)
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 (file)
index 0000000..ddd7abc
--- /dev/null
@@ -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 (file)
index 0000000..3f4e49e
--- /dev/null
@@ -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 (file)
index 0000000..957db6e
--- /dev/null
@@ -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 (file)
index 0000000..88f922f
--- /dev/null
@@ -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 (file)
index e69de29..0000000