-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.in
64 lines (47 loc) · 1.52 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Template for `Tristan v2` Makefile
SHELL=/bin/sh
# Files for conditional compilation
USER_FILE = @USER_FILE@
# General compiler specifications
FC := @COMPILER_COMMAND@
FFLAGS := @COMPILER_FLAGS@
PFLAGS := @PREPROCESSOR_FLAGS@
WARNFLAGS := @WARNING_FLAGS@
INC_DIRS := -I $(HDF5_ROOT)/include
PFLAGS += @DEFS@
# FFLAGS += $(WARNFLAGS)
# Preliminary definitions
EXE_FILE := @EXE_NAME@
USR_DIR := @USER_DIR@
SRC_DIR := src/
BIN_DIR := bin/
BUILD_DIR := build/
EXECUTABLE := $(BIN_DIR)$(EXE_FILE)
SRC_FILES := $(shell find $(SRC_DIR) -name '*.F90') $(addprefix $(USR_DIR), $(USER_FILE).F90)
INC_FILES := $(shell find $(SRC_DIR) -name '*.F08') @ADD_INCLUDES@
OBJ_FILES := $(patsubst %.F90,%.o,$(SRC_FILES))
OBJ_FILES := $(addprefix $(BUILD_DIR),$(OBJ_FILES))
ifeq (${VERBOSE}, y)
HIDE :=
else
HIDE := @
endif
.PHONY: all depend clean
all : depend $(EXECUTABLE)
-include Makefile.depend
depend Makefile.depend:
${HIDE}-./extern/makedepf90 $(SRC_FILES) $(PFLAGS) -B $(BUILD_DIR) > Makefile.depend
$(EXECUTABLE): $(OBJ_FILES)
${HIDE}echo Linking $(EXECUTABLE)
${HIDE}mkdir -p $(@D)
${HIDE}$(FC) $(FFLAGS) $(PFLAGS) $(OBJ_FILES) -o $(EXECUTABLE)
${HIDE}echo [OK]: executable created at $(EXECUTABLE)
$(BUILD_DIR)%.o: %.F90
${HIDE}mkdir -p $(@D)
${HIDE}$(FC) $(FFLAGS) $(PFLAGS) -cpp $(addprefix -I, $(dir $(INC_FILES))) $(INC_DIRS) -J $(BUILD_DIR) -c $< -o $@
${HIDE}echo [OK]: compiled $<
clean :
${HIDE}echo "Cleaning ..."
${HIDE}rm -f $(EXECUTABLE) $(OBJ_FILES)
${HIDE}rm -rf $(BIN_DIR) $(BUILD_DIR)
${HIDE}rm -f Makefile.depend