aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bfeae34
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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)