Fancy general Makefile

This commit is contained in:
Thomas Applencourt 2017-03-17 16:06:29 -05:00
parent 8238090f27
commit 926c72a88b
2 changed files with 14 additions and 4 deletions

View File

@ -59,16 +59,20 @@ ARCH = $(addprefix $(CURDIR)/,IRPF90_temp/irpf90.a)
all: $(EXE)
define run
$(BUILD_SYSTEM) -C $(dir $(BUILD_FILE) ) -f $(notdir $(BUILD_FILE) ) $(1)
endef
$(EXE): $(ARCH)
@printf "%b" "\033[0;32m Build $@...\033[m\n"
@$(BUILD_SYSTEM) -C $(dir $< ) -f $(notdir $(BUILD_FILE)) $(addprefix $(CURDIR)/, $@) && touch $@
@$(call run, $(addprefix $(CURDIR)/, $@)) && touch $@
.NOTPARALLEL: $(BUILD_FILE) $(ARCH)
$(ARCH): $(BUILD_FILE)
@printf "%b" "\033[0;32m Creating the archive...\033[m\n"
@$(BUILD_SYSTEM) -C $(dir $< ) -f $(notdir $< ) $(ARCH)
@$(call run, $@) && touch $@
$(BUILD_FILE): $(shell find . -maxdepth 2 -path ./IRPF90_temp -prune -o -name '*.irp.f' -print)
@printf "%b" "\033[0;32m Running the IRPF90-compiler...\033[m\n"

View File

@ -59,16 +59,22 @@ ARCH = $(addprefix $(CURDIR)/,IRPF90_temp/irpf90.a)
all: $(EXE)
define run
$(BUILD_SYSTEM) -C $(dir $(BUILD_FILE) ) -f $(notdir $(BUILD_FILE) ) $(1)",
endef
#We allow for the user to ask for 'relative' path
#But the IRPF90 build system use absolute path.
$(EXE): $(ARCH)
@printf "%b" "\033[0;32m Build $@...\033[m\n"
@$(BUILD_SYSTEM) -C $(dir $< ) -f $(notdir $(BUILD_FILE)) $(addprefix $(CURDIR)/, $@) && touch $@
@$(call run, $(addprefix $(CURDIR)/, $@)) && touch $@
.NOTPARALLEL: $(BUILD_FILE) $(ARCH)
$(ARCH): $(BUILD_FILE)
@printf "%b" "\033[0;32m Creating the archive...\033[m\n"
@$(BUILD_SYSTEM) -C $(dir $< ) -f $(notdir $< ) $(ARCH)
@$(call run, $@) && touch $@
$(BUILD_FILE): $(shell find . -maxdepth 2 -path ./IRPF90_temp -prune -o -name '*.irp.f' -print)
@printf "%b" "\033[0;32m Running the IRPF90-compiler...\033[m\n"