Makefile revision 4845
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# CDDL HEADER START
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# The contents of this file are subject to the terms of the
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# Common Development and Distribution License (the "License").
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# You may not use this file except in compliance with the License.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# or http://www.opensolaris.org/os/licensing.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# See the License for the specific language governing permissions
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# and limitations under the License.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# When distributing Covered Code, include this CDDL HEADER in each
c414e18b750ecd647a82c14bb30f33afc32ca188Peter Major# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# If applicable, add the following below this CDDL HEADER, with the
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# fields enclosed by brackets "[]" replaced with your own identifying
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# information: Portions Copyright [yyyy] [name of copyright owner]
c414e18b750ecd647a82c14bb30f33afc32ca188Peter Major# CDDL HEADER END
109d6d2dfb8e7b925aafcd3a1f43dcb1658f3f28James Phillpotts# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
c414e18b750ecd647a82c14bb30f33afc32ca188Peter MajorCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott sha256:1dce8c143a5aa15e0638887c2b395e2e823223c63ebaf8d5f432a99e44b29f60
537857b204a4425e0ea257b0413a02c5c7c5e266Robert WapshottCOMPONENT_PROJECT_URL= https://bitbucket.org/logilab/pylint
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# Since Pylint 1.4, it only supports Python 2.7+ and Python 3.3+.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# There are several pylint documentation files that setup.py isn't installing
109d6d2dfb8e7b925aafcd3a1f43dcb1658f3f28James Phillpotts# but are present in the pylint package on other distributions. Copy them into
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# the proto area "manually", so they can be included in the package.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott $(CP) $(COMPONENT_SRC)/README $(PDOC_PYLINT) ;
109d6d2dfb8e7b925aafcd3a1f43dcb1658f3f28James Phillpotts $(CP) $(COMPONENT_SRC)/README.Python3 $(PDOC_PYLINT) ;
109d6d2dfb8e7b925aafcd3a1f43dcb1658f3f28James Phillpotts $(CP) $(COMPONENT_SRC)/examples/custom.py $(PDOC_PYLINT_EXAMPLES) ;
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott $(CP) $(COMPONENT_SRC)/examples/custom_raw.py $(PDOC_PYLINT_EXAMPLES) ;
109d6d2dfb8e7b925aafcd3a1f43dcb1658f3f28James Phillpotts $(CP) $(COMPONENT_SRC)/elisp/pylint.el $(PDOC_PYLINT_EXAMPLES) ;
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott $(CP) $(COMPONENT_SRC)/examples/pylintrc_camelcase $(PDOC_PYLINT_EXAMPLES) ;
c414e18b750ecd647a82c14bb30f33afc32ca188Peter Major $(CP) $(COMPONENT_SRC)/examples/pylintrc $(PDOC_PYLINT_EXAMPLES) ;
c414e18b750ecd647a82c14bb30f33afc32ca188Peter Major (cd $(PROTO_DIR)/usr/bin; $(MV) epylint epylint-$(PYTHON_VERSION)) ;
c414e18b750ecd647a82c14bb30f33afc32ca188Peter Major (cd $(PROTO_DIR)/usr/bin; $(MV) pylint pylint-$(PYTHON_VERSION)) ;
c414e18b750ecd647a82c14bb30f33afc32ca188Peter Major (cd $(PROTO_DIR)/usr/bin; $(MV) pylint-gui pylint-gui-$(PYTHON_VERSION)) ;
c414e18b750ecd647a82c14bb30f33afc32ca188Peter Major (cd $(PROTO_DIR)/usr/bin; $(MV) pyreverse pyreverse-$(PYTHON_VERSION)) ;
c414e18b750ecd647a82c14bb30f33afc32ca188Peter Major (cd $(PROTO_DIR)/usr/bin; $(MV) symilar symilar-$(PYTHON_VERSION)) ;
c414e18b750ecd647a82c14bb30f33afc32ca188Peter Major# common targets
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott $(PYTHON.2.7.32) -m py_compile $(PROTO_DIR)/usr/lib/python2.7/vendor-packages/pylint/testutils.py
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# The tests are run using python 2.7 only and require that
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# the python-27 package is installed (does not have to be the default python).
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# Use the python 2.7 libraries for testing.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# logilab-common and astroid are runtime dependencies of pylint,
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# and we need to use their latest versions from this workspace.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# We can't just add their install targets as dependencies here,
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# so just "gmake install" in the logilab-common and astroid
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# component directories before running the pylint tests.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott $(COMPONENT_DIR)/../logilab-common install; \
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott $(GMAKE) -C $(COMPONENT_DIR)/../astroid install )
537857b204a4425e0ea257b0413a02c5c7c5e266Robert WapshottCOMPONENT_TEST_ENV = PYTHONPATH=$(COMPONENT_DIR)/../logilab-common/build/prototype/$(MACH)$(PYTHON_VENDOR_PACKAGES):$(COMPONENT_DIR)/../astroid/build/prototype/$(MACH)$(PYTHON_VENDOR_PACKAGES):$(PROTO_DIR)$(PYTHON_VENDOR_PACKAGES)
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# The test output contains details from each test, in whatever order they
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# complete. Use nawk to extract just the sections that summarizes the test result.
537857b204a4425e0ea257b0413a02c5c7c5e266Robert WapshottCOMPONENT_TEST_CMD = /usr/bin/pytest-$(PYTHON_VERSION)
537857b204a4425e0ea257b0413a02c5c7c5e266Robert WapshottCOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
537857b204a4425e0ea257b0413a02c5c7c5e266Robert WapshottCOMPONENT_TEST_TRANSFORMS = "'/Ran (.+) test cases/{ sub(/in(.+)\)/, \"\"); print }/All (.+) modules OK/'"
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# Expected failures for test target:
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# 437 test cases, 19 skipped
537857b204a4425e0ea257b0413a02c5c7c5e266Robert Wapshott# All 23 modules OK
109d6d2dfb8e7b925aafcd3a1f43dcb1658f3f28James PhillpottsREQUIRED_PACKAGES += library/python/logilab-common-27