-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
88 lines (66 loc) · 1.64 KB
/
Makefile
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
#SHELL = tcsh
# add .f and .o to the list of acceptable suffixes
.SUFFIXES: .f90 .f .o .tar .gz $(SUFFIXES)
VERSION = 1.00
#
# V0.01: Beginning of the project...
#
#variables can be defined for use with later rules
# (eg turn on debugging)
TAR = tar cvf
GZIP = gzip --best
CAT = cat
#
BUILDER = gfortran
FFLAGS = -Wall -O3
OPT =
LFLAGS =
#
F90 = $(BUILDER)
LD = $(BUILDER)
AR = ar
CP = cp
# RANLIB is useless on some systems (HPUX), replace it by ls or file.
RANLIB = ranlib
# Sources and utilities
SRC = ws.f90 ws_param.f90 ws_mod.f90 ws_density.f90 ws_fields.f90 \
boundary.f90
FILES = $(SRC) Makefile forces.param
# define your objects
OBJS = ws_param.o ws_mod.o ws_density.o ws_fields.o boundary.o
OBJMAIN = ws.o
MODS = ws_param.mod ws_auxiliary.mod densita.mod fields.mod rspace.mod
MAIN = ws
ARC = tot$(VERSION).tar
DIRS = out
TOT = ws_tot.f90
LIB = liblr.a
all: $(MAIN) $(DIRS)
lib: $(LIB)
tot: $(TOT)
# this rule defines how your executable is to be made
# and is the default target
$(MAIN): $(OBJS) $(OBJMAIN)
$(LD) -o $(MAIN) $(OBJS) $(OBJMAIN) $(LFLAGS)
%.o: %.f90
$(F90) $(FFLAGS) -o $@ -c $< $(OPT)
$(TOT): $(SRC) Makefile
rm -f $(TOT)
$(CAT) $(SRC) > $(TOT)
$(LIB): $(OBJS)
$(AR) vr $(LIB) $(OBJS)
$(RANLIB) $(LIB)
out:
# Dependences
ws_param.o: ws_param.f90
boundary.o: boundary.f90 ws_param.o
ws_mod.o: ws_param.o ws_mod.f90
ws_density.o: ws_density.f90 ws_param.o
ws_fields.o: ws_fields.f90 ws_density.o ws_param.o
ws.o: ws.f90 ws_param.o ws_mod.o ws_density.o ws_fields.o \
boundary.o
# house keeping
clean:
rm -f *.a *.o *.mod *.d $(MAIN) $(MAIN2)
clean_all:
rm -f *.a *.o *.mod $(MAIN) $(MAIN2) *~