Update hexchat to 2.12.0
[unleashed-userland.git] / components / Makefile
blobca31fd1d28f8b9b94394a80a63c666c7cf2bcf16
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
21 # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
24 -include ../make-rules/shared-macros.mk
26 # for now, the assumption is we build any directory with a Makefile. This may
27 # not always be the case. If we build a new make-like tool to drive the upper
28 # level build, it may make different decisions and will need to include
29 # appropriate dependency information.
31 # components.mk is auto-generated by the build tools. It populates the
32 # COMPONENT_DIRS macro with a list of all directories in the workspace that
33 # contain a component.
34 $(WS_TOP)/components/$(ENCUMBERED)components.mk: # Makefile # $(WS_TOP)/components
35 @echo "Generating component list..."
36 @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
37 | sed -e 's;^$(shell pwd)/;;' \
38 | sed -f components.ignore \
39 | sed -e 's;^;COMPONENT_DIRS += ;g' >$@
41 -include $(WS_TOP)/components/$(ENCUMBERED)components.mk
43 # depends.mk is auto-generated by concatenating 'depend.mk' files in each
44 # component directory.
45 $(WS_TOP)/components/$(ENCUMBERED)depends.mk: $(WS_TOP)/components/$(ENCUMBERED)components.mk
46 @echo "Generating component dependencies..."
47 @cat /dev/null $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
48 | sed -e 's;^$(shell pwd)/;;g' \
49 | sed -f components.ignore \
50 | sed -e 's;$$;/depend.mk;g') >$@ \
51 2>/dev/null
53 -include $(WS_TOP)/components/$(ENCUMBERED)depends.mk
56 download: TARGET = download
57 prep: TARGET = prep
58 build: TARGET = build
59 install: TARGET = install
60 publish: TARGET = publish
61 clean: TARGET = clean
62 clobber: TARGET = clobber
63 test: TARGET = test
64 component-hook: TARGET = component-hook
65 prep build install publish test: TEMPLATE_ZONE=$(ZONE)
66 prep build install publish test: LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1
68 # turn off pkglint for the individual component builds.
69 ifeq ($(strip $(PKGLINT_COMPONENT)),)
70 publish: MAKEFLAGS += PKGLINT=/bin/true
71 endif
73 .DEFAULT: publish
75 build install publish test: $(COMPONENT_DIRS)
77 COMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
79 download prep: $(COMPONENT_DIRS.nosetup)
81 component-hook: $(COMPONENT_DIRS.nosetup)
83 clean: $(COMPONENT_DIRS.nosetup)
84 $(RM) $(WS_TOP)/components/$(ENCUMBERED)components.mk $(WS_TOP)/components/$(ENCUMBERED)depends.mk .profile
86 clobber: $(COMPONENT_DIRS.nosetup) clean
87 @cd $(WS_TOP)/tools ; echo "clobbering tools..." ; $(GMAKE) clobber
88 $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
91 setup: $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
93 $(WS_LOGS):
94 $(MKDIR) $@
96 $(WS_REPO):
97 $(PKGREPO) create $(PKG_REPO)
98 $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER)
99 # Not required for OI
100 # $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER_LOCALIZABLE)
102 DUMMYPKG = "set name=fmri value=pkg:/dummy@0,$(BUILD_VERSION)\n"
103 DUMMYPKG += "set pkg.summary=dummy\n"
104 DUMMYPKG += "set org.opensolaris.consolidation=userland\n"
105 DUMMYPKG += "set info.classification=org.opensolaris.category.2008:System/Core"
107 $(WS_LINT_CACHE): $(WS_LOGS) tools
108 ifdef CANONICAL_REPO
109 @echo "Generating pkglint(1) cache from $(CANONICAL_REPO)..."
110 @(echo $(DUMMYPKG) | $(PKGLINT) \
111 -c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
112 >$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 ; exit 0)
113 else
114 $(MKDIR) $(WS_LINT_CACHE)
115 endif
117 tools:
118 @cd $(WS_TOP)/tools ; echo "building tools..." ; $(GMAKE) clean setup
120 # $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
121 # to pass a few things on to zone based builds
122 .profile:
123 echo "PATH=$(PATH)" >>$@
124 echo "WS_TOP=$(WS_TOP)" >>$@
125 echo "export PATH WS_TOP" >>$@
127 $(COMPONENT_DIRS): $(WS_LOGS) setup FORCE
128 @cd $@ && echo "$(TARGET) $@" && \
129 $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
130 $(@:%=--component %) --make $(TARGET) $(LOG)
132 incorporation:
133 $(eval COMPONENT_REVISION := $(shell git rev-list HEAD --count))
134 $(WS_TOOLS)/userland-incorporator --repository $(PKG_REPO) \
135 --version=0.$(OS_VERSION),$(BUILD_VERSION) -p $(PUBLISHER) \
136 -c $(CONSOLIDATION) --destdir=$(WS_MACH) $(INCORPORATE_WERROR)
137 for incorporation in $(WS_MACH)/*.p5m ; do \
138 $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
139 $${incorporation} ; \
140 done
143 publish:
144 $(PKGREPO) refresh -s $(PKG_REPO)
145 ifdef CANONICAL_REPO
146 @echo 'pkglinting all package manifests...'
147 @$(ENV) PYTHONPATH=$(WS_TOOLS)/python $(PKGLINT) \
148 -c $(WS_LINT_CACHE) -f $(WS_TOOLS)/pkglintrc \
149 $(shell find . -name 'manifest-*.published')
150 endif
152 $(COMPONENT_DIRS.nosetup): $(WS_LOGS) FORCE
153 @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
154 $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
155 $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
157 FORCE: