-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
70 lines (54 loc) · 1.84 KB
/
Makefile
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
64
65
66
67
68
69
70
GET_SPECTRUM_TARGET=GetSpectrum
GET_DESCRIPTOR_TARGET=GetDescriptor
GET_SPECTRUM_SOURCE=GetSpectrum/GetSpectrum.cpp
GET_DESCRIPTOR_SOURCE=GetDescriptor/GetDescriptor.cpp
COMPILER ?= gcc
#COMPILER ?= clang
ifeq ($(COMPILER),gcc)
CFLAGS += -fopenmp -Wno-deprecated -std=c++14 -pthread -Wno-invalid-offsetof
LFLAGS += -lgomp -lstdc++ -lpthread
CC=gcc
CXX=g++
else
CFLAGS += -Wno-deprecated -std=c++14 -pthread -Wno-invalid-offsetof -Wno-dangling-else
LFLAGS += -lstdc++
CC=clang
CXX=clang++
endif
CFLAGS += -O3 -DRELEASE -funroll-loops -ffast-math -g
LFLAGS += -O3 -g
BIN = Bin/Linux/
BIN_O = Obj/Linux/
INCLUDE = ./Include/ -I .
MD=mkdir
GET_SPECTRUM_OBJECTS=$(addprefix $(BIN_O), $(addsuffix .o, $(basename $(GET_SPECTRUM_SOURCE))))
GET_DESCRIPTOR_OBJECTS=$(addprefix $(BIN_O), $(addsuffix .o, $(basename $(GET_DESCRIPTOR_SOURCE))))
GET_SPECTRUM_OBJECT_DIR=$(dir $(GET_SPECTRUM_OBJECTS))
GET_DESCRIPTOR_OBJECT_DIR=$(dir $(GET_DESCRIPTOR_OBJECTS))
all: make_dirs
all: $(BIN)$(GET_SPECTRUM_TARGET)
all: $(BIN)$(GET_DESCRIPTOR_TARGET)
getspectrum: make_dirs
getspectrum: $(BIN)$(GET_SPECTRUM_TARGET)
getdescriptor: make_dirs
getdescriptor: $(BIN)$(GET_DESCRIPTOR_TARGET)
clean:
rm -rf $(BIN)$(GET_SPECTRUM_TARGET)
rm -rf $(BIN)$(GET_DESCRIPTOR_TARGET)
rm -rf $(BIN_O)
cd OpenMesh && make clean
cd PNG && make clean
make_dirs: FORCE
$(MD) -p $(BIN)
$(MD) -p $(BIN_O)
$(MD) -p $(GET_SPECTRUM_OBJECT_DIR)
$(MD) -p $(GET_DESCRIPTOR_OBJECT_DIR)
$(BIN)$(GET_SPECTRUM_TARGET): $(GET_SPECTRUM_OBJECTS)
$(CXX) -o $@ $(GET_SPECTRUM_OBJECTS) -L$(BIN) $(LFLAGS)
$(BIN)$(GET_DESCRIPTOR_TARGET): $(GET_DESCRIPTOR_OBJECTS)
cd OpenMesh && make COMPILER=$(COMPILER)
cd PNG && make COMPILER=$(COMPILER)
$(CXX) -o $@ $(GET_DESCRIPTOR_OBJECTS) -L$(BIN) $(LFLAGS) -lOpenMesh_Core -lecho_PNG -ljpeg -lz
$(BIN_O)%.o: $(SRC)%.cpp
$(CXX) -c -o $@ $(CFLAGS) -I$(INCLUDE) $<
FORCE: