Fancy general Makefile

This commit is contained in:
Thomas Applencourt 2017-03-17 15:50:07 -05:00
parent eb176ec0a2
commit 8238090f27
3 changed files with 28 additions and 13 deletions

View File

@ -1,5 +1,5 @@
IRPF90= ../bin/irpf90
IRPF90FLAGS=
IRPF90FLAGS= -I input/
# Make | Ninja
BUILD_SYSTEM= make
@ -53,17 +53,23 @@ endif
# Actual Rule
EXE := $(shell egrep -ri '^\s*program' *.irp.f | cut -d'.' -f1)
ARCH = $(addprefix $(CURDIR)/,IRPF90_temp/irpf90.a)
.PHONY: clean all
all: $(EXE)
$(EXE): $(BUILD_FILE)
$(EXE): $(ARCH)
@printf "%b" "\033[0;32m Build $@...\033[m\n"
@$(BUILD_SYSTEM) -C $(dir $< ) -f $(notdir $< ) $(addprefix $(CURDIR)/, $@) && touch $@
@$(BUILD_SYSTEM) -C $(dir $< ) -f $(notdir $(BUILD_FILE)) $(addprefix $(CURDIR)/, $@) && touch $@
.NOTPARALLEL: $(BUILD_FILE)
.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)
$(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"
@$(IRPF90) $(IRPF90FLAGS)

View File

@ -1,28 +1,31 @@
BEGIN_PROVIDER [integer, t ]
IMPLICIT NONE
t = u1+v+4
END_PROVIDER
BEGIN_PROVIDER [integer,w]
IMPLICIT NONE
w = d5+3
END_PROVIDER
BEGIN_PROVIDER [ integer, v ]
implicit none
IMPLICIT NONE
v = u2+w+2
END_PROVIDER
BEGIN_PROVIDER [ integer, u1 ]
IMPLICIT NONE
integer :: fu
u1 = fu(d1,d2)
END_PROVIDER
BEGIN_PROVIDER [ integer, u2 ]
IMPLICIT NONE
integer :: fu
u2 = fu(d3,d4)
!df
END_PROVIDER
integer function fu(x,y)
integer :: x,y
fu = x+y+1
end function
INTEGER function fu(x,y)
INTEGER, INTENT(in) :: x,y
fu = int(x+y+1+3)
END FUNCTION

View File

@ -53,17 +53,23 @@ endif
# Actual Rule
EXE := $(shell egrep -ri '^\s*program' *.irp.f | cut -d'.' -f1)
ARCH = $(addprefix $(CURDIR)/,IRPF90_temp/irpf90.a)
.PHONY: clean all
all: $(EXE)
$(EXE): $(BUILD_FILE)
$(EXE): $(ARCH)
@printf "%b" "\033[0;32m Build $@...\033[m\n"
@$(BUILD_SYSTEM) -C $(dir $< ) -f $(notdir $< ) $(addprefix $(CURDIR)/, $@) && touch $@
@$(BUILD_SYSTEM) -C $(dir $< ) -f $(notdir $(BUILD_FILE)) $(addprefix $(CURDIR)/, $@) && touch $@
.NOTPARALLEL: $(BUILD_FILE)
.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)
$(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"
@$(IRPF90) $(IRPF90FLAGS)