Makefile revision 135
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 2007 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# 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
12N/A
30N/AKSH=/usr/bin/ksh
30N/APYTHON = /usr/bin/python
12N/A
12N/AROOT = ../proto/root_${MACH}
12N/AROOTUSRBIN = $(ROOT)/usr/bin
114N/AROOTUSRLIB = $(ROOT)/usr/lib
114N/AROOTSHARE = $(ROOT)/usr/share/lib/pkg
12N/AROOTMANIFEST = $(ROOT)/var/svc/manifest
12N/AROOTPYTHON = $(ROOTUSRLIB)/python2.4
12N/AROOTPYTHONVENDOR = $(ROOTPYTHON)/vendor-packages
114N/AROOTPYTHONPKG = $(ROOTPYTHONVENDOR)/pkg
114N/AROOTMAN1 = $(ROOT)/usr/share/man/cat1
12N/AROOTMAN1M = $(ROOT)/usr/share/man/cat1m
30N/A
30N/ALINKPYTHONPKG = /usr/lib/python2.4/vendor-packages/pkg
29N/A
29N/AROOTDIRS = \
29N/A $(ROOT) \
29N/A $(ROOTUSRBIN) \
59N/A $(ROOTUSRLIB) \
29N/A $(ROOTPYTHONPKG)/actions \
29N/A $(ROOTPYTHONPKG)/server \
59N/A $(ROOTPYTHONPKG)/publish \
59N/A $(ROOTPYTHONPKG)/client \
114N/A $(ROOTPYTHONPKG)/actions \
114N/A $(ROOTPYTHONPKG)/bundle \
114N/A $(ROOTMANIFEST) \
114N/A $(ROOTSHARE) \
114N/A $(ROOTMAN1) \
12N/A $(ROOTMAN1M)
12N/A
59N/APROGS = pkg pkgsend pkg.depotd
12N/A
12N/AROOTPROGS = \
12N/A $(ROOT)/usr/bin/pkg \
12N/A $(ROOT)/usr/bin/pkgsend \
12N/A $(ROOT)/usr/lib/pkg.depotd
12N/A
33N/APYMODS = \
98N/A modules/__init__.py \
33N/A modules/Queue25.py \
34N/A modules/arch.so \
33N/A modules/catalog.py \
59N/A modules/config.py \
33N/A modules/cpiofile.py \
33N/A modules/dependency.py \
33N/A modules/elf.so \
59N/A modules/fmri.py \
46N/A modules/manifest.py \
33N/A modules/misc.py \
98N/A modules/package.py \
33N/A modules/pkgtarfile.py \
33N/A modules/smf.py \
22N/A modules/sysvpkg.py \
59N/A modules/version.py
59N/APYCMODS = $(PYMODS:%.py=%.pyc)
59N/A
59N/APYACTIONMODS = \
59N/A modules/actions/__init__.py \
98N/A modules/actions/attribute.py \
59N/A modules/actions/depend.py \
59N/A modules/actions/directory.py \
59N/A modules/actions/driver.py \
59N/A modules/actions/file.py \
59N/A modules/actions/generic.py \
59N/A modules/actions/hardlink.py \
24N/A modules/actions/link.py \
33N/A modules/actions/unknown.py
33N/APYCACTIONMODS = $(PYACTIONMODS:%.py=%.pyc)
33N/A
24N/APYSERVERMODS = \
29N/A modules/server/__init__.py \
33N/A modules/server/config.py \
59N/A modules/server/face.py \
104N/A modules/server/transaction.py
59N/APYCSERVERMODS = $(PYSERVERMODS:%.py=%.pyc)
59N/A
59N/APYCLIENTMODS = \
29N/A modules/client/__init__.py \
29N/A modules/client/filelist.py \
33N/A modules/client/filter.py \
34N/A modules/client/image.py \
29N/A modules/client/imageconfig.py \
59N/A modules/client/imageplan.py \
59N/A modules/client/pkgplan.py \
59N/A modules/client/retrieve.py
59N/APYCCLIENTMODS = $(PYCLIENTMODS:%.py=%.pyc)
59N/A
59N/APYPUBLISHMODS = \
33N/A modules/publish/__init__.py \
59N/A modules/publish/transaction.py
59N/APYCPUBLISHMODS = $(PYPUBLISHMODS:%.py=%.pyc)
24N/A
33N/APYBUNDLEMODS = \
29N/A modules/bundle/__init__.py \
33N/A modules/bundle/SolarisPackageDatastreamBundle.py \
29N/A modules/bundle/TarBundle.py \
33N/A modules/bundle/SolarisPackageDirBundle.py
59N/APYCBUNDLEMODS = $(PYBUNDLEMODS:%.py=%.pyc)
59N/A
59N/AROOTPYMODS = $(PYMODS:modules/%=$(ROOTPYTHONPKG)/%)
59N/AROOTPYACTIONMODS = \
59N/A $(PYACTIONMODS:modules/actions/%=$(ROOTPYTHONPKG)/actions/%)
114N/AROOTPYSERVERMODS = \
114N/A $(PYSERVERMODS:modules/server/%=$(ROOTPYTHONPKG)/server/%)
114N/AROOTPYPUBLISHMODS = \
114N/A $(PYPUBLISHMODS:modules/publish/%=$(ROOTPYTHONPKG)/publish/%)
59N/AROOTPYCLIENTMODS = \
59N/A $(PYCLIENTMODS:modules/client/%=$(ROOTPYTHONPKG)/client/%)
59N/AROOTPYBUNDLEMODS = \
59N/A $(PYBUNDLEMODS:modules/bundle/%=$(ROOTPYTHONPKG)/bundle/%)
59N/A
59N/AROOTPYCALLMODS = \
59N/A $(ROOTPYMODS:%.py=%.pyc) \
59N/A $(ROOTPYACTIONMODS:%.py=%.pyc) \
59N/A $(ROOTPYSERVERMODS:%.py=%.pyc) \
59N/A $(ROOTPYPUBLISHMODS:%.py=%.pyc) \
12N/A $(ROOTPYCLIENTMODS:%.py=%.pyc) \
30N/A $(ROOTPYBUNDLEMODS:%.py=%.pyc)
97N/A
98N/AROOTPKGMANIFEST = $(ROOTMANIFEST)/pkg-server.xml
30N/A
33N/AROOTPKGWEB = $(ROOTSHARE)/pkg-block-logo.png
12N/A
20N/AROOTCOMPONENTS = \
20N/A $(ROOTDIRS) \
20N/A $(ROOTPROGS) \
33N/A $(ROOTPYMODS) \
33N/A $(ROOTPYACTIONMODS) \
33N/A $(ROOTPYSERVERMODS) \
114N/A $(ROOTPYPUBLISHMODS) \
98N/A $(ROOTPYCLIENTMODS) \
114N/A $(ROOTPYACTIONMODS) \
114N/A $(ROOTPYBUNDLEMODS) \
98N/A $(ROOTPYCALLMODS) \
30N/A $(ROOTPKGMANIFEST)
33N/A
33N/Aall := TARGET = all
12N/Alink := TARGET = link
22N/Ainstall := TARGET = install
114N/Alink-clean := TARGET = link-clean
114N/Aclean := TARGET = clean
22N/Aclobber := TARGET = clobber
22N/A
22N/Aall: $(PROGS) binary-modules
22N/A
22N/Aclean:
33N/A rm -f $(PROGS)
114N/A @cd modules; pwd; $(MAKE) $(TARGET)
97N/A @cd man; pwd; $(MAKE) $(TARGET)
114N/A @cd web; pwd; $(MAKE) $(TARGET)
22N/A
30N/Aclobber: clean
50N/A rm -fr $(ROOT)
30N/A rm -f $(PYCMODS) $(PYCACTIONMODS) $(PYCSERVERMODS) \
50N/A $(PYCPUBLISHMODS) $(PYCCLIENTMODS) $(PYCBUNDLEMODS)
50N/A @cd modules; pwd; $(MAKE) $(TARGET)
46N/A @cd man; pwd; $(MAKE) $(TARGET)
30N/A @cd web; pwd; $(MAKE) $(TARGET)
30N/A
45N/Ainstall: all $(ROOTCOMPONENTS)
39N/A @cd brand; pwd; $(MAKE) $(TARGET)
74N/A @cd man; pwd; $(MAKE) $(TARGET)
104N/A @cd web; pwd; $(MAKE) $(TARGET)
111N/A @cd pkgdefs; pwd; $(MAKE) $(TARGET)
30N/A
114N/Amodules/%.pyc: modules/%.py
12N/A python -m compileall -l $(@D)
114N/A
114N/Abinary-modules:
59N/A @cd modules; pwd; $(MAKE) $(TARGET)
12N/A
20N/A# XXX link is a developer target to connect the local machine to the current
12N/A# repository's working copy's versions of the commands, modules, and supporting
12N/A# files.
20N/APWD:sh = pwd
12N/Alink:
59N/A ln -sf $(PWD)/client.py /usr/bin/pkg
59N/A ln -sf $(PWD)/publish.py /usr/bin/pkgsend
59N/A ln -sf $(PWD)/depot.py /usr/lib/pkg.depotd
33N/A ln -sf $(PWD)/modules /usr/lib/python2.4/vendor-packages/pkg
24N/A ln -sf $(PWD)/pkg-server.xml /var/svc/manifest/pkg-server.xml
24N/A @cd web; pwd; $(MAKE) $(TARGET)
33N/A @cd brand; pwd; $(MAKE) $(TARGET)
29N/A @cd man; pwd; $(MAKE) $(TARGET)
29N/A
33N/Alink-clean:
29N/A rm -f /usr/bin/pkg
29N/A rm -f /usr/bin/pkgsend
59N/A rm -f /usr/lib/pkg.depotd
59N/A rm -f /usr/lib/python2.4/vendor-packages/pkg
59N/A rm -f /var/svc/manifest/pkg-server.xml
33N/A @cd web; pwd; $(MAKE) $(TARGET)
33N/A @cd brand; pwd; $(MAKE) $(TARGET)
33N/A @cd man; pwd; $(MAKE) $(TARGET)
33N/A
20N/A# Invoke all known modules with tests.
12N/A# XXX Invoke the bundle tests.
12N/Atest:
12N/A # $(PYTHON) $(LINKPYTHONPKG)/bundle/__init__.py a_sysv_pkg
12N/A # $(PYTHON) $(LINKPYTHONPKG)/bundle/__init__.py a_tarball
12N/A $(PYTHON) $(LINKPYTHONPKG)/misc.py
12N/A $(PYTHON) $(LINKPYTHONPKG)/version.py
12N/A $(PYTHON) $(LINKPYTHONPKG)/fmri.py
12N/A $(PYTHON) $(LINKPYTHONPKG)/catalog.py
12N/A $(PYTHON) $(LINKPYTHONPKG)/manifest.py
$(PYTHON) $(LINKPYTHONPKG)/smf.py
$(PYTHON) $(LINKPYTHONPKG)/client/imageconfig.py
$(PYTHON) $(LINKPYTHONPKG)/client/filter.py
cd tests; $(KSH) -x cli-complete.ksh
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)/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)/%.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
pkgsend: publish.py
cp publish.py pkgsend
pkg.depotd: depot.py
cp depot.py pkg.depotd