-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile_linux64
48 lines (37 loc) · 975 Bytes
/
makefile_linux64
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
# Example makefile for mayaplugins, linux64.
# Assumes src-files in subdir src/
# If needed, set this on make invocation:
# make -f makefile_linux64 MAYA_BASE_PATH=foobar
MAYA_BASE_PATH ?= /usr/autodesk
MAYA_VER ?= 2013
MAYA_PATH=""
ifeq ($(MAYA_VER), 2013)
MAYA_PATH=$(MAYA_BASE_PATH)/maya2013-x64
else
MAYA_PATH=$(MAYA_BASE_PATH)/usr/autodesk/maya2012-x64
endif
NAME=mengercmd
BIN=bin
SOURCES=$(wildcard src/**/*.cpp src/*.cpp)
OBJECTS=$(SOURCES:%.cpp=%.o)
LIB=$(BIN)/$(NAME).so
CC=g++
CFLAGS = -I$(MAYA_PATH)/include
CFLAGS += -pthread -pipe -D_BOOL -DLINUX_64 -DREQUIRE_IOSTREAM -fPIC -Wno-deprecated -fno-gnu-keywords -Wall
LFLAGS= -L$(MAYA_PATH)/lib -lOpenMaya -lFoundation
DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -DDEBUG -g
else
CFLAGS += -O2
endif
all: $(SOURCES) $(LIB)
$(LIB): $(OBJECTS) setup
$(CC) --shared $(CFLAGS) $(OBJECTS) -o $@ $(LFLAGS)
%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@
setup:
@mkdir -p bin
clean:
rm -rf bin
rm -f $(OBJECTS)