forked from openworm/sibernetic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.OSX
62 lines (50 loc) · 1.73 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
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
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 = /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Headers/
#PYTHONLIBDIR = /usr/local/lib/python2.7
#PYTHONFRAMEWORKDIR = /usr/local/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++ -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++ -O1 -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: