Cross Reference: /solaris-userland/components/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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
#
include ../make-rules/shared-macros.mk
# for now, the assumption is we build any directory with a Makefile. This may
# not always be the case. If we build a new make-like tool to drive the upper
# level build, it may make different decisions and will need to include
# appropriate dependency information.
# components.mk is auto-generated by the build tools. It populates the
# COMPONENT_DIRS macro with a list of all directories in the workspace that
# contain a component.
$(WS_MACH)/components.mk: $(WS_MACH) # Makefile # $(WS_TOP)/components
@echo "Generating component list..."
@$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
| sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
-include $(WS_MACH)/components.mk
# depends.mk is auto-generated by concatenating 'depend.mk' files in each
# component directory.
$(WS_MACH)/depends.mk: $(WS_MACH)/components.mk
@echo "Generating component dependencies..."
@cat $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
| sed -e 's;^$(shell pwd)/;;g' -e 's;$$;/depend.mk;g') >$@ \
2>/dev/null
-include $(WS_MACH)/depends.mk
#
# Walk through all of the components echoing the REQUIRED_PACKAGES for each one.
# Pass all output through sed to drop lines with whitespace between words,
# remove whitespace from lines, drop empty lines, and REQUIRED_PACKAGES +=
# to the lines. Pass that through sort -u
#
$(WS_MACH)/requires.mk: $(WS_MACH)
@echo "Generating list of required packages to build consolidation..."
@$(GMAKE) component-hook \
COMPONENT_HOOK='@echo $$(REQUIRED_PACKAGES:%="%\\n")' | \
$(GSED) -e '/\S\s\S/d' -e 's/^ //g' -e '/^\s*$$/d' \
-e 's/^/REQUIRED_PACKAGES += /' | \
sort -u >$(@)
system-check:: $(WS_MACH)/requires.mk
@$(GMAKE) -f $(WS_MAKE_RULES)/environment.mk -f $< component-environment-check
system-prep:: $(WS_MACH)/requires.mk
@echo "Installing any missing packages..."
@$(GMAKE) -f $(WS_MAKE_RULES)/environment.mk -f $< component-environment-prep
download: TARGET = download
unpack: TARGET = unpack
patch: TARGET = patch
prep: TARGET = prep
build: TARGET = build
install: TARGET = install
publish: TARGET = publish
clean: TARGET = clean
clobber: TARGET = clobber
test: TARGET = test
system-test: TARGET = system-test
zone-build: TARGET = component-zone-build
component-hook: TARGET = component-hook
zone-build prep build install publish test system-test: LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1
# turn off pkglint for the individual component builds.
ifeq ($(strip $(PKGLINT_COMPONENT)),)
publish: MAKEFLAGS += PKGLINT=/bin/true
endif
# In order to work around an IPS simultaneous publication issue and to improve
# top level build performance, we postpone catalog and index updates until the
# end of the build. Individual component builds postpone the updates until
# they have published all of their packages.
publish: MAKEFLAGS += DISABLE_IPS_CATALOG_AND_INDEX_UPDATES=yes
# For cases in which a component test should be skipped at at the top level
test: MAKEFLAGS += TOP_LEVEL_TEST=yes
system-test: MAKEFLAGS += TOP_LEVEL_TEST=yes
.DEFAULT: publish
zone-build build install publish test system-test: $(COMPONENT_DIRS)
COMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
download unpack patch:: $(COMPONENT_DIRS.nosetup)
prep: $(COMPONENT_DIRS.nosetup)
component-environment-check:: $(COMPONENT_DIRS.nosetup)
component-hook: $(COMPONENT_DIRS.nosetup)
clean: $(COMPONENT_DIRS.nosetup)
$(RM) $(WS_MACH)/components.mk $(WS_MACH)/depends.mk \
$(WS_MACH)/requires.mk $(WS_MACH)/*.p5m
clobber: $(COMPONENT_DIRS.nosetup) clean
@cd ../tools ; echo "clobbering tools..." ; $(GMAKE) clobber
$(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE) \
$(shell find . -name 'manifest-*.published')
setup: $(WS_MACH) $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
$(WS_MACH) $(WS_LOGS):
$(MKDIR) $@
$(WS_REPO):
$(PKGREPO) create $(PKG_REPO)
$(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER)
$(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER_LOCALIZABLE)
DUMMYPKG = "set name=fmri value=pkg:/dummy@0,$(BUILD_VERSION)\n"
DUMMYPKG += "set pkg.summary=dummy\n"
DUMMYPKG += "set org.opensolaris.consolidation=userland\n"
DUMMYPKG += "set info.classification=org.opensolaris.category.2008:System/Core"
$(WS_LINT_CACHE): $(WS_LOGS) tools
ifdef CANONICAL_REPO
@echo "Generating pkglint(1) cache from CANONICAL_REPO $(CANONICAL_REPO)..."
@(echo $(DUMMYPKG) | $(PKGLINT) \
-c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
>$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 || \
( echo "pkglint(1) failed, please see $(WS_LOGS)/naughty-canonical-repo-actions"; \
exit 1 ) \
)
else
$(MKDIR) $(WS_LINT_CACHE)
endif
tools:
@cd ../tools ; echo "building tools..." ; $(GMAKE) clean setup
$(COMPONENT_DIRS): $(WS_LOGS) setup FORCE
@cd $@ && echo "$(TARGET) $@" && \
$(BASS_O_MATIC) $(@:%=--component %) --make $(TARGET) $(LOG)
# Turn userland-incorporator warnings into build failures
INCORPORATE_WERROR ?= --Werror
incorporation:
$(WS_TOOLS)/userland-incorporator \
--repository $(PKG_REPO) \
--version $(OS_VERSION),$(BUILD_VERSION) \
--publisher $(PUBLISHER) \
--consolidation $(CONSOLIDATION) \
--destdir $(WS_MACH) \
--static-content-file $(WS_COMPONENTS)/meta-packages/incorporation-cache \
$(INCORPORATE_WERROR)
for incorporation in $(WS_MACH)/*.p5m ; do \
$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
$${incorporation} ; \
done
publish:
$(PKGREPO) refresh -s $(PKG_REPO)
# The package below is obsolete in S12, but cannot yet be removed from S11
# because runtime/python-26 has an optional dependency on it.
ifeq ($(BUILD_TYPE),evaluation)
ifeq ($(OS_VERSION),5.11)
-$(PKGREPO) remove -s $(PKG_REPO) \
library/python/tkinter-26
$(PKGREPO) refresh -s $(PKG_REPO)
endif
endif
# evaluation packages don't need to be incorporated
ifneq ($(BUILD_TYPE), evaluation)
$(MAKE) incorporation
endif
# pkglint all of the published manifests in one batch.
ifdef CANONICAL_REPO
@echo 'pkglinting all package manifests...'
@$(ENV) PYTHONPATH=$(WS_TOOLS)/python \
SOLARIS_VERSION=$(SOLARIS_VERSION) \
$(PKGLINT) \
-c $(WS_LINT_CACHE) -f $(WS_TOOLS)/pkglintrc \
$(shell find . -name 'manifest-*.published')
endif
$(COMPONENT_DIRS.nosetup): $(WS_LOGS) FORCE
@cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
$(BASS_O_MATIC) $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
FORCE: