-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
43 lines (32 loc) · 1008 Bytes
/
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
FC = gfortran
ENABLE_VISUALIZATION=true
#FFLAGS = -g -fcheck=all
FFLAGS =-O3 -Wall -march=native -ffast-math -cpp
EXECUTABLE = cgle.exe
TARGETS = latticeconst.o simparam.o cgle.o main.o
MODULES = simparam.mod d2q9const.mod cgle.mod
ifdef ENABLE_VISUALIZATION
TARGETS += cglevis.o #bulid the visualization stuff
MODULES += cglevis.mod
FFLAGS += -D VISUALIZATION=1 #add define macro for conditional compilation
FFLAGS += $(shell pkg-config --cflags plplotd-f95)
LIBS = $(shell pkg-config --libs plplotd-f95)
endif
COMPILE=$(FC) $(FFLAGS) -c
.PHONY:all
all:$(EXECUTABLE) Makefile
$(EXECUTABLE):$(TARGETS)
$(FC) $(LIBS) -o $@ $^
main.o: main.f95 $(MODULES)
$(COMPILE) $<
cgle.o cgle.mod: cgle.f95 d2q9const.mod simparam.mod
$(COMPILE) $<
cglevis.o cglevis.mod: cglevis.f95 simparam.mod
$(COMPILE) $<
latticeconst.o d2q9const.mod d2q7const.mod: latticeconst.f95 simparam.mod
$(COMPILE) $<
simparam.o simparam.mod: simparam.f95
$(COMPILE) $<
.PHONY:clean
clean:
rm -r *.mod *.dat *.exe *.o