-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
70 lines (53 loc) · 1.75 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
TARGET=ConformalizedMCF
TARGET_SRC=ConformalizedMCF/
TARGET_SOURCE=$(TARGET_SRC)ConformalizedMCF.cpp
VIEWER=ConformalizedMCFOrbifoldVisualization
VIEWER_SRC=ConformalizedMCFOrbifoldVisualization/
VIEWER_SOURCE=$(VIEWER_SRC)glew.c $(VIEWER_SRC)ConformalizedMCFOrbifoldVisualization.cpp
CPPFLAGS += -fpermissive -fopenmp -Wno-deprecated -std=c++11
CFLAGS += -fopenmp -Wno-deprecated
#LFLAGS += -lgomp /usr/lib64/libcholmod.so.1.7.3
LFLAGS += -lgomp
CPPFLAGS_DEBUG = -DDEBUG -g3
CFLAGS_DEBUG = -DDEBUG -g3
LFLAGS_DEBUG =
CPPFLAGS_RELEASE = -O3 -DRELEASE -funroll-loops -ffast-math
CLAGS_RELEASE = -O3 -DRELEASE -funroll-loops -ffast-math
LFLAGS_RELEASE = -O3
BIN = Bin/Linux/
INCLUDE =-I. -I/usr/include/ -ILibrary/
CC=gcc
CXX=g++
MD=mkdir
TARGET_OBJECTS=$(addprefix $(BIN), $(addsuffix .o, $(basename $(notdir $(TARGET_SOURCE)))))
VIEWER_OBJECTS=$(addprefix $(BIN), $(addsuffix .o, $(basename $(notdir $(VIEWER_SOURCE)))))
all: CPPFLAGS += $(CPPFLAGS_RELEASE)
all: CFLAGS += $(CFLAGS_RELEASE)
all: LFLAGS += $(LFLAGS_RELEASE)
all: $(BIN)
all: $(BIN)$(TARGET)
all: $(BIN)$(VIEWER)
debug: CPPFLAGS += $(CPPFLAGS_DEBUG)
debug: CFLAGS += $(CFLAGS_DEBUG)
debug: LFLAGS += $(LFLAGS_DEBUG)
debug: $(BIN)
debug: $(BIN)$(TARGET)
debug: $(BIN)$(VIEWER)
clean:
rm -f $(BIN)$(TARGET)
rm -f $(BIN)$(VIEWER)
rm -f $(OBJECTS)
$(BIN):
$(MD) -p $(BIN)
$(BIN)$(TARGET): $(TARGET_OBJECTS)
$(CXX) -o $@ $(TARGET_OBJECTS) $(LFLAGS)
$(BIN)$(VIEWER): $(VIEWER_OBJECTS)
$(CXX) -o $@ $(VIEWER_OBJECTS) $(LFLAGS)
$(BIN)%.o: $(TARGET_SRC)%.c
$(CC) -c -o $@ $(CFLAGS) $(INCLUDE) $<
$(BIN)%.o: $(VIEWER_SRC)%.c
$(CC) -c -o $@ $(CFLAGS) $(INCLUDE) $<
$(BIN)%.o: $(TARGET_SRC)%.cpp
$(CXX) -c -o $@ $(CPPFLAGS) $(INCLUDE) $<
$(BIN)%.o: $(VIEWER_SRC)%.cpp
$(CXX) -c -o $@ $(CPPFLAGS) $(INCLUDE) $<