-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
103 lines (84 loc) · 2.82 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
# Copyright 2024 LAIKA. Authored by Mitch Prater.
#
# Licensed under the Apache License Version 2.0 http://apache.org/licenses/LICENSE-2.0,
# or the MIT license http://opensource.org/licenses/MIT, at your option.
#
# This program may not be copied, modified, or distributed except according to those terms.
#
#
# PIXAR_ROOT must be set to the location of the
# RenderMan installation: e.g. /opt/pixar
#
ifndef PIXAR_ROOT
$(error PIXAR_ROOT has not been set. This is required for the build system to function.)
endif
#
# SUBDIRS directories will be made using their own Makefile.
#
SUBDIRS := osl
# CURDIR is set by the make system itself: it is not part of the environment.
# It is the preferred means of acquiring the location where make was invoked:
# https://www.gnu.org/software/make/manual/make.html#Recursion
SRCDIR ?= $(CURDIR)
export SRCDIR
PYTHONDIR ?= $(SRCDIR)/python3
export PYTHONDIR
# Build destination. This is where the made files end up.
DSTDIR ?= $(SRCDIR)/build
export DSTDIR
#
# Default goal: the target of 'make'.
#
.DEFAULT_GOAL = all
# The default target's prerequisites.
all : $(DSTDIR) subdirs copydirs
# Targets that depend on $(DSTDIR)
subdirs copydirs : $(DSTDIR)
# Targets whose time stamps we want to ignore.
.PHONY : all info clean subdirs copydirs $(rman_versions)
#------------------------------------------------------------------
# Makefile functionaliy.
# Make all contents and install it in the DSTDIR.
# Sub-directories are made using their own Makefile.
#------------------------------------------------------------------
# Ensure the destination directory exists.
$(DSTDIR) :
mkdir -p $(DSTDIR)
# Handle directories whose contents are not built but simply copied.
COPY_CMD = cp -arv
copydirs : $(DSTDIR)
#
# The actual work of building is done in the sub-directories.
#
.PHONY : subdirs $(SUBDIRS) clean $(CLEAN_SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
# Cleans the subdirectories.
CLEAN_SUBDIRS = $(addprefix clean_, $(SUBDIRS))
clean_subdirs : $(CLEAN_SUBDIRS)
$(CLEAN_SUBDIRS):
$(MAKE) -C $(subst clean_,,$@) clean_local
# Top-level clean also nukes the build directory.
clean : clean_subdirs
@ echo "make clean."
@ -rm -rf $(SRCDIR)/build
#
# Helpful rules.
#
help :
@ echo "------------------------------------------------------------------------"
@ echo "PIXAR_ROOT must be set to the location of the RenderMan installation:"
@ echo "e.g. /opt/pixar"
@ echo "RMAN_VERSION must also be set to the RenderMan version you wish to make:"
@ echo "e.g. 26.1"
@ echo ""
@ echo "Current settings:"
@ echo "PIXAR_ROOT: $(PIXAR_ROOT)"
@ echo "RMAN_VERSION: $(RMAN_VERSION)"
@ echo "SRCDIR: $(SRCDIR)"
@ echo "PYTHONDIR: $(PYTHONDIR)"
@ echo "DSTDIR: $(DSTDIR)"
@ echo "SUBDIRS: $(SUBDIRS)"
@ echo "------------------------------------------------------------------------"