aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-01-26 11:51:56 +0200
committerTimo Teräs <timo.teras@iki.fi>2020-01-26 11:52:56 +0200
commitcd70e10ad9eb3f7361c150495299d98096077b62 (patch)
tree911f2dcc1091c75c9bcb0a2ef18b16100d4cf18c
parent0867d629b96d3f5e312d9670f51581e7225e3aad (diff)
downloadapk-tools-cd70e10ad9eb3f7361c150495299d98096077b62.tar.bz2
apk-tools-cd70e10ad9eb3f7361c150495299d98096077b62.tar.xz
build: separate subdirs out from targets
That list is needed in multiple places, so it simplifies things a bit.
-rw-r--r--Make.rules15
-rw-r--r--Makefile4
2 files changed, 12 insertions, 7 deletions
diff --git a/Make.rules b/Make.rules
index 1962457..09b7831 100644
--- a/Make.rules
+++ b/Make.rules
@@ -1,7 +1,9 @@
##
# A set of makefile rules loosely based on kbuild.
-all: compile
+default: compile
+
+all: compile docs
ifndef build
@@ -86,6 +88,9 @@ endif
##
# Reset all variables.
+ifneq ($(origin subdirs),file)
+subdirs :=
+endif
ifneq ($(origin targets),file)
targets :=
endif
@@ -303,17 +308,17 @@ endif
%/: FORCE
$(Q)$(MAKE) -f Make.rules build=$(build-dir) $(MAKECMDGOALS)
-compile: generate $(targets)
+compile: generate $(targets) $(subdirs)
@:
-docs: $(docs) $(targets)
+docs: $(docs) $(subdirs)
@:
-install: docs $(targets) FORCE
+install: compile docs $(subdirs) FORCE
generate:
-clean: $(filter %/,$(targets))
+clean: $(subdirs)
ifeq ($(toplevelrun),yes)
$(Q)find . $(RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '.*.cmd' -o -name '.*.d' \) \
diff --git a/Makefile b/Makefile
index fdb6945..e7cc0aa 100644
--- a/Makefile
+++ b/Makefile
@@ -19,9 +19,9 @@ DOCDIR := /usr/share/doc/apk
export DESTDIR SBINDIR LIBDIR CONFDIR MANDIR DOCDIR
##
-# Top-level rules and targets
+# Top-level subdirs
-targets := libfetch/ src/ doc/
+subdirs := libfetch/ src/ doc/
##
# Include all rules and stuff