Makefile revision 46
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/APYTHON = /usr/bin/python
30N/A
12N/AROOT = ../proto/root_${MACH}
12N/AROOTUSRBIN = $(ROOT)/usr/bin
12N/AROOTUSRLIB = $(ROOT)/usr/lib
12N/AROOTPYTHON = $(ROOTUSRLIB)/python2.4
12N/AROOTPYTHONVENDOR = $(ROOTPYTHON)/vendor-packages
12N/AROOTPYTHONPKG = $(ROOTPYTHONVENDOR)/pkg
12N/A
30N/ALINKPYTHONPKG = /usr/lib/python2.4/vendor-packages/pkg
30N/A
29N/AROOTDIRS = \
29N/A $(ROOT) \
29N/A $(ROOTUSRBIN) \
29N/A $(ROOTUSRLIB) \
29N/A $(ROOTPYTHONPKG)/server \
29N/A $(ROOTPYTHONPKG)/publish \
29N/A $(ROOTPYTHONPKG)/client
12N/A
12N/APROGS = pkg pkgsend pkg.depotd
12N/AROOTPROGS = \
12N/A $(ROOT)/usr/bin/pkg \
12N/A $(ROOT)/usr/bin/pkgsend \
12N/A $(ROOT)/usr/lib/pkg.depotd
12N/A
12N/APYMODS = \
33N/A modules/__init__.py \
33N/A modules/arch.so \
34N/A modules/catalog.py \
33N/A modules/config.py \
33N/A modules/content.py \
33N/A modules/dependency.py \
33N/A modules/elf.so \
33N/A modules/fmri.py \
46N/A modules/misc.py \
33N/A modules/package.py \
33N/A modules/sysvpkg.py \
33N/A modules/version.py
22N/A
24N/APYSERVERMODS = \
33N/A modules/server/__init__.py \
33N/A modules/server/config.py \
33N/A modules/server/transaction.py
24N/A
29N/APYCLIENTMODS = \
33N/A modules/client/__init__.py \
33N/A modules/client/image.py
29N/A
29N/APYPUBLISHMODS = \
33N/A modules/publish/__init__.py \
34N/A modules/publish/transaction.py
29N/A
33N/AROOTPYMODS = $(PYMODS:modules/%=$(ROOTPYTHONPKG)/%)
24N/AROOTPYSERVERMODS = \
33N/A $(PYSERVERMODS:modules/server/%=$(ROOTPYTHONPKG)/server/%)
29N/AROOTPYPUBLISHMODS = \
33N/A $(PYPUBLISHMODS:modules/publish/%=$(ROOTPYTHONPKG)/publish/%)
29N/AROOTPYCLIENTMODS = \
33N/A $(PYCLIENTMODS:modules/client/%=$(ROOTPYTHONPKG)/client/%)
12N/A
30N/Aall := TARGET = all
30N/A
33N/Aall: $(PROGS) binary-modules
12N/A
20N/Aclean:
20N/A rm -f $(PROGS)
20N/A
33N/Aclobber: clean
33N/A rm -fr $(ROOT)
33N/A
30N/Ainstall: $(ROOTDIRS) $(ROOTPROGS) $(ROOTPYMODS) $(ROOTPYSERVERMODS) \
30N/A $(ROOTPYPUBLISHMODS) $(ROOTPYCLIENTMODS)
30N/A
33N/Abinary-modules:
33N/A @cd modules; pwd; $(MAKE) $(TARGET)
12N/A
22N/A# XXX link is a developer target to connect the local machine to the current
22N/A# repository's working copy's versions of the commands and modules.
22N/APWD:sh = pwd
22N/Alink:
22N/A ln -s $(PWD)/client.py /usr/bin/pkg
22N/A ln -s $(PWD)/publish.py /usr/bin/pkgsend
22N/A ln -s $(PWD)/depot.py /usr/lib/pkg.depotd
33N/A ln -s $(PWD)/modules /usr/lib/python2.4/vendor-packages/pkg
22N/A
30N/A# Invoke all known modules with tests.
30N/Atest:
46N/A $(PYTHON) $(LINKPYTHONPKG)/misc.py
30N/A $(PYTHON) $(LINKPYTHONPKG)/version.py
30N/A $(PYTHON) $(LINKPYTHONPKG)/fmri.py
45N/A $(PYTHON) $(LINKPYTHONPKG)/catalog.py
39N/A $(PYTHON) $(LINKPYTHONPKG)/manifest.py
30N/A
29N/A$(ROOT) $(ROOTUSRBIN) $(ROOTUSRLIB):
12N/A mkdir -p $(ROOT)
12N/A mkdir -p $(ROOTUSRBIN)
12N/A mkdir -p $(ROOTUSRLIB)
29N/A
29N/A$(ROOTPYTHONPKG) $(ROOTPYTHONPKG)/server:
24N/A mkdir -p $(ROOTPYTHONPKG)/server
12N/A
29N/A$(ROOTPYTHONPKG)/publish:
29N/A mkdir -p $(ROOTPYTHONPKG)/publish
29N/A
29N/A$(ROOTPYTHONPKG)/client:
29N/A mkdir -p $(ROOTPYTHONPKG)/client
29N/A
12N/A$(ROOTUSRBIN)/%: %
20N/A rm -f $@; install -f $(ROOTUSRBIN) -m 0555 $<
12N/A
12N/A$(ROOTUSRLIB)/%: %
20N/A rm -f $@; install -f $(ROOT)/usr/lib -m 0555 $<
12N/A
33N/A$(ROOTPYTHONPKG)/server/%: modules/server/%
24N/A rm -f $@; install -f $(ROOTPYTHONPKG)/server -m 0444 $<
24N/A
33N/A$(ROOTPYTHONPKG)/publish/%: modules/publish/%
29N/A rm -f $@; install -f $(ROOTPYTHONPKG)/publish -m 0444 $<
29N/A
33N/A$(ROOTPYTHONPKG)/client/%: modules/client/%
29N/A rm -f $@; install -f $(ROOTPYTHONPKG)/client -m 0444 $<
29N/A
33N/A$(ROOTPYTHONPKG)/%.so: modules/%.so
33N/A rm -f $@; install -f $(ROOTPYTHONPKG) -m 0555 $<
33N/A
33N/A$(ROOTPYTHONPKG)/%: modules/%
20N/A rm -f $@; install -f $(ROOTPYTHONPKG) -m 0444 $<
12N/A
12N/Apkg: client.py
12N/A cp client.py pkg
12N/A
12N/Apkgsend: publish.py
12N/A cp publish.py pkgsend
12N/A
12N/Apkg.depotd: depot.py
12N/A cp depot.py pkg.depotd