From 2b150858de42f48e4713d137a569bfb3186b0f8e Mon Sep 17 00:00:00 2001 From: sgeard Date: Sat, 10 Jun 2023 15:19:15 +0100 Subject: [PATCH] Fixed makefile so that project is buildable without fpm --- GNUmakefile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 GNUmakefile diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..6daea38 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,49 @@ +.PHONY: veryclean clean force export help + +ifdef debug +F_OPTS := -ggdb +endif + +F:= ifort + +SRC := rpn_stack.f90 rpn_stack_sm.f90 linked_list.f90 amap.f90 +OBJ := $(SRC:%.f90=%.o) + +hp: hp.f90 $(OBJ) + $(F) -o $@ hp.f90 $(OBJ) $(F_OPTS) + +hp.exe: hp.f90 GNUmakefile + $(F) -o $@ $< $(F_OPTS) + +rpn_stack_sm.o: rpn_stack_sm.f90 + $(F) -c -o $@ $< $(F_OPTS) + +rpn_stack.o: rpn_stack.f90 + $(F) -c -o $@ $< $(F_OPTS) + +linked_list.o: linked_list.f90 + $(F) -c -o $@ $< $(F_OPTS) + +amap.o: amap.f90 + $(F) -c -o $@ $< $(F_OPTS) + +test_amap: test_amap.f90 amap.o + $(F) -o $@ test_amap.f90 amap.o + +clean: + @rm -vf *.o *.mod *.smod *~ + +veryclean: clean + @rm -vf hp hp.exe hp.tar + +force: veryclean + $(MAKE) + +export: hp.tar + +hp.tar: GNUmakefile hp.f90 $(SRC) + tar cf $@ hp.f90 $(SRC) GNUmakefile + +help: + @echo "SRC = $(SRC)" + @echo "OBJ = $(OBJ)"