-
Notifications
You must be signed in to change notification settings - Fork 105
/
makefile_clang
54 lines (41 loc) · 1.34 KB
/
makefile_clang
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
TARGET = Sibernetic
RM := rm -rf
SOURCES = src/owSignalSimulator.cpp \
src/owVtkExport.cpp \
src/main.cpp \
src/owHelper.cpp \
src/owOpenCLSolver.cpp \
src/owPhysicsFluidSimulator.cpp \
src/owWorldSimulation.cpp
TEST_SOURCES = src/test/owPhysicTest.cpp
SRCEXT := cpp
SRCDIR := src
INCDIR := inc
BUILDDIR = ./Release
BINARYDIR = $(BUILDDIR)/obj
BINARYTESTDIR = $(BINARYDIR)/test
OBJECTS := $(patsubst $(SRCDIR)/%,$(BINARYDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
OBJECTS += $(BINARYTESTDIR)/owPhysicTest.o
COMPILER :=clang++ # select clang as compiler
CPP_DEPS = $(OBJECTS:.o=.d)
LIBS := -lpython2.7 -lGL -lGLU -lOpenCL -lrt -lglut
all : $(TARGET)
$(TARGET):$(OBJECTS)
@echo 'Building target: $@'
@echo 'Invoking: Clang C++ Linker'
$(COMPILER) -L/opt/AMDAPP/lib/x86_64/ -O3 -o $(BUILDDIR)/$(TARGET) $(OBJECTS) $(LIBS) #-fsanitize=address -g
@echo 'Finished building target: $@'
@echo ' '
$(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(BINARYDIR)
@mkdir -p $(BINARYTESTDIR)
@echo 'Building file: $<'
@echo 'Invoking: Clang C++ Compiler'
$(COMPILER) -I/usr/include/python2.7 -I$(INCDIR) -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" #-fsanitize=address -g -O0
@echo 'Finished building: $<'
@echo ' '
clean :
-$(RM) $(OBJECTS)$(CPP_DEPS) $(BUILDDIR)/$(TARGET)
-@echo ' '
.PHONY: all clean dependents
.SECONDARY: