-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile.foxy
68 lines (57 loc) · 1.35 KB
/
makefile.foxy
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
#!/usr/bin/make
#defaults
LIB = foxy
#main building variables
DOBJ = static/obj/
DMOD = static/mod/
DEXE = static/
MAKELIB = ar -rcs $(DEXE)lib$(LIB).a $(DOBJ)*.o ; ranlib $(DEXE)lib$(LIB).a
DSRC = src
FC = gfortran
OPTSC = -cpp -c -frealloc-lhs -O3 -J static/mod
OPTSL = -J static/mod
VPATH = $(DSRC) $(DOBJ) $(DMOD)
MKDIRS = $(DOBJ) $(DMOD) $(DEXE)
#auxiliary variables
COTEXT = "Compiling $(<F)"
LITEXT = "Assembling $@"
#building rule
$(LIB): $(MKDIRS) $(DOBJ)$(LIB).o
@echo $(LITEXT)
@$(MAKELIB)
#compiling rules
$(DOBJ)foxy_xml_file.o: src/FoXy/foxy_xml_file.f90 \
$(DOBJ)foxy_xml_tag.o \
$(DEXE)libpenf.a
@echo $(COTEXT)
@$(FC) $(OPTSC) $< -o $@
$(DOBJ)foxy_xml_tag.o: src/FoXy/foxy_xml_tag.f90 \
$(DEXE)libpenf.a \
$(DEXE)libstringifor.a
@echo $(COTEXT)
@$(FC) $(OPTSC) $< -o $@
$(DOBJ)foxy.o: src/FoXy/foxy.f90 \
$(DOBJ)foxy_xml_file.o \
$(DOBJ)foxy_xml_tag.o \
$(DEXE)libpenf.a
@echo $(COTEXT)
@$(FC) $(OPTSC) $< -o $@
.NOTPARALLEL: $(DEXE)libpenf.a $(DEXE)libstringifor.a
$(DEXE)libpenf.a:
@$(MAKE) -f makefile.penf
$(DEXE)libstringifor.a:
@$(MAKE) -f makefile.stringifor
#phony auxiliary rules
.PHONY : $(MKDIRS)
$(MKDIRS):
@mkdir -p $@
.PHONY : cleanobj
cleanobj:
@echo deleting objects
@rm -fr $(DOBJ)
.PHONY : cleanmod
cleanmod:
@echo deleting mods
@rm -fr $(DMOD)
.PHONY : clean
clean: cleanobj cleanmod