forked from openworm/sibernetic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.OSX
64 lines (52 loc) · 1.85 KB
/
makefile.OSX
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
TARGET = Sibernetic
RM := rm -rf
# All of the sources participating in the build are defined here
SOURCES = src/owSignalSimulator.cpp \
src/owVtkExport.cpp \
src/main.cpp \
src/owHelper.cpp \
src/owOpenCLSolver.cpp \
src/owPhysicsFluidSimulator.cpp \
src/owWorldSimulation.cpp \
src/owNeuronSimulator.cpp \
src/owConfigProperty.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
CPP_DEPS = $(OBJECTS:.o=.d)
# Change these to set the different python directories
PYTHONHEADERDIR = /opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/
PYTHONLIBDIR = /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
PYTHONFRAMEWORKDIR = /Library/Frameworks/
LIBS := -framework Python -framework OpenGL -framework GLUT -framework OpenCL
# All Target
all: $(TARGET)
# Tool invocations
$(TARGET): $(OBJECTS)
@echo 'Building target: $@'
@echo 'Invoking: clang C++ Linker'
g++ -std=c++14 -L/usr/lib -F$(PYTHONFRAMEWORKDIR) -L$(PYTHONLIBDIR) -o $(BUILDDIR)/$(TARGET) $(OBJECTS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
$(BINARYDIR)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(BINARYDIR)
@mkdir -p $(BINARYTESTDIR)
@echo 'Building file: $<'
@echo 'Invoking: clang C++ Compiler'
#### use this to compile against homebrew installed python
#### change version number as necessary (2.7.n)
g++ -std=c++14 -O3 -Wall -c -I$(PYTHONHEADERDIR) -I$(INCDIR) -framework OpenCL -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '
# Other Targets
clean:
-$(RM) $(OBJECTS)$(CPP_DEPS) $(BUILDDIR)/$(TARGET)
-@echo ' '
.PHONY: all clean dependents
.SECONDARY: