forked from shizuo-kaji/CageDeformerMaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (48 loc) · 1.86 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
# Makefile for OS-X
MAYA_LOCATION = /Applications/Autodesk/maya
PROJ1 = cageDeformer
PROJ2 = cageDeformerARAP
SOURCE1 = ./$(PROJ1)/$(PROJ1).cpp
SOURCE2 = ./$(PROJ2)/$(PROJ2).cpp
OBJECT1 = ./$(PROJ1).o
OBJECT2 = ./$(PROJ2).o
ASM1 = ./$(PROJ1).s
ASM2 = ./$(PROJ2).s
INCLUDES = -I$(MAYA_LOCATION)/devkit/include/ -I./ -I../ -I/usr/local/include/eigen3/
LIBS = -L$(MAYA_LOCATION)/Maya.app/Contents/MacOS -lOpenMaya -lOpenMayaAnim -lOpenMayaRender -lOpenMayaUI -lFoundation
ISYSROOT = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
#compiler options
CC = /usr/bin/g++
LD = /usr/bin/g++
CLANG = /usr/bin/clang
CFLAGS = -DCC_GNU_ -DOSMac_ -DOSMacOSX_ \
-DOSMac_MachO_ -D_LANGUAGE_C_PLUS_PLUS \
-include "$(MAYA_LOCATION)/devkit/include/maya/OpenMayaMac.h" \
-DMAC_PLUGIN -D_BOOL -DREQUIRE_IOSTREAM -O2 -mavx
#CFLAGS += -fopenmp
C++FLAGS = $(CFLAGS) $(WARNFLAGS) $(ERROR_FLAGS) -fno-gnu-keywords
LDFLAGS = $(C++FLAGS)
DYNLIB_LOCATION = $(MAYA_LOCATION)/Maya.app/Contents/MacOS
LDFLAGS += -isysroot $(ISYSROOT) $(ARCH_FLAGS) -headerpad_max_install_names -bundle
LDFLAGS += -Wl,-exported_symbol,__Z16initializePlugin7MObject \
-Wl,-exported_symbol,__Z18uninitializePlugin7MObject
LREMAP = -Wl,-executable_path,"$(DYNLIB_LOCATION)"
LDFLAGS += -L"$(DYNLIB_LOCATION)" $(LREMAP)
.PHONY: all install clean
all: $(PROJ1) $(PROJ2)
$(PROJ1): $(OBJECT1)
$(LD) $(LDFLAGS) $(LIBS) $^ -o [email protected]
$(PROJ2): $(OBJECT2)
$(LD) $(LDFLAGS) $(LIBS) $^ -o [email protected]
$(OBJECT1): $(ASM1)
$(CLANG) -c $^
$(OBJECT2): $(ASM2)
$(CLANG) -c $^
$(ASM1): $(SOURCE1)
$(CC) -S $(INCLUDES) $(C++FLAGS) $^
$(ASM2): $(SOURCE2)
$(CC) -S $(INCLUDES) $(C++FLAGS) $^
install:
mv $(PROJ1).bundle $(PROJ2).bundle /Users/Shared/Autodesk/maya/plug-ins/
clean:
rm -f $(OBJECT1) $(OBJECT2) $(ASM1) $(ASM2)