forked from vfxetc/rmantools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (31 loc) · 894 Bytes
/
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
OSL_SRCS := $(wildcard rmantools/pattern/*.osl)
OSL_SHADERS := $(OSL_SRCS:%.osl=%.oso)
PATTERN_SRCS := $(wildcard rmantools/pattern/*.cpp)
PATTERNS := $(PATTERN_SRCS:%.cpp=%.so)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
RMSTREEE ?= /opt/pixar/linux/RenderManStudio-19.0-maya2014
CXXFLAGS += -fPIC
LDFLAGS += -shared
else ifeq ($(UNAME_S),Darwin)
RMSTREEE ?= /opt/pixar/macosx/RenderManStudio-19.0-maya2014
LDFLAGS += -bundle -undefined dynamic_lookup
else
$(error Must be OSX or LINUX)
endif
RMANTREE ?= $(RMSTREE)/rmantree
CXXFLAGS += -I$(RMANTREE)/include
.PHONY: build patterns clean
.DEFAULT: build
build: patterns shaders
patterns: $(PATTERNS)
# Used to have $(OSL_SHADERS) here, but oslc has gone missing.
shaders:
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $^ -o $@
%.so: %.o
$(CXX) $(LDFLAGS) $^ -o $@
%.oso: %.osl
oslc -o $@ $^
clean:
- rm -rf build