aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorThomas Albers Raviola <thomas@thomaslabs.org>2024-04-21 21:51:54 +0200
committerThomas Albers Raviola <thomas@thomaslabs.org>2024-04-21 21:51:54 +0200
commit8e30cb8d4c1caffc2d877bec6975f1539fc193d3 (patch)
tree8905bee94de16b725fc0dd9f80e836eac87dc682 /Makefile
* Initial commit
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)