-
Notifications
You must be signed in to change notification settings - Fork 5
/
GVarden.mak
101 lines (71 loc) · 2.92 KB
/
GVarden.mak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# A set of useful macros for putting together a VARDEN application.
# check the version number -- this comes from the GNU Make cookbook
NEED := 3.81
OK := $(filter $(NEED),$(firstword $(sort $(MAKE_VERSION) $(NEED))))
ifndef OK
$(error your version of GNU make is too old. You need atleast version $(NEED))
endif
ifeq ($(findstring ~, $(FBOXLIB_HOME)), ~)
$(error you cannot include the ~ character in your FBOXLIB_HOME variable)
endif
# include the main Makefile stuff
include $(FBOXLIB_HOME)/Tools/F_mk/GMakedefs.mak
# default target (make just takes the one that appears first)
ALL: main.$(suf).exe
ifdef TILING
VPATH_LOCATIONS += $(VARDEN_TOP_DIR)/src_tiled
endif
PROBIN_TEMPLATE := $(VARDEN_TOP_DIR)/src/probin.template
# list of the directories to search for _parameters files
PROBIN_PARAMETER_DIRS = ./
PROBIN_PARAMETER_DIRS += $(VARDEN_TOP_DIR)/src
# list of all valid _parameters files for probin
PROBIN_PARAMETERS := $(shell $(FBOXLIB_HOME)/Tools/F_scripts/findparams.py $(PROBIN_PARAMETER_DIRS))
probin.f90: $(PROBIN_PARAMETERS) $(PROBIN_TEMPLATE)
@echo " "
@echo "${bold}WRITING probin.f90${normal}"
$(FBOXLIB_HOME)/Tools/F_scripts/write_probin.py \
-t $(PROBIN_TEMPLATE) -o probin.f90 -n probin \
--pa "$(PROBIN_PARAMETERS)"
@echo " "
include $(VARDEN_TOP_DIR)/src/GPackage.mak
VPATH_LOCATIONS += $(VARDEN_TOP_DIR)/src
include $(FBOXLIB_HOME)/Src/BaseLib/GPackage.mak
VPATH_LOCATIONS += $(FBOXLIB_HOME)/Src/BaseLib
include $(FBOXLIB_HOME)/Src/MultiGrid/GPackage.mak
VPATH_LOCATIONS += $(FBOXLIB_HOME)/Src/MultiGrid
main.$(suf).exe: $(objects)
$(LINK.f90) -o main.$(suf).exe $(objects) $(libraries)
@echo SUCCESS
#-----------------------------------------------------------------------------
# build_info stuff
deppairs: build_info.f90
build_info.f90:
@echo " "
@echo "${bold}WRITING build_info.f90${normal}"
$(FBOXLIB_HOME)/Tools/F_scripts/makebuildinfo.py \
--FCOMP "$(COMP)" \
--FCOMP_version "$(FCOMP_VERSION)" \
--f90_compile_line "$(COMPILE.f90)" \
--f_compile_line "$(COMPILE.f)" \
--C_compile_line "$(COMPILE.c)" \
--link_line "$(LINK.f90)" \
--fboxlib_home "$(FBOXLIB_HOME)" \
--source_home "$(VARDEN_TOP_DIR)"
@echo " "
$(odir)/build_info.o: build_info.f90
$(COMPILE.f90) $(OUTPUT_OPTION) build_info.f90
rm -f build_info.f90
include $(FBOXLIB_HOME)/Tools/F_mk/GMakerules.mak
#-----------------------------------------------------------------------------
# for debugging. To see the value of a Makefile variable,
# e.g. Fmlocs, simply do "make print-Fmlocs". This will
# print out the value.
print-%: ; @echo $* is $($*)
#-----------------------------------------------------------------------------
# cleaning. Add more actions to 'clean' and 'realclean' to remove
# probin.f90 and build_info.f90 -- this is where the '::' in make comes
# in handy
clean::
$(RM) probin.f90
$(RM) build_info.f90