# PHYML 20130708 Makefile for ARB # by Arne Boeckmann (2013) SUFFIX = _20130708 PROG = PHYML$(SUFFIX) BUILDDIR = build INSTALLED_BINARY = $(ARBHOME)/bin/phyml$(SUFFIX) CONFIG_STATUS = $(BUILDDIR)/config.status # automatically remove now obsolete file (@@@ remove this code after some time) OBSOLETE_STAMP = phyml.stamp CC=$(A_CC) $(onlyC_flags) CXX=$(A_CXX) ifndef DONT_RETRY_TWICE DONT_RETRY_TWICE:=0 # default to 0 endif # define to trace config (e.g. on a build server) SHOW_CONFIG_ON_DISK= # SHOW_CONFIG_ON_DISK=show_config_on_disk # ARBs standard target: $(MAIN) : $(INSTALLED_BINARY) rm -f $(OBSOLETE_STAMP) ifeq ($(DONT_RETRY_TWICE),1) test -f $(INSTALLED_BINARY) else test -f $(INSTALLED_BINARY) || $(MAKE) retry endif retry: clean_build @echo "---------------------------------------- PHYML 'make install' failed to install -> triggering rebuild" $(MAKE) "DONT_RETRY_TWICE=1" $(MAIN) @echo "---------------------------------------- PHYML rebuild succeeded" $(INSTALLED_BINARY): $(CONFIG_STATUS) ( export MAKEFLAGS= ; $(MAKE) -C $(BUILDDIR) install ) show_config_on_disk: find \( -name "*config*" -o -name "*aclocal*" \) -ls phyml/configure : phyml/configure.fallback ${SHOW_CONFIG_ON_DISK} @echo "Using $<:" cp -p $< $@ # Assuming configure.ac and aclocal.m4 are the prerequisites of config.h.in. # Check if config.h.in.fallback is outdated. # This happens e.g. after calling autoreconf w/o changes to config.h.in. # If this fails, increment date at phyml/config.h.in.fallback@arb-build phyml/config.h.in.fallback: phyml/configure.ac phyml/aclocal.m4 @echo "ERROR: $@.in is out-of-date; should be newer than any of: $?" >&2 @exit 1 phyml/config.h.in : phyml/config.h.in.fallback ${SHOW_CONFIG_ON_DISK} @echo "Using $<:" cp -p $< $@ $(CONFIG_STATUS): Makefile phyml/configure phyml/config.h.in $(MAKE) "MAKEFLAGS=" clean_build mkdir -p $(BUILDDIR) cd $(BUILDDIR) && ../phyml/configure CPP='' --prefix=$(ARBHOME) --program-suffix=$(SUFFIX) clean_build: rm -rf $(BUILDDIR) rm -f $(INSTALLED_BINARY) clean : clean_build rm -f phyml/config.h.in rm -f phyml/configure .PHONY : clean clean_build show_config_on_disk