components/python/cffi/Makefile
author John Beck <John.Beck@Oracle.COM>
Fri, 13 Jun 2014 12:36:52 -0700
changeset 1948 2d1537e7942d
parent 1846 df40919e04fa
child 3817 30b42c38bbc4
permissions -rw-r--r--
18978320 Userland components should specify TPNOs in Makefiles instead of pkg manifests
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1846
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     1
#
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     2
# CDDL HEADER START
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     3
#
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     7
#
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    11
# and limitations under the License.
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    12
#
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    18
#
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    19
# CDDL HEADER END
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    20
#
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    21
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    22
#
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    23
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    24
#
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    25
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    26
include ../../../make-rules/shared-macros.mk
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    27
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    28
COMPONENT_NAME=		cffi
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    29
COMPONENT_VERSION=	0.8.2
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    30
COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    31
COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    32
COMPONENT_ARCHIVE_HASH=	\
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    33
    sha256:8192393640f7bc304ce82669b35eb90592566a30abbb4924456f52079afc18e2
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    34
COMPONENT_ARCHIVE_URL=	$(call pypi_url)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    35
COMPONENT_PROJECT_URL=	http://cffi.readthedocs.org/
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    36
COMPONENT_BUGDB=	python-mod/cffi
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    37
1948
2d1537e7942d 18978320 Userland components should specify TPNOs in Makefiles instead of pkg manifests
John Beck <John.Beck@Oracle.COM>
parents: 1846
diff changeset
    38
TPNO=			16913
2d1537e7942d 18978320 Userland components should specify TPNOs in Makefiles instead of pkg manifests
John Beck <John.Beck@Oracle.COM>
parents: 1846
diff changeset
    39
1846
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    40
include $(WS_TOP)/make-rules/prep.mk
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    41
include $(WS_TOP)/make-rules/setup.py.mk
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    42
include $(WS_TOP)/make-rules/ips.mk
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    43
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    44
ASLR_MODE = $(ASLR_NOT_APPLICABLE)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    45
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    46
# We need to go look at pycparser in the workspace until it's available in the
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    47
# build environment.
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    48
PYCPARSER = $(WS_COMPONENTS)/python/pycparser/build/prototype/$(MACH)/$(PYTHON_LIB)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    49
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    50
$(PYCPARSER):
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    51
	(cd ../pycparser; $(MAKE) install)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    52
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    53
COMPONENT_TEST_DIR =	$(@D)/tests
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    54
COMPONENT_TEST_ENV =	$(PYTHON_ENV)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    55
COMPONENT_TEST_ENV +=	PYTHONPATH=$(PROTO_DIR)/$(PYTHON_LIB):$(PYCPARSER)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    56
COMPONENT_TEST_ENV +=	TESTOWNLIB_CC="$(CC) %s $(CC_BITS) -G -KPIC -o %s"
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    57
COMPONENT_TEST_CMD =	$(PYTHON.$(BITS)) /usr/bin/py.test-$(PYTHON_VERSION)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    58
COMPONENT_TEST_ARGS =	--resultlog $(@D)/testresults
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    59
COMPONENT_TEST_ARGS +=	-p no:codechecker
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    60
COMPONENT_TEST_ARGS +=	$(TEST_SKIPS)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    61
COMPONENT_TEST_ARGS +=	c testing
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    62
# The following tests cause core dumps on SPARC (bus error, illegal hardware
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    63
# instruction).  We don't skip test_install_and_reload_module{,_package}, which
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    64
# fail on both 64-bit platforms, since those don't cause the interpreter to
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    65
# crash.
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    66
$(BUILD_DIR)/sparcv7-%/.tested: TEST_SKIPS = -k "not test_callback_return_type and not test_struct_packed and not test_opaque_integer_as_function_result"
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    67
$(BUILD_DIR)/sparcv9-%/.tested: TEST_SKIPS = -k "not test_callback and not test_a_lot_of_callbacks and not test_struct_packed and not test_opaque_integer_as_function_result and not test_wchar"
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    68
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    69
# Copy the tests and a few of the source files they read into a scratch
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    70
# directory so running the tests don't leave turds in the source directory.
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    71
COMPONENT_PRE_TEST_ACTION = \
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    72
	$(MKDIR) $(@D)/tests/doc/source; \
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    73
	$(CP) -r $(SOURCE_DIR)/c $(SOURCE_DIR)/testing $(@D)/tests; \
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    74
	$(CP) $(SOURCE_DIR)/setup.py $(@D)/tests; \
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    75
	$(CP) $(SOURCE_DIR)/doc/source/conf.py $(SOURCE_DIR)/doc/source/index.rst $(@D)/tests/doc/source
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    76
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    77
$(BUILD_32_and_64): $(PYCPARSER)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    78
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    79
# common targets
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    80
build:		$(BUILD_32_and_64)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    81
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    82
install:	$(INSTALL_32_and_64)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    83
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    84
test:		$(TEST_32_and_64)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    85
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    86
BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    87
df40919e04fa PSARC/2014/110 CFFI: foreign function interface for Python calling C code
Danek Duvall <danek.duvall@oracle.com>
parents:
diff changeset
    88
include $(WS_TOP)/make-rules/depend.mk