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]
23 # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
26 PYTHON27
= /usr
/bin
/python2.7
27 PYTHON34
= /usr
/bin
/python3.4
30 install := TARGET
= install
31 packages
:= TARGET
= install
32 clean := TARGET
= clean
33 clobber := TARGET
= clobber
35 clint
:= TARGET
= clint
36 pylint
:= TARGET
= pylint
38 test-verbose
:= TARGET
= test-verbose
39 test-generate
:= TARGET
= test-generate
42 # clear PYTHONPATH when invoking /usr/bin/pkg (we don't want to load any
43 # pkg python modules from this workspace since they may be out of sync
44 # with the pkg modules in the root filesystem).
46 PYLINT_VER_CMD
= PYTHONPATH
= /usr
/bin
/pkg
info pkg
:/developer
/python
/pylint | \
47 /usr
/bin
/grep Version | \
48 /usr
/bin
/awk
-F
: '{print $$2}' |
/usr
/bin
/sed
-e
's/ //g'
50 SUBDIRS
=brand zoneproxy
53 $(PYTHON27
) setup.py build
56 $(PYTHON27
) setup.py
clean
57 @cd pkg
; pwd
; $(MAKE
) clean
60 $(PYTHON27
) setup.py
clobber
61 @cd pkg
; pwd
; $(MAKE
) clobber
64 # run pylint as part of the install target.
65 # it's the best way to ensure things stay pylint clean.
68 $(PYTHON27
) setup.py
install
71 $(PYTHON27
) setup.py lint
72 @cd zoneproxy
; pwd
; $(MAKE
) lint
75 $(PYTHON27
) setup.py clint
76 @cd zoneproxy
; pwd
; $(MAKE
) lint
79 PYLINT_VER
=$(PYLINT_VER_CMD
:sh
) $(PYTHON27
) setup.py pylint
82 # This rule propagates the current make target through all of the
83 # subdirectories in $SUBDIRS.
86 @cd
$@
; pwd
; $(MAKE
) $(TARGET
)
88 # Use the bits we just built to create the packages.
89 packages
: install pylint
90 @cd pkg
; pwd
; $(MAKE
) $(TARGET
) check \
91 PATH
=$$(hg root
2>/dev
/null || git rev-parse
--show-toplevel
)/proto
/root_
$$(uname
-p
)/usr
/bin
:$$PATH \
92 PYTHONPATH
=$$(hg root
2>/dev
/null || git rev-parse
--show-toplevel
)/proto
/root_
$$(uname
-p
)/usr
/lib
/python2.7
/vendor-packages
95 $(PYTHON27
) setup.py
test
98 $(PYTHON27
) setup.py
test -v
101 $(PYTHON27
) setup.py
test -g