-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (32 loc) · 848 Bytes
/
Copy pathMakefile
File metadata and controls
44 lines (32 loc) · 848 Bytes
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
CXX = g++
CXXFLAGS = -Wall -std=c++11
EXEC = solvePlateau
MOD = SurfMesh3D Matrix iterative_solvers Plateau
SRC := $(MOD:=.cpp) $(EXEC:=.cpp)
HDR := $(MOD:=.hpp) R23.hpp
OBJ := $(MOD:=.o) $(EXEC:=.o)
all: init $(EXEC)
@echo "\nThe executable file is \"solvePlateau\"\n"
init:
-@mkdir obj
-@mkdir output
@echo "\nTwo directories have been created (obj/ and output/).\n"
@echo "\nPut results in /output.\n"
$(EXEC): $(OBJ)
$(CXX) $(CXXFLAGS) -o $@ $(addprefix obj/, $(OBJ))
print:
@echo "\nSources and headers:\n"
@echo $(SRC)
@echo $(HDR)
@echo "Contents of the directories:\n"
@ls src/
@ls hdr/
$(MOD:=.o) :%.o : src/%.cpp hdr/%.hpp
$(CXX) $(CXXFLAGS) -o obj/$@ -c $(filter %.cpp, $<)
$(EXEC:=.o) :%.o : src/%.cpp
$(CXX) $(CXXFLAGS) -o obj/$@ -c $<
clean:
-@rm $(EXEC)
-@rm obj/*.o
-@rm *~
.PHONY: all clean init print