-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile_v2
executable file
·46 lines (33 loc) · 1.12 KB
/
Makefile_v2
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
MAINSRCDIR = ./src/main
FUNCSRCDIR = ./src/func
INCDIR = ./header
CFLAGS =
CPPFLAGS = -std=c++11 -Wall -Wextra -I $(INCDIR)
LDFLAGS = -lgsl -lgslcblas
LIBS = -I$(TACC_GSL_INC) -L$(TACC_GSL_LIB)
CXX = g++
vpath %.h $(INCDIR)
vpath %.cpp $(MAINSRCDIR) $(FUNCSRCDIR)
MAIN := $(shell find $(MAINSRCDIR) -name ODEdriver.cpp)
TEST1 := $(shell find $(MAINSRCDIR) -name test1_solver_explicit_euler.cpp)
TEST2 := $(shell find $(MAINSRCDIR) -name test2_solver_runga_katta.cpp)
FUNCSOURCES := $(shell find $(FUNCSRCDIR) -name *.cpp)
HEADERS := $(shell find $(INCDIR) -name *.h)
OUTPUT := ODEdriver
all: $(OUTPUT)
$(OUTPUT): $(MAIN) $(FUNCSOURCES) $(HEADERS)
$(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
test1_solver: $(TEST1) $(FUNCSOURCES) $(HEADERS)
$(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
test2_solver: $(TEST2) $(FUNCSOURCES) $(HEADERS)
$(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
debug: LDFLAGS += -DDEBUG -g
debug: $(OUTPUT)
check: test
test: test1_solver test2_solver
./test1_solver
./test2_solver
clean:
rm -f $(OUTPUT) test1_solver test2_solver
.PHONY: all
.PHONY: clean