aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: bfeae34e1e1596e2cc079d8c8b4035bac27898f2 (plain)
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
NAME = nbody
TARGET = $(NAME)

FC = gfortran

SRC = common.f90\
	  simulation.f90\
	  integral.f90\
	  main.f90

OBJ = $(SRC:%.f90=build/%.o)
MOD = $(SRC:%.f90=build/%.mod)

FFLAGS = -std=f2018
LDFLAGS =

MOD_DIR = build

all : $(TARGET)

$(TARGET) : $(OBJ)
	$(FC) $(LDFLAGS) -J$(MOD_DIR) $(OBJ) -o $@

build/%.o : src/%.f90
	$(FC) $(FFLAGS) -J$(MOD_DIR) -c $< -o $@

.PHONY : clean
clean :
	rm -rf build/* $(TARGET)