commit c3b2500028587c5253dd5270376ffd59bd9ae9fa
parent 71939fea04b77ed8084964467eb7ee9fddf1d79d
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Tue, 13 Jul 2021 22:54:10 -0700
Tweak build system
- Allow easy change of relative position by using a prefix variable
for mk(1) includes.
- In the root mkfile set sh(1) xtrace to show exactly what happens
rather than call pwd(1).
Diffstat:
5 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/apc/mkfile b/apc/mkfile
@@ -4,6 +4,7 @@ name = apc
src = apc.c
obj = ${src:%.c=%.o}
lib = ap aputil
+mk = ../mk
cppflags = ${lib:%=-I../lib/%}
ldflags = ${lib:%=-L../lib/%}
@@ -11,7 +12,7 @@ ldlibs = ${lib:%=-l%}
all:V: $name
-< ../mk/config.mk
-< ../mk/clean.mk
-< ../mk/obj.mk
-< ../mk/prog.mk
+< $mk/config.mk
+< $mk/clean.mk
+< $mk/obj.mk
+< $mk/prog.mk
diff --git a/aps/mkfile b/aps/mkfile
@@ -4,6 +4,7 @@ name = aps
src = aps.c buf.c command.c find.c item.c match.c player.c queue.c response.c split.c
obj = ${src:%.c=%.o}
lib = ap aputil
+mk = ../mk
cppflags = ${lib:%=-I../lib/%}
ldflags = ${lib:%=-L../lib/%}
@@ -11,7 +12,7 @@ ldlibs = ${lib:%=-l%}
all:V: $name
-< ../mk/config.mk
-< ../mk/clean.mk
-< ../mk/obj.mk
-< ../mk/prog.mk
+< $mk/config.mk
+< $mk/clean.mk
+< $mk/obj.mk
+< $mk/prog.mk
diff --git a/lib/ap/mkfile b/lib/ap/mkfile
@@ -3,10 +3,11 @@
name = libap.a
src = apcon.c sock.c
obj = ${src:%.c=%.o}
+mk = ../../mk
all:V: $name
-< ../../mk/config.mk
-< ../../mk/clean.mk
-< ../../mk/obj.mk
-< ../../mk/lib.mk
+< $mk/config.mk
+< $mk/clean.mk
+< $mk/obj.mk
+< $mk/lib.mk
diff --git a/lib/aputil/mkfile b/lib/aputil/mkfile
@@ -3,10 +3,11 @@
name = libaputil.a
src = die.c
obj = ${src:%.c=%.o}
+mk = ../../mk
all:V: $name
-< ../../mk/config.mk
-< ../../mk/clean.mk
-< ../../mk/obj.mk
-< ../../mk/lib.mk
+< $mk/config.mk
+< $mk/clean.mk
+< $mk/obj.mk
+< $mk/lib.mk
diff --git a/mkfile b/mkfile
@@ -6,7 +6,5 @@ targets = all install uninstall clean
all:V:
$targets:V:
- for dir in $subdirs
- do
- (cd $dir && pwd && mk $MKFLAGS $MKARGS)
- done
+ set -x
+ for dir in $subdirs; do (cd $dir && mk $MKFLAGS $MKARGS) done