-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
73 lines (57 loc) · 1.36 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
68
69
70
71
72
73
#
# RMANTREE points to the RenderManProServer directory.
# Set it if it's not already set in the environment.
#
RMANTREE ?= /opt/pixar/RenderManProServer-23.2
#
# Compiler and linker settings.
#
CC = clang++
CFLAGS = -Wall -Wno-switch -Wno-reorder -Wno-sign-compare -Wno-narrowing -Wno-deprecated-declarations -fPIC -std=c++14 -O3
INCLUDE = -I. -I./include -I${RMANTREE}/include -I/usr/include/freetype2
LD = clang++
LFLAGS = -shared
LIBS = -lfreetype
#
# Control variables.
# These subdirectories will be searched for .cpp files, which will then be built into .so files.
#
SUBDIRS := displace displayfilter
# These shaders won't be built. Use 'subdirectory/basename'.
EXCLUDE :=
#
# Make functionality.
# src will be the list of .cpp files to build from.
#
src := $(foreach dir,$(SUBDIRS),$(wildcard $(dir)/*.cpp))
EXCLUDE := $(basename $(EXCLUDE))
EXCLUDE := $(addsuffix .cpp, $(EXCLUDE))
src := $(filter-out $(EXCLUDE), $(src))
#
# Create target lists.
#
obj := $(src:%.cpp=%.o)
dso := $(src:%.cpp=%.so)
#
# Targets and prerequisites.
#
all: $(dso)
$(obj): ${RMANTREE}/include/*.h
#
# Rules.
#
clean:
-$(shell rm -f $(shell find . -name "*.so" -print) $(shell find . -name "*.o" -print))
show_src:
@echo $(src)
show_obj:
@echo $(obj)
show_dso:
@echo $(dso)
#
# Build rules.
#
%.o : %.cpp
$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $<
%.so : %.o
$(LD) $(LFLAGS) $(LIBS) -o $@ $<