build: separate subdirs out from targets
That list is needed in multiple places, so it simplifies things a bit.cute-signatures
parent
0867d629b9
commit
cd70e10ad9
15
Make.rules
15
Make.rules
|
@ -1,7 +1,9 @@
|
||||||
##
|
##
|
||||||
# A set of makefile rules loosely based on kbuild.
|
# A set of makefile rules loosely based on kbuild.
|
||||||
|
|
||||||
all: compile
|
default: compile
|
||||||
|
|
||||||
|
all: compile docs
|
||||||
|
|
||||||
ifndef build
|
ifndef build
|
||||||
|
|
||||||
|
@ -86,6 +88,9 @@ endif
|
||||||
|
|
||||||
##
|
##
|
||||||
# Reset all variables.
|
# Reset all variables.
|
||||||
|
ifneq ($(origin subdirs),file)
|
||||||
|
subdirs :=
|
||||||
|
endif
|
||||||
ifneq ($(origin targets),file)
|
ifneq ($(origin targets),file)
|
||||||
targets :=
|
targets :=
|
||||||
endif
|
endif
|
||||||
|
@ -303,17 +308,17 @@ endif
|
||||||
%/: FORCE
|
%/: FORCE
|
||||||
$(Q)$(MAKE) -f Make.rules build=$(build-dir) $(MAKECMDGOALS)
|
$(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:
|
generate:
|
||||||
|
|
||||||
clean: $(filter %/,$(targets))
|
clean: $(subdirs)
|
||||||
ifeq ($(toplevelrun),yes)
|
ifeq ($(toplevelrun),yes)
|
||||||
$(Q)find . $(RCS_FIND_IGNORE) \
|
$(Q)find . $(RCS_FIND_IGNORE) \
|
||||||
\( -name '*.[oas]' -o -name '.*.cmd' -o -name '.*.d' \) \
|
\( -name '*.[oas]' -o -name '.*.cmd' -o -name '.*.d' \) \
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -19,9 +19,9 @@ DOCDIR := /usr/share/doc/apk
|
||||||
export DESTDIR SBINDIR LIBDIR CONFDIR MANDIR DOCDIR
|
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
|
# Include all rules and stuff
|
||||||
|
|
Loading…
Reference in New Issue