Introduce pre and post targets.

Targets pre and post can be defined in the including (library) makefile.
They are added to provide extra flexibility. Target all will
build pre, $(executable) and post in deterministic order. Built-in
documentation is modified to reflect the new situation.
This commit is contained in:
katja 2015-12-08 13:04:13 +01:00
parent e08bab9eaa
commit c42845611f

View file

@ -225,7 +225,9 @@
#=== targets =================================================================== #=== targets ===================================================================
# #
# #
# all: build classes (default) or library blob (if make-lib-executable=true) # all: build $(executables) plus optional pre and post targets
# pre: target to build before $(executables)
# post: target to build after $(executables)
# alldebug: build all with -g option turned on for debug symbols # alldebug: build all with -g option turned on for debug symbols
# <classname>: force clean build of an individual class # <classname>: force clean build of an individual class
# <sourcefile>.pre: make preprocessor output file in current working directory # <sourcefile>.pre: make preprocessor output file in current working directory
@ -240,6 +242,11 @@
# depend: print generated prerequisites # depend: print generated prerequisites
# coffee: dummy target # coffee: dummy target
# #
# Variable $(executables) expands to class executables plus optional shared lib,
# or alternatively to single lib executable when make-lib-executable=true.
# Targets pre and post can be defined by library makefile. Make sure to include
# Makefile.pdlibbuilder first so default target all will not be redefined.
#
# #
#=== Pd-extended libdir concept ================================================ #=== Pd-extended libdir concept ================================================
# #
@ -684,7 +691,8 @@ MAKEFLAGS += --no-builtin-rules
.PRECIOUS: .PRECIOUS:
.SUFFIXES: .SUFFIXES:
.PHONY: all build-classes build-lib $(classes) $(makefiledirs) $(makefiles)\ .PHONY: all pre post build-classes build-lib \
$(classes) $(makefiledirs) $(makefiles) \
install install-executables install-datafiles install-datadirs \ install install-executables install-datafiles install-datadirs \
force clean vars allvars depend help force clean vars allvars depend help
@ -694,10 +702,19 @@ MAKEFLAGS += --no-builtin-rules
################################################################################ ################################################################################
# target all builds class executables plus optional shared lib # Target all forces the build of targets [pre $(executables) post] in
# or alternatively a single lib executable when make-lib-executable=true # deterministic order. Target $(executables) builds class executables plus
all: $(executables) # optional shared lib or alternatively a single lib executable when
$(info ++++ info: $(if $(executables),executables in $(lib.name) completed)) # make-lib-executable=true. Targets pre and post are optionally defined by
# library makefile.
all: post
post: $(executables)
$(executables): pre
pre:
all:
$(info ++++info: target all in lib $(lib.name) completed)
# build all with -g option turned on for debug symbols # build all with -g option turned on for debug symbols
alldebug: c.flags += -g alldebug: c.flags += -g