X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Externals%2Fcommon.mk;h=3264a19dcc1c9782256082784b14b9914bbc2ea8;hb=c00f6ece0ff9a1ad2d07691122070d52d4397d78;hp=7a86c40e473ac05b7e12d35c94a86259cd80666b;hpb=fe53470758da8b50623c8cc07d3dc897edb8ce37;p=tpg%2Facess2.git diff --git a/Externals/common.mk b/Externals/common.mk index 7a86c40e..3264a19d 100644 --- a/Externals/common.mk +++ b/Externals/common.mk @@ -33,6 +33,7 @@ HOST=$(BFD)-acess_proxy-elf # [?]ARCHIVE : Optional forced archive (Defaults to latest) # [?]CONFIGURE_LINE : Command to create makefile (defaults to autotools configure) # [?]NOBDIR : Set to non-empty to disable use of a separate build dir +# [?]AUTORECONF : Set to non-empty to regenerate ./configure BTARGETS ?= all @@ -80,15 +81,28 @@ $(DIR): $(ARCHIVE) $(DIR)/%: patches/%.patch @echo [PATCH] $@ + @tar -xf $(ARCHIVE) $@ @patch $@ $< $(DIR)/%: patches/% @echo [CP] $@ + @mkdir -p $(dir $@) @cp $< $@ -_patch: $(DIR) $(addprefix $(DIR)/,$(PATCHES)) +PATCHED_FILES := $(addprefix $(DIR)/,$(PATCHES)) +_patch: $(DIR) $(PATCHED_FILES) -$(BDIR)/Makefile: _patch ../common.mk Makefile +CONFIGSCRIPT := $(BDIR)/$(firstword $(CONFIGURE_LINE)) +PATCHED_ACFILES := $(filter %/configure.in %/config.sub, $(PATCHED_FILES)) +$(warning $(CONFIGSCRIPT): $(PATCHED_ACFILES)) + +$(CONFIGSCRIPT): $(PATCHED_ACFILES) +ifeq ($(AUTORECONF),) +else + cd $(DIR) && autoreconf --force --install +endif + +$(BDIR)/Makefile: _patch $(CONFIGSCRIPT) ../common.mk Makefile mkdir -p $(BDIR) cd $(BDIR) && $(CONFIGURE_LINE)