From ddc50431e646d4a04388f206e990f49c509ccb34 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 18 Jan 2018 13:54:03 +0100 Subject: [PATCH] ports: allow more customizations in gnu_build.mk This patch adds hooks for customizing the location of the configure script within the package, the build target, as well as the install step. This is useful for packages like tcl that deviate from the usual layout of source packages. Issue #2648 --- repos/ports/mk/gnu_build.mk | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/repos/ports/mk/gnu_build.mk b/repos/ports/mk/gnu_build.mk index 2774e599e..6d5fedd05 100644 --- a/repos/ports/mk/gnu_build.mk +++ b/repos/ports/mk/gnu_build.mk @@ -127,6 +127,12 @@ LDLIBS_A = $(filter %.a, $(sort $(STATIC_LIBS)) $(EXT_OBJECTS) $(LIBGCC)) LDLIBS_SO = $(addprefix $(PWD)/,$(sort $(SHARED_LIBS))) LDLIBS += $(LDLIBS_A) $(LDLIBS_SO) $(LDLIBS_A) +# +# By default, assume that there exists a 'configure' script in the top-level +# of the package. +# +CONFIGURE_SCRIPT ?= $(PKG_DIR)/configure + # # Re-configure the Makefile if the Genode build environment changes # @@ -137,7 +143,7 @@ Makefile reconfigure: $(MAKEFILE_LIST) # Makefile reconfigure: env.sh $(SHARED_LIBS) @$(MSG_CONFIG)$(TARGET) - $(VERBOSE)source env.sh && $(PKG_DIR)/configure $(ENV) $(CONFIGURE_ARGS) $(CONFIGURE_OUTPUT_FILTER) + $(VERBOSE)source env.sh && $(CONFIGURE_SCRIPT) $(ENV) $(CONFIGURE_ARGS) $(CONFIGURE_OUTPUT_FILTER) env.sh: $(VERBOSE)rm -f $@ @@ -167,19 +173,27 @@ env.sh: # built.tag: env.sh Makefile @$(MSG_BUILD)$(TARGET) - $(VERBOSE)source env.sh && $(MAKE) $(MAKE_ENV) $(MAKE_VERBOSE) MAN= $(BUILD_OUTPUT_FILTER) + $(VERBOSE)source env.sh &&\ + $(MAKE) $(MAKE_ENV) $(MAKE_VERBOSE) $(MAKE_TARGET) MAN= \ + $(BUILD_OUTPUT_FILTER) @touch $@ INSTALL_TARGET ?= install-strip # # Install result of the build in an 'install/' directory local to the target's -# build directory +# build directory. The default install step 'make install-strip' can be +# customized by setting 'INSTALL_TARGET' to be empty. This is useful to +# explicitly filter the installed content in the 'target.mk' file. # installed.tag: built.tag + +ifneq ($(INSTALL_TARGET),) +installed.tag: @$(MSG_INST)$(TARGET) $(VERBOSE)source env.sh && $(MAKE) $(MAKE_ENV) $(MAKE_VERBOSE) $(INSTALL_TARGET) DESTDIR=$(PWD)/install MAN= >> stdout.log 2>> stderr.log @touch $@ +endif $(TARGET): installed.tag @touch $@