Makefile revision 375
12N/A#
12N/A# CDDL HEADER START
12N/A#
12N/A# The contents of this file are subject to the terms of the
12N/A# Common Development and Distribution License (the "License").
12N/A# You may not use this file except in compliance with the License.
12N/A#
12N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12N/A# or http://www.opensolaris.org/os/licensing.
12N/A# See the License for the specific language governing permissions
12N/A# and limitations under the License.
12N/A#
12N/A# When distributing Covered Code, include this CDDL HEADER in each
12N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
12N/A# If applicable, add the following below this CDDL HEADER, with the
12N/A# fields enclosed by brackets "[]" replaced with your own identifying
12N/A# information: Portions Copyright [yyyy] [name of copyright owner]
12N/A#
12N/A# CDDL HEADER END
12N/A#
12N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
12N/A# Use is subject to license terms.
12N/A#
12N/A
12N/A# client.py -> /usr/bin/pkg
12N/A# pull.py -> /usr/bin/pkgrecv
12N/A# publish.py -> /usr/bin/pkgsend
12N/A# depot.py -> /usr/lib/pkg.depotd
12N/A#
12N/A# pkg/*.py -> /usr/lib/python2.4/vendor-packages/pkg/
12N/A
12N/AMACH:sh = uname -p
30N/A
30N/AKSH=/usr/bin/ksh
12N/APYTHON = /usr/bin/python
12N/A
12N/AROOT = ../proto/root_${MACH}
12N/AROOTUSRBIN = $(ROOT)/usr/bin
12N/AROOTUSRLIB = $(ROOT)/usr/lib
12N/AROOTSHARE = $(ROOT)/usr/share/lib/pkg
12N/AROOTMANIFEST = $(ROOT)/var/svc/manifest/application
30N/AROOTPYTHON = $(ROOTUSRLIB)/python2.4
30N/AROOTPYTHONVENDOR = $(ROOTPYTHON)/vendor-packages
29N/AROOTPYTHONPKG = $(ROOTPYTHONVENDOR)/pkg
29N/AROOTMAN1 = $(ROOT)/usr/share/man/cat1
29N/AROOTMAN1M = $(ROOT)/usr/share/man/cat1m
29N/AROOTMAN5 = $(ROOT)/usr/share/man/cat5
59N/A
29N/ALINKPYTHONPKG = /usr/lib/python2.4/vendor-packages/pkg
29N/A
59N/AVERSION:sh = hg id -i
59N/AFILEVERSION = sed -n -e '/^VERSION/s/.*"\([^"]*\)"/\1/p' $@ 2> /dev/null || true
59N/A
12N/AROOTDIRS = \
12N/A $(ROOT) \
59N/A $(ROOTUSRBIN) \
12N/A $(ROOTUSRLIB) \
12N/A $(ROOTPYTHONPKG)/actions \
12N/A $(ROOTPYTHONPKG)/server \
12N/A $(ROOTPYTHONPKG)/publish \
12N/A $(ROOTPYTHONPKG)/client \
12N/A $(ROOTPYTHONPKG)/actions \
33N/A $(ROOTPYTHONPKG)/bundle \
98N/A $(ROOTPYTHONPKG)/portable \
33N/A $(ROOTMANIFEST) \
34N/A $(ROOTSHARE) \
33N/A $(ROOTMAN1) \
33N/A $(ROOTMAN1M) \
59N/A $(ROOTMAN5)
33N/A
33N/APROGS = pkg pkgrecv pkgsend pkg.depotd
33N/A
59N/AROOTPROGS = \
46N/A $(ROOT)/usr/bin/pkg \
33N/A $(ROOT)/usr/bin/pkgrecv \
98N/A $(ROOT)/usr/bin/pkgsend \
33N/A $(ROOT)/usr/lib/pkg.depotd
33N/A
22N/APYMODS = \
59N/A modules/__init__.py \
59N/A modules/Queue25.py \
59N/A modules/arch.so \
59N/A modules/catalog.py \
59N/A modules/cfgfiles.py \
98N/A modules/config.py \
59N/A modules/cpiofile.py \
59N/A modules/dependency.py \
59N/A modules/depotcontroller.py \
59N/A modules/elf.so \
59N/A modules/fmri.py \
59N/A modules/manifest.py \
24N/A modules/misc.py \
33N/A modules/pkgtarfile.py \
33N/A modules/smf.py \
33N/A modules/subprocess_method.py \
24N/A modules/sysvpkg.py \
29N/A modules/urlhelpers.py \
33N/A modules/updatelog.py \
59N/A modules/version.py
59N/APYCMODS = $(PYMODS:%.py=%.pyc)
59N/A
59N/APYACTIONMODS = \
29N/A modules/actions/__init__.py \
29N/A modules/actions/attribute.py \
33N/A modules/actions/depend.py \
34N/A modules/actions/directory.py \
29N/A modules/actions/driver.py \
59N/A modules/actions/file.py \
59N/A modules/actions/generic.py \
59N/A modules/actions/group.py \
59N/A modules/actions/hardlink.py \
59N/A modules/actions/legacy.py \
59N/A modules/actions/license.py \
33N/A modules/actions/link.py \
59N/A modules/actions/unknown.py \
59N/A modules/actions/user.py
24N/A
33N/APYCACTIONMODS = $(PYACTIONMODS:%.py=%.pyc)
29N/A
33N/APYSERVERMODS = \
29N/A modules/server/__init__.py \
33N/A modules/server/config.py \
59N/A modules/server/face.py \
59N/A modules/server/transaction.py
59N/APYCSERVERMODS = $(PYSERVERMODS:%.py=%.pyc)
59N/A
59N/APYCLIENTMODS = \
59N/A modules/client/__init__.py \
59N/A modules/client/bootenv.py \
59N/A modules/client/filelist.py \
59N/A modules/client/filter.py \
59N/A modules/client/image.py \
59N/A modules/client/imageconfig.py \
59N/A modules/client/imageplan.py \
59N/A modules/client/imagetypes.py \
59N/A modules/client/pkgplan.py \
59N/A modules/client/progress.py \
12N/A modules/client/retrieve.py
30N/APYCCLIENTMODS = $(PYCLIENTMODS:%.py=%.pyc)
97N/A
98N/APYPUBLISHMODS = \
30N/A modules/publish/__init__.py \
33N/A modules/publish/transaction.py
12N/APYCPUBLISHMODS = $(PYPUBLISHMODS:%.py=%.pyc)
20N/A
20N/APYBUNDLEMODS = \
20N/A modules/bundle/__init__.py \
33N/A modules/bundle/SolarisPackageDatastreamBundle.py \
33N/A modules/bundle/TarBundle.py \
33N/A modules/bundle/SolarisPackageDirBundle.py
59N/APYCBUNDLEMODS = $(PYBUNDLEMODS:%.py=%.pyc)
98N/A
98N/APYPORTABLEMODS = \
30N/A modules/portable/__init__.py \
33N/A modules/portable/util.py \
33N/A modules/portable/os_unix.py \
12N/A modules/portable/os_sunos.py
22N/APYCPORTABLEMODS = $(PYPORTABLEMODS:%.py=%.pyc)
22N/A
22N/AROOTPYMODS = $(PYMODS:modules/%=$(ROOTPYTHONPKG)/%)
22N/AROOTPYACTIONMODS = \
22N/A $(PYACTIONMODS:modules/actions/%=$(ROOTPYTHONPKG)/actions/%)
22N/AROOTPYSERVERMODS = \
22N/A $(PYSERVERMODS:modules/server/%=$(ROOTPYTHONPKG)/server/%)
33N/AROOTPYPUBLISHMODS = \
97N/A $(PYPUBLISHMODS:modules/publish/%=$(ROOTPYTHONPKG)/publish/%)
22N/AROOTPYCLIENTMODS = \
30N/A $(PYCLIENTMODS:modules/client/%=$(ROOTPYTHONPKG)/client/%)
50N/AROOTPYBUNDLEMODS = \
30N/A $(PYBUNDLEMODS:modules/bundle/%=$(ROOTPYTHONPKG)/bundle/%)
50N/AROOTPYPORTABLEMODS = \
50N/A $(PYPORTABLEMODS:modules/portable/%=$(ROOTPYTHONPKG)/portable/%)
46N/A
30N/AROOTPYCALLMODS = \
30N/A $(ROOTPYMODS:%.py=%.pyc) \
45N/A $(ROOTPYACTIONMODS:%.py=%.pyc) \
39N/A $(ROOTPYSERVERMODS:%.py=%.pyc) \
74N/A $(ROOTPYPUBLISHMODS:%.py=%.pyc) \
30N/A $(ROOTPYCLIENTMODS:%.py=%.pyc) \
29N/A $(ROOTPYBUNDLEMODS:%.py=%.pyc) \
12N/A $(ROOTPYPORTABLEMODS:%.py=%.pyc)
12N/A
12N/AROOTPKGMANIFEST = $(ROOTMANIFEST)/pkg-server.xml
29N/A
29N/AROOTPKGWEB = $(ROOTSHARE)/pkg-block-logo.png
24N/A
12N/AROOTCOMPONENTS = \
29N/A $(ROOTDIRS) \
29N/A $(ROOTPROGS) \
29N/A $(ROOTPYMODS) \
29N/A $(ROOTPYACTIONMODS) \
29N/A $(ROOTPYSERVERMODS) \
29N/A $(ROOTPYPUBLISHMODS) \
59N/A $(ROOTPYCLIENTMODS) \
59N/A $(ROOTPYACTIONMODS) \
59N/A $(ROOTPYBUNDLEMODS) \
59N/A $(ROOTPYPORTABLEMODS) \
59N/A $(ROOTPYCALLMODS) \
59N/A $(ROOTPKGMANIFEST)
12N/A
20N/Aall := TARGET = all
12N/Alink := TARGET = link
12N/Ainstall := TARGET = install
20N/Alink-clean := TARGET = link-clean
12N/Aclean := TARGET = clean
59N/Aclobber := TARGET = clobber
59N/Atest := TARGET = test
59N/Atest-verbose := TARGET = test-verbose
33N/A
24N/Aall: $(PROGS) binary-modules
24N/A
33N/Aclean:
29N/A rm -f $(PROGS)
29N/A @cd modules; pwd; $(MAKE) $(TARGET)
33N/A @cd man; pwd; $(MAKE) $(TARGET)
29N/A @cd web; pwd; $(MAKE) $(TARGET)
29N/A @cd tests; pwd; $(MAKE) $(TARGET)
59N/A
59N/Aclobber: clean
59N/A rm -fr $(ROOT)
33N/A rm -f $(PYCMODS) $(PYCACTIONMODS) $(PYCSERVERMODS) \
33N/A $(PYCPUBLISHMODS) $(PYCCLIENTMODS) $(PYCBUNDLEMODS) \
33N/A $(PYCPORTABLEMODS)
33N/A @cd modules; pwd; $(MAKE) $(TARGET)
20N/A @cd man; pwd; $(MAKE) $(TARGET)
12N/A @cd web; pwd; $(MAKE) $(TARGET)
12N/A
12N/Ainstall: all $(ROOTCOMPONENTS)
12N/A @cd brand; pwd; $(MAKE) $(TARGET)
12N/A @cd man; pwd; $(MAKE) $(TARGET)
12N/A @cd web; pwd; $(MAKE) $(TARGET)
12N/A @cd pkgdefs; pwd; $(MAKE) $(TARGET)
12N/A
12N/Amodules/%.pyc: modules/%.py
python -m compileall -l $(@D)
binary-modules:
@cd modules; pwd; $(MAKE) $(TARGET)
# XXX link is a developer target to connect the local machine to the current
# repository's working copy's versions of the commands, modules, and supporting
# files.
PWD:sh = pwd
link:
ln -sf $(PWD)/client.py /usr/bin/pkg
ln -sf $(PWD)/pull.py /usr/bin/pkgrecv
ln -sf $(PWD)/publish.py /usr/bin/pkgsend
ln -sf $(PWD)/depot.py /usr/lib/pkg.depotd
ln -sf $(PWD)/modules /usr/lib/python2.4/vendor-packages/pkg
ln -sf $(PWD)/pkg-server.xml /var/svc/manifest/application/pkg-server.xml
@cd web; pwd; $(MAKE) $(TARGET)
@cd brand; pwd; $(MAKE) $(TARGET)
@cd man; pwd; $(MAKE) $(TARGET)
link-clean:
rm -f /usr/bin/pkg
rm -f /usr/bin/pkgrecv
rm -f /usr/bin/pkgsend
rm -f /usr/lib/pkg.depotd
rm -f /usr/lib/python2.4/vendor-packages/pkg
rm -f /var/svc/manifest/application/pkg-server.xml
@cd web; pwd; $(MAKE) $(TARGET)
@cd brand; pwd; $(MAKE) $(TARGET)
@cd man; pwd; $(MAKE) $(TARGET)
test:
@cd tests; pwd; $(MAKE) $(TARGET)
test-verbose: test
proto: $(ROOT)
$(ROOT):
mkdir -p $(ROOTDIRS)
$(ROOTUSRBIN)/%: %
rm -f $@; install -f $(ROOTUSRBIN) -m 0555 $<
$(ROOTUSRLIB)/%: %
rm -f $@; install -f $(ROOT)/usr/lib -m 0555 $<
$(ROOTPYTHONPKG)/__init__.py: FRC
if [ "$(VERSION)" != "$(FILEVERSION:sh)" ]; then \
rm -f $@; \
cat modules/__init__.py | \
sed -e '/^VERSION/s/"[^"]*"/"$(VERSION)"/' > $@; \
chmod 0444 $@; \
fi
$(ROOTPYTHONPKG)/__init__.pyc: $(ROOTPYTHONPKG)/__init__.py
python -m py_compile $(ROOTPYTHONPKG)/__init__.py
$(ROOTPYTHONPKG)/actions/%: modules/actions/%
rm -f $@; install -f $(ROOTPYTHONPKG)/actions -m 0444 $<
$(ROOTPYTHONPKG)/server/%: modules/server/%
rm -f $@; install -f $(ROOTPYTHONPKG)/server -m 0444 $<
$(ROOTPYTHONPKG)/publish/%: modules/publish/%
rm -f $@; install -f $(ROOTPYTHONPKG)/publish -m 0444 $<
$(ROOTPYTHONPKG)/client/%: modules/client/%
rm -f $@; install -f $(ROOTPYTHONPKG)/client -m 0444 $<
$(ROOTPYTHONPKG)/bundle/%: modules/bundle/%
rm -f $@; install -f $(ROOTPYTHONPKG)/bundle -m 0444 $<
$(ROOTPYTHONPKG)/portable/%: modules/portable/%
rm -f $@; install -f $(ROOTPYTHONPKG)/portable -m 0444 $<
$(ROOTPYTHONPKG)/%.so: modules/%.so
rm -f $@; install -f $(ROOTPYTHONPKG) -m 0555 $<
$(ROOTPYTHONPKG)/%: modules/%
rm -f $@; install -f $(ROOTPYTHONPKG) -m 0444 $<
$(ROOTMANIFEST)/%: %
rm -f $@; install -f $(ROOTMANIFEST) -m 0444 $<
pkg: client.py
cp client.py pkg
pkgrecv: pull.py
cp pull.py pkgrecv
pkgsend: publish.py
cp publish.py pkgsend
pkg.depotd: depot.py
cp depot.py pkg.depotd
FRC: