forked from SynoCommunity/spksrc
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathspksrc.directories.mk
More file actions
96 lines (83 loc) · 3.03 KB
/
spksrc.directories.mk
File metadata and controls
96 lines (83 loc) · 3.03 KB
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
# * all goes in $(WORK_DIR) : work-arch (for noarch: work-all or work-dsm7), in the current directory
# * it will be installed in $(INSTALL_PREFIX) on the target system (/usr/local/transmission)
# * each source package is unpacked in $(WORK_DIR)
# * the install target installs files in $(WORK_DIR)/install/, known as $(INSTALL_DIR)
# depending on how the makefiles works, the install prefix may be $(INSTALL_DIR) or
# $(INSTALL_DIR)/$(INSTALL_PREFIX). This must be assigned to $(STAGING_INSTALL_PREFIX) if needed.
# * the copy target creates a staging area, in $(WORK_DIR)/staging/, known as $(STAGING_DIR).
# This staging dir does not contain the $(INSTALL_PREFIX)
# * Binaries and libraries are strip in $(STAGING_DIR)
# * The full content of $(STAGING_DIR) is packed, it will then be unpacked on the target in $(INSTALL_PREFIX)
BASE_DISTRIB_DIR = $(CURDIR)/../../distrib
PIP_DISTRIB_DIR = $(abspath $(DISTRIB_DIR)/pip)
PIP_CACHE_DIR = $(WORK_DIR)/pip
TOOLCHAIN_DIR = $(BASE_DISTRIB_DIR)/toolchain
TOOLKIT_DIR = $(BASE_DISTRIB_DIR)/toolkit
KERNEL_DIR = $(BASE_DISTRIB_DIR)/kernel
PACKAGES_DIR = $(CURDIR)/../../packages
# Default download location, see spksrc.download.mk
ifeq ($(strip $(DISTRIB_DIR)),)
DISTRIB_DIR = $(BASE_DISTRIB_DIR)
endif
ifndef WORK_DIR
WORK_DIR = $(CURDIR)/work$(ARCH_SUFFIX)
endif
ifndef LOG_DIR
LOG_DIR = $(CURDIR)
export LOG_DIR
endif
ifndef INSTALL_DIR
INSTALL_DIR = $(WORK_DIR)/install
endif
ifndef INSTALL_PREFIX
ifneq ($(strip $(SPK_NAME)),)
INSTALL_PREFIX = /var/packages/$(SPK_NAME)/target
else
ifneq ($(strip $(PKG_NAME)),)
INSTALL_PREFIX = /usr/local/$(PKG_NAME)
else
INSTALL_PREFIX = /usr/local
endif
endif
endif
ifndef KERNEL_SOURCE_DIR
KERNEL_SOURCE_DIR = $(CURDIR)/../../kernel/syno-$(ARCH)-$(TCVERSION)/work/linux
endif
ifeq ($(strip $(STAGING_INSTALL_PREFIX)),)
STAGING_INSTALL_PREFIX = $(INSTALL_DIR)$(INSTALL_PREFIX)
endif
#
# When building spk packages set var directory under
# target/../var to be consequent with the new directory
# structure using localstatedir flag. But only do so
# when invoking make from under spk/*. Setting var when
# test-building dependencies from under cross/* is unecessary.
#
ifeq ($(lastword $(subst /, ,$(INSTALL_PREFIX))),target)
INSTALL_PREFIX_VAR = $(shell dirname $(INSTALL_PREFIX))/var
endif
ifeq ($(strip $(INSTALL_PREFIX_VAR)),)
INSTALL_PREFIX_VAR = $(INSTALL_PREFIX)/var
endif
STAGING_INSTALL_PREFIX_VAR = $(INSTALL_DIR)$(INSTALL_PREFIX_VAR)
ifeq ($(strip $(STAGING_DIR)),)
STAGING_DIR = $(WORK_DIR)/staging
endif
# python wheelhouse directories
ifndef WHEELHOUSE
WHEELHOUSE = $(WORK_DIR)/wheelhouse
endif
ifndef STAGING_INSTALL_WHEELHOUSE
STAGING_INSTALL_WHEELHOUSE = $(STAGING_INSTALL_PREFIX)/share/wheelhouse
endif
# Mandatory directories to access rust based toolchain
CARGO_HOME=$(abspath $(BASE_DISTRIB_DIR)/cargo)
RUSTUP_HOME=$(abspath $(BASE_DISTRIB_DIR)/rustup)
export CARGO_HOME
export RUSTUP_HOME
ifeq ($(findstring cargo,$(subst /,,$(subst :,,$(PATH)))),)
export PATH:=$(abspath $(BASE_DISTRIB_DIR)/cargo/bin):$(PATH)
endif
define create_target_dir
@mkdir -p $$(dirname $@)
endef