Fixed makefile so that project is buildable without fpm

This commit is contained in:
sgeard 2023-06-10 15:19:15 +01:00 committed by GitHub
parent ac30acd45a
commit 2b150858de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

49
GNUmakefile Normal file
View file

@ -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)"