-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMake.include
70 lines (60 loc) · 2.11 KB
/
Make.include
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
# Project variables
# =================
# These have the same value in all makefiles.
ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
OBJECT_ROOT := $(abspath $(ROOT_DIR)/object-root)
include $(ROOT_DIR)/Make.config
STAGE_DIR := $(abspath $(ROOT_DIR)/install)
ifndef PREFIX
PREFIX := $(STAGE_DIR)
endif
# MULTIARCH := $(shell $(CC) --print-multiarch)
# Makefile debugging. Helps trace which rules are triggered.
# OLD_SHELL := $(SHELL)
# SHELL = $(warning Building $@)$(OLD_SHELL)
# The directory under .curry in which to place intermediate files. By default,
# just prepent "sprite-" to the PAKCS directory name.
INTERMEDIATE_SUBDIR = sprite-$(PAKCS_SUBDIR)
PAKCS_SUBDIR := $(PAKCS_NAME)-$(PAKCS_VERSION)
$(PREFIX)/lib:
mkdir -p $(PREFIX)/lib
$(PREFIX)/lib/curry : | $(PREFIX)/lib
mkdir -p $(PREFIX)/lib/curry
$(PREFIX)/lib/curry/.curry : | $(PREFIX)/lib/curry
mkdir -p $(PREFIX)/lib/curry/.curry
# Functions.
# ==========
define clean_files =
@for f in $1; do if [ -e $$f -o -h $$f ]; then echo $2 $$f; $2 $$f; fi; done
endef
# Compiler flags
# ==============
CFLAGS += -I$(ROOT_DIR)/src -I$(BOOST_HOME)/include -I$(PYTHON_INCLUDE_PATH) \
-I$(ROOT_DIR)/extern/pybind11/include
LDFLAGS += -L $(PYTHON_LIBRARY_PATH) -Wl,-rpath=$(PYTHON_LIBRARY_PATH)
# Recursion
# =========
# For defined submodules (default: all directories) and certain targets,
# recursively invoke make. By default, all subdirectories are submodules. To
# change this, submakefiles should set SUBMODULES before including this file.
ifeq ($(flavor SUBMODULES),undefined)
SUBMODULES = $(dir $(wildcard */.))
endif
RECURSIVE_TARGETS := all safe-clean install libs objs shlibs uninstall
.PHONY: $(RECURSIVE_TARGETS) $(SUBMODULES)
$(RECURSIVE_TARGETS):: | $(SUBMODULES)
$(SUBMODULES):
$(MAKE) -C $@ $(MAKECMDGOALS)
# Debugging
# =========
# E.g., print-ROOT_DIR
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
# Special rules
# =============
# Make any subdirectory needed under PREFIX or OBJECT_ROOT.
$(PREFIX)/%/ :
mkdir -p $@
$(OBJECT_ROOT)/%/ :
mkdir -p $@
include $(ROOT_DIR)/Make.validate
include $(ROOT_DIR)/Make.rules