-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
50 lines (35 loc) · 861 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
44
45
46
47
48
49
50
PROG := setun70
CONSUL := consul254
$(PROG)_objs := setun70.o service.o disasm.o io_module.o ternary_arith.o
$(CONSUL)_objs := consul254.o
FC = gfortran
FFLAGS = -g -fopenmp
GENMODS = $(FC) $(FFLAGS) --syntax-only -c
COMPILE = $(FC) $(FFLAGS) -c
BUILD = $(FC) $(FFLAGS) -o
.SUFFIXES:
.PHONY: all
all: $(PROG) $(CONSUL)
.PHONY: run
run: all
chmod a+x ./run
./run
.PHONY: clean
clean:
rm -f *.mod *.o $(PROG) $(CONSUL)
.NOTINTERMEDIATE: ternary_arith.o io_module.o disasm.o
setun70.mod disasm.mod: ternary_arith.mod io_module.mod
.INTERMEDIATE: setun70.o
setun70.o: ternary_arith.mod io_module.mod
service.o: disasm.mod io_module.mod setun70.mod
%.mod: %.f90
$(GENMODS) $<
%.mod: %.F90 %.h
$(GENMODS) $<
%.o: %.f90
$(COMPILE) $<
%.o: %.F90 %.h
$(COMPILE) $<
.SECONDEXPANSION:
%: $$($$@_objs)
$(BUILD) $@ $@.o $(filter-out $@.o, $($@_objs))