diff --git a/Makefile b/Makefile index a2e1d89..2e3866a 100644 --- a/Makefile +++ b/Makefile @@ -14,22 +14,30 @@ MOD-DIR = $(BUILD-DIR)/mod OBJ-DIR = $(BUILD-DIR)/obj TEST-DIR = $(BUILD-DIR)/test +ifeq ($(FC),nvfortran) +MOD-OUT-OPTION = -module $(MOD-DIR) +else +MOD-OUT-OPTION = -J$(MOD-DIR) +endif + +ifeq ($(FC),nvfortran) +MOD-IN-OPTION = -module $(MOD-DIR) +else +MOD-IN-OPTION = -I$(MOD-DIR) +endif + .PHONY: all test clean all: $(STATIC) $(STATIC): $(SRC) mkdir -p $(MOD-DIR) $(OBJ-DIR) - ifeq ($(FC),nvfortran) - $(FC) $(FFLAGS) -c $(SRC) -module $(MOD-DIR) -o $(OBJ-DIR)/$(FILENAME).o - else - $(FC) $(FFLAGS) -c $(SRC) -J$(MOD-DIR) -o $(OBJ-DIR)/$(FILENAME).o - endif + $(FC) $(FFLAGS) -c $(SRC) $(MOD-OUT-OPTION) -o $(OBJ-DIR)/$(FILENAME).o $(AR) $(ARFLAGS) $(STATIC) $(OBJ-DIR)/$(FILENAME).o test: $(TEST-SRC) $(STATIC) mkdir -p $(TEST-DIR) - $(FC) $(FFLAGS) $(TEST-SRC) -I$(MOD-DIR) -o $(TEST-DIR)/test.out $(STATIC) + $(FC) $(FFLAGS) $(TEST-SRC) $(MOD-IN-OPTION) -o $(TEST-DIR)/test.out $(STATIC) $(TEST-DIR)/test.out clean: