-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
41 lines (31 loc) · 1.16 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
# compiler
FC = gfortran
# compiler flags (try dfferent ones, if the default line does not work)
#FCFLAGS = -g -O0 -fbounds-check -fwhole-file -ffpe-trap=invalid,zero,overflow,underflow -Wall -Wunused -Wuninitialized -Wsurprising -Wconversion
FCFLAGS = -O0
# List of executables to be built within the package
PROGRAMS = readbyte
# "make" builds all
all: $(PROGRAMS)
# ======================================================================
# And now the general rules, these should not require modification
# ======================================================================
# General rule for building prog from prog.o; $^ (GNU extension) is
# used in order to list additional object files on which the
# executable depends
%: %.o
$(FC) $(FCFLAGS) -o $@ $^
# General rules for building prog.o from prog.f90 or prog.F90; $< is
# used in order to list only the first prerequisite (the source file)
# and not the additional prerequisites such as module or include files
%.o: %.f90
$(FC) $(FCFLAGS) -c $<
%.o: %.f95
$(FC) $(FCFLAGS) -c $<
%.o: %.f03
$(FC) $(FCFLAGS) -c $<
# Utility targets
.PHONY: clean veryclean
clean:
rm -f *.o *.mod *.MOD
rm -f *~ $(PROGRAMS)