aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-03-04 23:42:12 +0100
committerDuncaen <mail@duncano.de>2017-03-04 23:49:55 +0100
commit7ca84b835a6c2399a9619415db625117914594e9 (patch)
tree7efbe1891e4fd65f8f84ac1c8ff9ee6ccc224318
parent3d02c2e2dd2a34873573d720e32893efad6147e2 (diff)
downloadlobase-7ca84b835a6c2399a9619415db625117914594e9.tar.gz
fix makefiles
-rw-r--r--Makefile25
-rw-r--r--bin/Makefile14
-rw-r--r--mk/bsd.prog.mk (renamed from bsd.prog.mk)0
-rw-r--r--mk/bsd.regress.mk (renamed from bsd.regress.mk)3
-rw-r--r--mk/bsd.subdir.mk12
-rw-r--r--regress/Makefile11
-rw-r--r--regress/bin/Makefile9
-rw-r--r--regress/sbin/Makefile9
-rw-r--r--regress/usr.bin/Makefile11
-rw-r--r--regress/usr.bin/tail/Makefile12
-rw-r--r--regress/usr.sbin/Makefile9
-rw-r--r--sbin/Makefile4
-rw-r--r--usr.bin/Makefile19
-rw-r--r--usr.sbin/Makefile5
14 files changed, 62 insertions, 81 deletions
diff --git a/Makefile b/Makefile
index 7f0fa5b..ec83764 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,22 @@
-SUBDIRS = libopenbsd bin sbin usr.bin usr.sbin
+MAKEFLAGS += -I$(shell pwd)/mk
-all:
-
-clean:
- PATH=$$PWD/dest/bin/:$$PATH $(MAKE) -I$(SRCDIR) -C regress clean
+SUBDIR = libopenbsd bin sbin usr.bin usr.sbin
-check:
- PATH=$$PWD/dest/bin/:$$PATH $(MAKE) -I$(SRCDIR) -C regress SRCDIR=$(SRCDIR) SHELL=/bin/oksh
+ifeq (clean,$(filter clean,$(MAKECMDGOALS)))
+SUBDIR += regress
+endif
+all:
+clean:
insteall:
-include mk/subdirs.mk
+regression-tests:
+ @echo "Running regression tests..." \
+ && export PATH=$$PWD/dest/bin/:$$PATH SHELL=/bin/oksh \
+ && cd regress \
+ && $(MAKE) depend \
+ && exec $(MAKE) regress
+
+.PHONY: all clean install regression-tests
-.PHONY: all clean check install
+include mk/bsd.subdir.mk
diff --git a/bin/Makefile b/bin/Makefile
index 97b349c..babf096 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -1,12 +1,4 @@
-SUBDIRS = cat chmod cp date dd df domainname echo ed expr hostname kill ln ls \
- md5 mkdir mv pax pwd rm rmdir sleep stty sync test
-
+SUBDIR = cat chmod cp date dd df domainname echo ed expr hostname kill ln ls \
+ md5 mkdir mv pax pwd rm rmdir sleep stty sync test
BROKEN = df
-
-all:
-
-include ../mk/subdirs.mk
-
-$(BROKEN):
- @echo "skipping $@"
- @true
+include bsd.subdir.mk
diff --git a/bsd.prog.mk b/mk/bsd.prog.mk
index 0c17488..0c17488 100644
--- a/bsd.prog.mk
+++ b/mk/bsd.prog.mk
diff --git a/bsd.regress.mk b/mk/bsd.regress.mk
index 91c8fb9..e39df32 100644
--- a/bsd.regress.mk
+++ b/mk/bsd.regress.mk
@@ -4,7 +4,8 @@ include ../../../config.mk
.OBJDIR = $(shell pwd)
.DEFAULT_GOAL :=
-all: regress
+all: depend regress
+depend:
regress:
ifneq (,$(REGESS_TARGETS))
diff --git a/mk/bsd.subdir.mk b/mk/bsd.subdir.mk
new file mode 100644
index 0000000..1683537
--- /dev/null
+++ b/mk/bsd.subdir.mk
@@ -0,0 +1,12 @@
+SUBDIR_TARGETS = all clean install depend regress
+SRCDIR = $(shell pwd)
+
+$(SUBDIR_TARGETS): $(SUBDIR)
+
+$(SUBDIR):
+ cd $@ && $(MAKE) $(filter-out $@,$(MAKECMDGOALS))
+
+$(BROKEN):
+ @echo "skipping $@"
+
+.PHONY: all clean install $(SUBDIR)
diff --git a/regress/Makefile b/regress/Makefile
index 40076da..f0e9d84 100644
--- a/regress/Makefile
+++ b/regress/Makefile
@@ -1,8 +1,5 @@
-SUBDIRS = bin sbin usr.bin usr.sbin
-
+SUBDIR = bin sbin usr.bin usr.sbin
BROKEN =
-
-include ../mk/subdirs.mk
-
-$(BROKEN):
- true
+depend:
+.PHONY: depend
+include bsd.subdir.mk
diff --git a/regress/bin/Makefile b/regress/bin/Makefile
index ee38c7b..624b166 100644
--- a/regress/bin/Makefile
+++ b/regress/bin/Makefile
@@ -1,8 +1,3 @@
-SUBDIRS = cat chmod ln md5 pax test
-
+SUBDIR = cat chmod ln md5 pax test
BROKEN =
-
-include ../../mk/subdirs.mk
-
-$(BROKEN):
- true
+include bsd.subdir.mk
diff --git a/regress/sbin/Makefile b/regress/sbin/Makefile
index a2bcd4c..39f21ba 100644
--- a/regress/sbin/Makefile
+++ b/regress/sbin/Makefile
@@ -1,8 +1,3 @@
-SUBDIRS =
-
+SUBDIR =
BROKEN =
-
-include ../../mk/subdirs.mk
-
-$(BROKEN):
- true
+include bsd.subdir.mk
diff --git a/regress/usr.bin/Makefile b/regress/usr.bin/Makefile
index fc880ac..5c0a007 100644
--- a/regress/usr.bin/Makefile
+++ b/regress/usr.bin/Makefile
@@ -1,9 +1,4 @@
-SUBDIRS = bc calendar colrm column cut dc diff diff3 dirname file \
- fmt fold grep jot tail tsort ul wc xargs
-
+SUBDIR = bc calendar colrm column cut dc diff diff3 dirname file \
+ fmt fold grep jot tail tsort ul wc xargs
BROKEN = grep bc calendar diff3
-
-include ../../mk/subdirs.mk
-
-$(BROKEN):
- true
+include bsd.subdir.mk
diff --git a/regress/usr.bin/tail/Makefile b/regress/usr.bin/tail/Makefile
index 852ebbd..4031e3a 100644
--- a/regress/usr.bin/tail/Makefile
+++ b/regress/usr.bin/tail/Makefile
@@ -6,14 +6,10 @@ REGRESS_TARGETS+= forward-blocks-rprint forward-chars-rprint forward-lines-rprin
REGRESS_TARGETS+= reverse-blocks-rprint reverse-chars-rprint reverse-lines-rprint
REGRESS_ROOT_TARGETS = follow-newsyslog
-.for t in ${REGRESS_ROOT_TARGETS}
-${t}:
- ${SUDO} sh ${.CURDIR}/${t}.sh
-.endfor
+$(REGRESS_ROOT_TARGETS):
+ $(SUDO) $(SHELL) $@.sh
-.for t in ${REGRESS_TARGETS}
-${t}:
- sh ${.CURDIR}/${t}.sh
-.endfor
+$(REGRESS_TARGETS):
+ $(SHELL) $@.sh
include bsd.regress.mk
diff --git a/regress/usr.sbin/Makefile b/regress/usr.sbin/Makefile
index a2bcd4c..39f21ba 100644
--- a/regress/usr.sbin/Makefile
+++ b/regress/usr.sbin/Makefile
@@ -1,8 +1,3 @@
-SUBDIRS =
-
+SUBDIR =
BROKEN =
-
-include ../../mk/subdirs.mk
-
-$(BROKEN):
- true
+include bsd.subdir.mk
diff --git a/sbin/Makefile b/sbin/Makefile
index 9b13e63..e11b749 100644
--- a/sbin/Makefile
+++ b/sbin/Makefile
@@ -1,3 +1,3 @@
-SUBDIRS = mknod
+SUBDIR = mknod
-include ../mk/subdirs.mk
+include bsd.subdir.mk
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index bd636de..af6203c 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -1,14 +1,9 @@
# dc before bc because it depends on dc.o
-SUBDIRS = apply awk basename dc bc biff cal calendar cmp colrm col column comm cut \
- dirname du diff3 diff env expand false fmt fold getopt grep head hexdump id \
- indent join jot lam lndir logger logname look mktemp nice nl nohup \
- paste patch printenv printf readlink renice rev rs sed shar sort \
- split stat tee time touch tr true tty uname unexpand uniq unvis \
- uudecode uuencode vis wc what which xinstall
-
+SUBDIR = apply awk basename dc bc biff cal calendar cmp colrm col column comm \
+ cut dirname du diff3 diff env expand false fmt fold getopt grep head \
+ hexdump id indent join jot lam lndir logger logname look mktemp nice \
+ nl nohup paste patch printenv printf readlink renice rev rs sed shar \
+ sort split stat tee time touch tr true tty uname unexpand uniq unvis \
+ uudecode uuencode vis wc what which xinstall
BROKEN = sed
-
-include ../mk/subdirs.mk
-
-$(BROKEN):
- true
+include bsd.subdir.mk
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index 370a149..25fba62 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -1,2 +1,3 @@
-SUBDIRS = mtree rdate
-include ../mk/subdirs.mk
+SUBDIR = mtree rdate
+
+include bsd.subdir.mk