mirror of
https://codeberg.org/Toasterson/ips.git
synced 2026-04-10 13:20:42 +00:00
Add oi-userland as sample data
This commit is contained in:
parent
3481814af2
commit
08dbee6bba
69 changed files with 6207 additions and 26 deletions
15
.idea/git_toolbox_prj.xml
generated
Normal file
15
.idea/git_toolbox_prj.xml
generated
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -57,8 +57,8 @@ COMPONENT_BUILD_ENV += GOEXPERIMENT="$(GOEXPERIMENT)"
|
|||
COMPONENT_BUILD_ENV += GOOS="illumos"
|
||||
COMPONENT_BUILD_ENV += GOCACHE="$(SOURCE_DIR)/gocache"
|
||||
COMPONENT_BUILD_ENV += GOPATH="$(SOURCE_DIR)/gopath"
|
||||
# COMPONENT_BUILD_ENV += \
|
||||
# GOROOT_BOOTSTRAP="/usr/lib/golang/$(COMPONENT_MAJOR_VERSION)"
|
||||
COMPONENT_BUILD_ENV += \
|
||||
GOROOT_BOOTSTRAP="/usr/lib/golang/$(COMPONENT_MAJOR_VERSION)"
|
||||
|
||||
# For convenience during installation of supplementary packages.
|
||||
COMPONENT_INSTALL_ENV += PATH="$(PROTO_DIR)$(GOROOT_FINAL)/bin:$(PATH)"
|
||||
|
|
@ -74,16 +74,16 @@ include $(WS_MAKE_RULES)/common.mk
|
|||
# We have to fiddle with the package archives to get them into the same source
|
||||
# directory so that we can use the standard build targets. We're effectively
|
||||
# building multiple components using a single target.
|
||||
# COMPONENT_POST_UNPACK_ACTION= \
|
||||
# $(MV) go $(COMPONENT_SRC)
|
||||
COMPONENT_POST_UNPACK_ACTION= \
|
||||
$(MV) go $(COMPONENT_SRC)
|
||||
|
||||
# Go doesn't have a standard Makefile-based build process, so override the
|
||||
# default.
|
||||
# COMPONENT_BUILD_ACTION= \
|
||||
# cd $(@D)/src; $(ENV) $(COMPONENT_BUILD_ENV) ./make.bash
|
||||
COMPONENT_BUILD_ACTION= \
|
||||
cd $(@D)/src; $(ENV) $(COMPONENT_BUILD_ENV) ./make.bash
|
||||
|
||||
# COMPONENT_TARGET_DIR= \
|
||||
# $(PROTOUSRLIBDIR)/$(COMPONENT_NAME)/$(COMPONENT_MAJOR_VERSION)
|
||||
COMPONENT_TARGET_DIR= \
|
||||
$(PROTOUSRLIBDIR)/$(COMPONENT_NAME)/$(COMPONENT_MAJOR_VERSION)
|
||||
|
||||
# We can't do any ASLR'ing as the Go 6l linker has no understanding of the
|
||||
# -z aslr=... option. So just override where needed in the .p5m files.
|
||||
|
|
@ -97,24 +97,24 @@ COMPONENT_TEST_TARGETS=
|
|||
|
||||
# Use this Command to copy the Go Source tree into the proto area. In order to deliver the Go SDK under GOROOT
|
||||
# Additionally nuke all the funky binary files used for test suites. They keep bothering the packaging tools
|
||||
#define COMPONENT_INSTALL_ACTION=
|
||||
# ($(MKDIR) $(COMPONENT_TARGET_DIR)/src); \
|
||||
# (cd $(SOURCE_DIR) && \
|
||||
# /usr/gnu/bin/find . -maxdepth 1 -path "./$(COMPONENT_SRC_NAME)" \
|
||||
# -prune -o \( ! -iname ".*" \) -print \
|
||||
# -exec /usr/gnu/bin/cp -r \
|
||||
# --parents {} $(COMPONENT_TARGET_DIR) \;); \
|
||||
# (cd $(BUILD_DIR_64) && \
|
||||
# /usr/gnu/bin/find src -type f \
|
||||
# -exec /usr/gnu/bin/cp --parents {} $(COMPONENT_TARGET_DIR) \;); \
|
||||
# (cd $(BUILD_DIR_64) && $(CP) -r bin $(COMPONENT_TARGET_DIR)/); \
|
||||
# (cd $(BUILD_DIR_64) && $(CP) -r pkg $(COMPONENT_TARGET_DIR)/); \
|
||||
# (rm -r $(COMPONENT_TARGET_DIR)/pkg/obj); \
|
||||
# ($(MKDIR) -p $(MEDIATEDUSRSHAREMAN1DIR)); \
|
||||
# /usr/gnu/bin/find $(COMPONENT_TARGET_DIR)/src -type f \
|
||||
# | egrep -v '\.go|\.s|\.bash|\.txt|\.c|\.tmpl|\.h|\.pl|\.md|\.S|\.py|\.dist|\.rc|\.bat|README|Makefile|\.awk|\.rules|\.mod|\.json|LICENSE|PATENTS'\
|
||||
# | xargs rm;
|
||||
#endef
|
||||
define COMPONENT_INSTALL_ACTION=
|
||||
($(MKDIR) $(COMPONENT_TARGET_DIR)/src); \
|
||||
(cd $(SOURCE_DIR) && \
|
||||
/usr/gnu/bin/find . -maxdepth 1 -path "./$(COMPONENT_SRC_NAME)" \
|
||||
-prune -o \( ! -iname ".*" \) -print \
|
||||
-exec /usr/gnu/bin/cp -r \
|
||||
--parents {} $(COMPONENT_TARGET_DIR) \;); \
|
||||
(cd $(BUILD_DIR_64) && \
|
||||
/usr/gnu/bin/find src -type f \
|
||||
-exec /usr/gnu/bin/cp --parents {} $(COMPONENT_TARGET_DIR) \;); \
|
||||
(cd $(BUILD_DIR_64) && $(CP) -r bin $(COMPONENT_TARGET_DIR)/); \
|
||||
(cd $(BUILD_DIR_64) && $(CP) -r pkg $(COMPONENT_TARGET_DIR)/); \
|
||||
(rm -r $(COMPONENT_TARGET_DIR)/pkg/obj); \
|
||||
($(MKDIR) -p $(MEDIATEDUSRSHAREMAN1DIR)); \
|
||||
/usr/gnu/bin/find $(COMPONENT_TARGET_DIR)/src -type f \
|
||||
| egrep -v '\.go|\.s|\.bash|\.txt|\.c|\.tmpl|\.h|\.pl|\.md|\.S|\.py|\.dist|\.rc|\.bat|README|Makefile|\.awk|\.rules|\.mod|\.json|LICENSE|PATENTS'\
|
||||
| xargs rm;
|
||||
endef
|
||||
|
||||
REQUIRED_PACKAGES += developer/golang-115
|
||||
# Auto-generated dependencies
|
||||
88
sample_data/make-rules/ant.mk
Normal file
88
sample_data/make-rules/ant.mk
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
ANT=/usr/bin/ant
|
||||
|
||||
COMPONENT_BUILD_ENV += JAVA_HOME="$(JAVA_HOME)"
|
||||
# build the configured source
|
||||
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
|
||||
$(RM) -r $(@D) ; $(MKDIR) $(@D)
|
||||
$(CLONEY) $(SOURCE_DIR) $(@D)
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
|
||||
$(ANT) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
-$(PARFAIT) $(@D)
|
||||
endif
|
||||
$(TOUCH) $@
|
||||
|
||||
COMPONENT_INSTALL_ENV += JAVA_HOME="$(JAVA_HOME)"
|
||||
# install the built source into a prototype area
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
|
||||
$(ANT) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
COMPONENT_TEST_ENV_CMD = $(ENV)
|
||||
COMPONENT_TEST_ENV += JAVA_HOME="$(JAVA_HOME)"
|
||||
COMPONENT_TEST_CMD = $(ANT)
|
||||
|
||||
# test the built source
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
parfait: build
|
||||
else
|
||||
parfait:
|
||||
$(MAKE) PARFAIT_BUILD=yes parfait
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(RM) -r $(SOURCE_DIR) $(BUILD_DIR)
|
||||
126
sample_data/make-rules/attpackagemake.mk
Normal file
126
sample_data/make-rules/attpackagemake.mk
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
#
|
||||
# Rules and Macros for building opens source software that uses AT&T's package
|
||||
# tool.
|
||||
#
|
||||
# To use these rules, include ../make-rules/attpackagemake.mk in your Makefile
|
||||
# and define "build", "install" targets appropriate to building your component.
|
||||
# Ex:
|
||||
#
|
||||
# build: $(BUILD_32) \
|
||||
# $(BUILD_64)
|
||||
#
|
||||
# install: $(INSTALL_32) \
|
||||
# $(INSTALL_64)
|
||||
#
|
||||
# Any additional pre/post configure, build, or install actions can be specified
|
||||
# in your Makefile by setting them in on of the following macros:
|
||||
# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
|
||||
# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
|
||||
#
|
||||
# If component specific make targets need to be used for build or install, they
|
||||
# can be specified in
|
||||
# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
|
||||
#
|
||||
|
||||
# Environment variables and arguments passed into the build and install
|
||||
# environment(s). These are the initial settings.
|
||||
COMPONENT_BUILD_ENV += \
|
||||
CC_EXPLICIT="$(CC)" \
|
||||
PATH=$(shell dirname $(CC)):$(PATH) \
|
||||
CC=$(shell basename $(CC))
|
||||
NPROC="$(NPROC)"
|
||||
|
||||
# This explicitly exports the build type for 32/64 bit distinction
|
||||
COMPONENT_BUILD_ARGS = \
|
||||
HOSTTYPE="$(HOSTTYPE$(BITS))" \
|
||||
CCFLAGS="$(CFLAGS)" \
|
||||
LDFLAGS="$(CXXFLAGS)"
|
||||
|
||||
# The install and test process needs the same environment as the build
|
||||
COMPONENT_INSTALL_ENV = $(COMPONENT_BUILD_ENV)
|
||||
COMPONENT_TEST_ENV = $(COMPONENT_BUILD_ENV)
|
||||
COMPONENT_INSTALL_ARGS = HOSTTYPE="$(HOSTTYPE$(BITS))"
|
||||
COMPONENT_TEST_ARGS = HOSTTYPE="$(HOSTTYPE$(BITS))"
|
||||
|
||||
# build the configured source
|
||||
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
|
||||
$(RM) -r $(@D) ; $(MKDIR) $(@D)
|
||||
$(CLONEY) $(SOURCE_DIR) $(@D)
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \
|
||||
bin/package make $(COMPONENT_BUILD_TARGETS) $(COMPONENT_BUILD_ARGS)
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
-$(PARFAIT) $(@D)
|
||||
endif
|
||||
$(TOUCH) $@
|
||||
|
||||
# install the built source into a prototype area
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
$(RM) -r $(PROTO_DIR)/$(MACH$(BITS)); $(MKDIR) $(PROTO_DIR)/$(MACH$(BITS));
|
||||
cd $(@D); $(ENV) $(COMPONENT_INSTALL_ENV) \
|
||||
bin/package flat $(COMPONENT_INSTALL_TARGETS) \
|
||||
$(COMPONENT_INSTALL_ARGS) \
|
||||
$(PROTO_DIR)/$(MACH$(BITS)) $(COMPONENT_INSTALL_PACKAGES)
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# test the built source
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
bin/package test $(COMPONENT_TEST_TARGETS) \
|
||||
$(COMPONENT_TEST_ARGS) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
bin/package test $(COMPONENT_TEST_TARGETS) \
|
||||
$(COMPONENT_TEST_ARGS)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
parfait: build
|
||||
else
|
||||
parfait:
|
||||
$(MAKE) PARFAIT_BUILD=yes parfait
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
|
||||
232
sample_data/make-rules/cmake.mk
Normal file
232
sample_data/make-rules/cmake.mk
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright 2011 EveryCity Ltd. All rights reserved.
|
||||
# Copyright 2013 Aurelien Larcher. All rights reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Rules and Macros for building open source software that uses the CMake utility
|
||||
# from Kitware (http://www.cmake.org) to configure the build.
|
||||
# This file implements the same rules as configure.mk and thus uses GNU Make
|
||||
# to build the components with support of multiple version (32/64 bit).
|
||||
#
|
||||
# To use these rules, include ../make-rules/cmake.mk in your Makefile
|
||||
# and define "build", "install", and "test" targets appropriate to building
|
||||
# your component.
|
||||
# Ex:
|
||||
#
|
||||
# build: $(SOURCE_DIR)/build/$(MACH32)/.built \
|
||||
# $(SOURCE_DIR)/build/$(MACH64)/.built
|
||||
#
|
||||
# install: $(SOURCE_DIR)/build/$(MACH32)/.installed \
|
||||
# $(SOURCE_DIR)/build/$(MACH64)/.installed
|
||||
#
|
||||
# test: $(SOURCE_DIR)/build/$(MACH32)/.tested \
|
||||
# $(SOURCE_DIR)/build/$(MACH64)/.tested
|
||||
#
|
||||
# Any additional pre/post configure, build, or install actions can be specified
|
||||
# in your make file by setting them in on of the following macros:
|
||||
# COMPONENT_PRE_CMAKE_ACTION, COMPONENT_POST_CMAKE_ACTION
|
||||
# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
|
||||
# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
|
||||
# COMPONENT_PRE_TEST_ACTION, COMPONENT_POST_TEST_ACTION
|
||||
#
|
||||
# If component specific make targets need to be used for build or install, they
|
||||
# can be specified in
|
||||
# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
|
||||
# COMPONENT_TEST_TARGETS
|
||||
#
|
||||
|
||||
CMAKE_PREFIX = /usr
|
||||
|
||||
#
|
||||
# Define path the same way as configure.mk
|
||||
# Ref: http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:GNUInstallDirs
|
||||
#
|
||||
|
||||
ifeq ($(strip $(PREFERRED_BITS)),64)
|
||||
CMAKE_BINDIR.32 = bin/$(MACH32)
|
||||
CMAKE_BINDIR.64 = bin
|
||||
CMAKE_SBINDIR.32 = sbin/$(MACH32)
|
||||
CMAKE_SBINDIR.64 = sbin
|
||||
else
|
||||
CMAKE_BINDIR.32 = bin
|
||||
CMAKE_BINDIR.64 = bin/$(MACH64)
|
||||
CMAKE_SBINDIR.32 = sbin
|
||||
CMAKE_SBINDIR.64 = sbin/$(MACH64)
|
||||
endif
|
||||
CMAKE_LIBDIR.32 = lib
|
||||
CMAKE_LIBDIR.64 = lib/$(MACH64)
|
||||
CMAKE_LIBEXECDIR.32 = lib
|
||||
CMAKE_LIBEXECDIR.64 = lib/$(MACH64)
|
||||
CMAKE_INCLUDEDIR = include
|
||||
CMAKE_DATAROOTDIR = share
|
||||
CMAKE_DATADIR = $(CMAKE_DATAROOTDIR)
|
||||
CMAKE_INFODIR = $(CMAKE_DATAROOTDIR)/info
|
||||
CMAKE_LOCALEDIR = $(CMAKE_DATAROOTDIR)/locale
|
||||
CMAKE_MANDIR = $(CMAKE_DATAROOTDIR)/man
|
||||
CMAKE_DOCDIR = $(CMAKE_DATAROOTDIR)/doc
|
||||
|
||||
CMAKE_ENV = CONFIG_SHELL="$(CONFIG_SHELL)"
|
||||
CMAKE_ENV += CC="$(CC)"
|
||||
CMAKE_ENV += CXX="$(CXX)"
|
||||
CMAKE_ENV += F77="$(F77)"
|
||||
CMAKE_ENV += FC="$(FC)"
|
||||
CMAKE_ENV += CFLAGS="$(CFLAGS)"
|
||||
CMAKE_ENV += CXXFLAGS="$(CXXFLAGS)"
|
||||
CMAKE_ENV += FFLAGS="$(F77FLAGS)"
|
||||
CMAKE_ENV += FCFLAGS="$(FCFLAGS)"
|
||||
CMAKE_ENV += LDFLAGS="$(LDFLAGS)"
|
||||
CMAKE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
|
||||
|
||||
# Rewrite absolute source-code paths into relative for ccache, so that any
|
||||
# workspace with a shared CCACHE_DIR can benefit when compiling a component
|
||||
ifneq ($(strip $(CCACHE)),)
|
||||
CMAKE_ENV += CCACHE="$(CCACHE)"
|
||||
CMAKE_ENV += CC_gcc_32="$(CC_gcc_32)"
|
||||
CMAKE_ENV += CC_gcc_64="$(CC_gcc_32)"
|
||||
CMAKE_ENV += CXX_gcc_32="$(CXX_gcc_64)"
|
||||
CMAKE_ENV += CXX_gcc_64="$(CXX_gcc_64)"
|
||||
CMAKE_ENV.$(BITS) += CCACHE_BASEDIR="$(BUILD_DIR_$(BITS))"
|
||||
|
||||
ifneq ($(strip $(CCACHE_DIR)),)
|
||||
CMAKE_ENV += CCACHE_DIR="$(CCACHE_DIR)"
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(CCACHE_LOGFILE)),)
|
||||
CMAKE_ENV += CCACHE_LOGFILE="$(CCACHE_LOGFILE)"
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
CMAKE_DEFAULT_DIRS?=yes
|
||||
|
||||
CMAKE_OPTIONS += -DCMAKE_C_COMPILER:STRING="$(CC)"
|
||||
CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER:STRING="$(CXX)"
|
||||
CMAKE_OPTIONS += -DCMAKE_Fortran_COMPILER:STRING="$(FC)"
|
||||
CMAKE_OPTIONS += -DCMAKE_C_FLAGS:STRING="$(CFLAGS)"
|
||||
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS:STRING="$(CXXFLAGS)"
|
||||
CMAKE_OPTIONS += -DCMAKE_Fortran_FLAGS:STRING="$(FCFLAGS)"
|
||||
|
||||
CMAKE_OPTIONS += LDFLAGS="$(LDFLAGS)"
|
||||
CMAKE_OPTIONS += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
|
||||
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX:PATH=$(CMAKE_PREFIX)
|
||||
ifeq ($(CMAKE_DEFAULT_DIRS),yes)
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_BINDIR:PATH=$(CMAKE_BINDIR.$(BITS))
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_LIBDIR:PATH=$(CMAKE_LIBDIR.$(BITS))
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_SBINDIR:PATH=$(CMAKE_SBINDIR.$(BITS))
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_DATAROOTDIR:PATH=$(CMAKE_DATAROOTDIR)
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_DATADIR:PATH=$(CMAKE_DATAROOTDIR)
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_INFODIR:PATH=$(CMAKE_INFODIR)
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_LOCALEDIR:PATH=$(CMAKE_LOCALEDIR)
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_MANDIR:PATH=$(CMAKE_MANDIR)
|
||||
|
||||
CMAKE_OPTIONS += -DLIBEXEC_INSTALL_DIR="$(CMAKE_PREFIX)/$(CMAKE_LIBEXECDIR.$(BITS))"
|
||||
|
||||
# Some components use LIB_INSTALL_DIR or CMAKE_INSTALL_LIBDIR, as-is,
|
||||
# others forcibly ignore it and set
|
||||
# based on CMAKE_INSTALL_PREFIX. Those usually instead offer a LIB_SUFFIX
|
||||
# variable that we can generally use to accomplish the same result. Setting
|
||||
# them both shouldn't harm anything.
|
||||
CMAKE_OPTIONS += -DLIB_INSTALL_DIR="$(CMAKE_PREFIX)/$(CMAKE_LIBDIR.$(BITS))"
|
||||
CMAKE_OPTIONS.64 += -DLIB_SUFFIX="/$(MACH64)"
|
||||
endif
|
||||
CMAKE_OPTIONS += $(CMAKE_OPTIONS.$(BITS))
|
||||
|
||||
COMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
|
||||
|
||||
$(BUILD_DIR_32)/.configured: BITS=32
|
||||
$(BUILD_DIR_64)/.configured: BITS=64
|
||||
|
||||
CMAKE_ENV += $(CMAKE_ENV.$(BITS))
|
||||
|
||||
COMPONENT_TEST_CMD=ctest
|
||||
COMPONENT_TEST_TARGETS=
|
||||
|
||||
# configure the unpacked source for building 32 and 64 bit version
|
||||
CMAKE = cmake
|
||||
$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep
|
||||
($(RM) -rf $(@D) ; $(MKDIR) $(@D))
|
||||
$(COMPONENT_PRE_CMAKE_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(CMAKE_ENV) \
|
||||
$(CMAKE) $(CMAKE_OPTIONS) $(SOURCE_DIR))
|
||||
$(COMPONENT_POST_CMAKE_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# build the configured source
|
||||
$(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
|
||||
$(GMAKE) $(COMPONENT_BUILD_GMAKE_ARGS) $(COMPONENT_BUILD_ARGS) \
|
||||
$(COMPONENT_BUILD_TARGETS))
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
-$(PARFAIT) build
|
||||
endif
|
||||
$(TOUCH) $@
|
||||
|
||||
# install the built source into a prototype area
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
|
||||
$(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# test the built source
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
parfait: install
|
||||
-$(PARFAIT) build
|
||||
else
|
||||
parfait:
|
||||
$(MAKE) PARFAIT_BUILD=yes parfait
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
|
||||
46
sample_data/make-rules/common-lisp.mk
Normal file
46
sample_data/make-rules/common-lisp.mk
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#
|
||||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"). You may
|
||||
# only use this file in accordance with the terms of the CDDL.
|
||||
#
|
||||
# A full copy of the text of the CDDL should have accompanied this
|
||||
# source. A copy of the CDDL is also available via the Internet at
|
||||
# http://www.illumos.org/license/CDDL.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
|
||||
#
|
||||
|
||||
#
|
||||
# Rules to install a common lisp library package.
|
||||
#
|
||||
# To use these rules, just include ../make-rules/common-lisp.mk in your
|
||||
# Makefile and define "build" and "install" targets. E.g.,
|
||||
#
|
||||
# build: $(BUILD_32)
|
||||
#
|
||||
# install: $(INSTALL_32)
|
||||
#
|
||||
# Since common lisp libraries are all source code, there is no need for
|
||||
# BUILD_64 and INSTALL_64.
|
||||
|
||||
INSTALL_DIR = $(PROTOCLDIR)/source/$(COMPONENT_NAME)
|
||||
|
||||
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
|
||||
$(MKDIR) $(@D)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(MKDIR) $(PROTOCLDIR)
|
||||
$(MKDIR) $(PROTOCLDIR)/source
|
||||
$(MKDIR) $(PROTOCLDIR)/systems
|
||||
$(MKDIR) $(INSTALL_DIR)
|
||||
$(CP) -a $(SOURCE_DIR)/* $(INSTALL_DIR)
|
||||
(cd $(PROTOCLDIR)/systems; \
|
||||
$(RM) $(COMPONENT_NAME).asd; \
|
||||
$(LN) -s ../source/$(COMPONENT_NAME)/$(COMPONENT_NAME).asd)
|
||||
$(TOUCH) $@
|
||||
|
||||
clean::
|
||||
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
|
||||
191
sample_data/make-rules/common.mk
Normal file
191
sample_data/make-rules/common.mk
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# This file sets up the standard, default options and base requirements for
|
||||
# userland components.
|
||||
#
|
||||
|
||||
include $(WS_MAKE_RULES)/prep.mk
|
||||
|
||||
# Override this to limit builds and publication to a single architecture.
|
||||
BUILD_ARCH ?= $(MACH)
|
||||
ifneq ($(strip $(BUILD_ARCH)),$(MACH))
|
||||
PUBLISH_STAMP=
|
||||
|
||||
target-na:
|
||||
@echo "Not available for $(MACH)"
|
||||
|
||||
BUILD_TARGET ?= target-na
|
||||
INSTALL_TARGET ?= target-na
|
||||
TEST_TARGET ?= target-na
|
||||
SYSTEM_TEST_TARGET ?= target-na
|
||||
endif
|
||||
|
||||
# Assume components use a configure script-style build by default.
|
||||
BUILD_STYLE ?= configure
|
||||
# If not an archive build (i.e. extract and copy) or pkg build (publish only),
|
||||
# include relevant makefile.
|
||||
ifneq ($(strip $(BUILD_STYLE)),archive)
|
||||
ifneq ($(strip $(BUILD_STYLE)),pkg)
|
||||
include $(WS_MAKE_RULES)/$(strip $(BUILD_STYLE)).mk
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(BUILD_STYLE)),configure)
|
||||
# Assume these items should always be set in the configure environment. strip
|
||||
# is used to work around potential problems with extra blank characters
|
||||
# inserted into strings during nested configure invocations within builds for
|
||||
# components such as gdb.
|
||||
ifneq ($(strip $(CFLAGS)),)
|
||||
# Only if provided.
|
||||
CONFIGURE_ENV += CFLAGS="$(strip $(CFLAGS))"
|
||||
endif
|
||||
ifneq ($(strip $(CXXFLAGS)),)
|
||||
# Only if provided.
|
||||
CONFIGURE_ENV += CXXFLAGS="$(strip $(CXXFLAGS))"
|
||||
endif
|
||||
# Always process LDFLAGS.
|
||||
CONFIGURE_ENV += LDFLAGS="$(strip $(LDFLAGS))"
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(BUILD_STYLE)),justmake)
|
||||
# Assume these items should always be set in the build environment.
|
||||
COMPONENT_BUILD_ENV += CC="$(CC)"
|
||||
COMPONENT_BUILD_ENV += CXX="$(CXX)"
|
||||
ifneq ($(strip $(CFLAGS)),)
|
||||
# Only if provided.
|
||||
COMPONENT_BUILD_ENV += CFLAGS="$(strip $(CFLAGS))"
|
||||
endif
|
||||
ifneq ($(strip $(CXXFLAGS)),)
|
||||
# Only if provided.
|
||||
COMPONENT_BUILD_ENV += CXXFLAGS="$(strip $(CXXFLAGS))"
|
||||
endif
|
||||
# Always process LDFLAGS.
|
||||
COMPONENT_BUILD_ENV += LDFLAGS="$(strip $(LDFLAGS))"
|
||||
endif
|
||||
|
||||
# Assume components built with ant do not need ASLR.
|
||||
ifeq ($(strip $(BUILD_STYLE)),ant)
|
||||
ASLR_MODE= $(ASLR_NOT_APPLICABLE)
|
||||
else
|
||||
ifeq ($(strip $(DEFAULT_ASLR_ENABLE)),yes)
|
||||
# Enable ASLR by default unless target build is NO_ARCH.
|
||||
ifneq ($(strip $(BUILD_BITS)),NO_ARCH)
|
||||
ASLR_MODE= $(ASLR_ENABLE)
|
||||
endif # DEFAULT_ASLR_ENABLE yes
|
||||
endif # BUILD_BITS NO_ARCH
|
||||
endif # BUILD_STYLE ant
|
||||
|
||||
# Default targets; to omit a specific target, explicitly set the related target
|
||||
# variable to empty before including this file or set COMMON_TARGETS=no.
|
||||
COMMON_TARGETS ?= yes
|
||||
|
||||
ifneq ($(strip $(COMMON_TARGETS)),no)
|
||||
# For ant-based build style, assume that install is provided by simply building
|
||||
# the component and that no tests are available.
|
||||
ifeq ($(strip $(BUILD_STYLE)),ant)
|
||||
INSTALL_TARGET ?= build
|
||||
TEST_TARGET ?= $(NO_TESTS)
|
||||
SYSTEM_TEST_TARGET ?= $(NO_TESTS)
|
||||
endif
|
||||
|
||||
# For archive-based build style, assume that the build, install, and test
|
||||
# targets will be provided.
|
||||
ifeq ($(strip $(BUILD_STYLE)),archive)
|
||||
BUILD_TARGET ?=
|
||||
INSTALL_TARGET ?=
|
||||
TEST_TARGET ?=
|
||||
endif
|
||||
|
||||
# For pkg-based build style, assume there are no build, install, or test steps;
|
||||
# just a package to be published.
|
||||
ifeq ($(strip $(BUILD_STYLE)),pkg)
|
||||
BUILD_TARGET=
|
||||
INSTALL_TARGET=
|
||||
TEST_TARGET=
|
||||
SYSTEM_TEST_TARGET=
|
||||
build install:
|
||||
test system-test: $(NO_TESTS)
|
||||
endif
|
||||
|
||||
# If TEST_TARGET is NO_TESTS, assume no system tests by default.
|
||||
ifeq ($(strip $(TEST_TARGET)),$(NO_TESTS))
|
||||
SYSTEM_TEST_TARGET ?= $(NO_TESTS)
|
||||
endif
|
||||
|
||||
# If TEST_TARGET is SKIP_TEST, assume system tests are skipped by default.
|
||||
ifeq ($(strip $(TEST_TARGET)),$(SKIP_TEST))
|
||||
SYSTEM_TEST_TARGET ?= $(SKIP_TEST)
|
||||
endif
|
||||
|
||||
# Otherwise, attempt to define common targets assuming defaults.
|
||||
BUILD_TARGET ?= $(BUILD_$(MK_BITS))
|
||||
ifneq ($(strip $(BUILD_TARGET)),)
|
||||
build: $(BUILD_TARGET)
|
||||
endif
|
||||
|
||||
INSTALL_TARGET ?= $(INSTALL_$(MK_BITS))
|
||||
ifneq ($(strip $(INSTALL_TARGET)),)
|
||||
install: $(INSTALL_TARGET)
|
||||
endif
|
||||
|
||||
TEST_TARGET ?= $(TEST_$(MK_BITS))
|
||||
ifneq ($(strip $(TEST_TARGET)),)
|
||||
test: $(TEST_TARGET)
|
||||
endif
|
||||
|
||||
# For the system-test target, assume that none have been implemented.
|
||||
SYSTEM_TEST_TARGET ?= $(SYSTEM_TESTS_NOT_IMPLEMENTED)
|
||||
ifneq ($(strip $(SYSTEM_TEST_TARGET)),)
|
||||
system-test: $(SYSTEM_TEST_TARGET)
|
||||
endif
|
||||
endif # COMMON_TARGETS
|
||||
|
||||
# Always needed; every component builds packages.
|
||||
include $(WS_MAKE_RULES)/ips.mk
|
||||
|
||||
# Determine if we should automatically add files directory to PKG_PROTO_DIRS.
|
||||
ifeq ($(wildcard files),files)
|
||||
PKG_PROTO_DIRS += $(COMPONENT_DIR)/files
|
||||
endif
|
||||
|
||||
# Add bit and mach-specific logic to general actions.
|
||||
COMPONENT_PRE_CONFIGURE_ACTION += $(COMPONENT_PRE_CONFIGURE_ACTION.$(BITS))
|
||||
COMPONENT_PRE_CONFIGURE_ACTION += $(COMPONENT_PRE_CONFIGURE_ACTION.$(MACH))
|
||||
COMPONENT_POST_CONFIGURE_ACTION += $(COMPONENT_POST_CONFIGURE_ACTION.$(BITS))
|
||||
COMPONENT_POST_CONFIGURE_ACTION += $(COMPONENT_POST_CONFIGURE_ACTION.$(MACH))
|
||||
COMPONENT_PRE_BUILD_ACTION += $(COMPONENT_PRE_BUILD_ACTION.$(BITS))
|
||||
COMPONENT_PRE_BUILD_ACTION += $(COMPONENT_PRE_BUILD_ACTION.$(MACH))
|
||||
COMPONENT_POST_BUILD_ACTION += $(COMPONENT_POST_BUILD_ACTION.$(BITS))
|
||||
COMPONENT_POST_BUILD_ACTION += $(COMPONENT_POST_BUILD_ACTION.$(MACH))
|
||||
COMPONENT_PRE_INSTALL_ACTION += $(COMPONENT_PRE_INSTALL_ACTION.$(BITS))
|
||||
COMPONENT_PRE_INSTALL_ACTION += $(COMPONENT_PRE_INSTALL_ACTION.$(MACH))
|
||||
COMPONENT_POST_INSTALL_ACTION += $(COMPONENT_POST_INSTALL_ACTION.$(BITS))
|
||||
COMPONENT_POST_INSTALL_ACTION += $(COMPONENT_POST_INSTALL_ACTION.$(MACH))
|
||||
COMPONENT_PRE_TEST_ACTION += $(COMPONENT_PRE_TEST_ACTION.$(BITS))
|
||||
COMPONENT_PRE_TEST_ACTION += $(COMPONENT_PRE_TEST_ACTION.$(MACH))
|
||||
COMPONENT_POST_TEST_ACTION += $(COMPONENT_POST_TEST_ACTION.$(BITS))
|
||||
COMPONENT_POST_TEST_ACTION += $(COMPONENT_POST_TEST_ACTION.$(MACH))
|
||||
56
sample_data/make-rules/component-report
Normal file
56
sample_data/make-rules/component-report
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
PKG_REPORTS=$(CANONICAL_MANIFESTS:%.p5m=$(BUILD_DIR)/%.pkg-report)
|
||||
|
||||
HGWEB_BASE_URL = http://userland.us.oracle.com/hg/file/tip/
|
||||
ARIA_BASE_URL = http://people.us.oracle.com/pls/oracle/find_person?p_string=
|
||||
ARC_BASE_URL = http://psarc.us.oracle.com/
|
||||
BUGDB_URL = http://userland.us.oracle.com/bugdb?cat-subcat=
|
||||
|
||||
REPORT_TRANSFORMS = $(WS_TOP)/transforms/report
|
||||
CDIR=$(COMPONENT_DIR:$(WS_TOP)/%=%)
|
||||
|
||||
component-report: $(BUILD_DIR)/component-report
|
||||
|
||||
$(BUILD_DIR)/component-report: $(BUILD_DIR)/package-info
|
||||
@echo "<tr>" >$@
|
||||
@echo "<td><a href='$(COMPONENT_PROJECT_URL)'>$(COMPONENT_NAME)</a></td>" >>$@
|
||||
@echo "<td><a href='$(COMPONENT_ARCHIVE_URL)'>$(COMPONENT_VERSION)</a></td>" >>$@
|
||||
@echo "<td><a href='$(HGWEB_BASE_URL)$(CDIR)'>$(CDIR)</a></td>" >>$@
|
||||
@echo "<td>" >>$@ ; for pkg in $(PACKAGE) ; do \
|
||||
echo "$$pkg<br>" >>$@ ; \
|
||||
done ; echo "</td>" >>$@
|
||||
@echo "<td>" >>$@ ; for arc in $(ARC_CASE) ; do \
|
||||
echo "<a href='$(ARC_BASE_URL)$$arc'>$$arc</a><br>" >>$@ ; \
|
||||
done ; echo "</td>" >>$@
|
||||
@echo "<td>" >>$@ ; for license in $(LICENSE) ; do \
|
||||
echo "$$license<br>" >>$@ ; \
|
||||
done ; echo "</td>" >>$@
|
||||
@echo "<td>$(TPNO)</td>" >>$@
|
||||
@echo "<td>" >>$@ ; for bugdb in $(COMPONENT_BUGDB) ; do \
|
||||
echo "<a href='$(BUGDB_URL)$$bugdb'>$$bugdb</a><br>" >>$@ ; \
|
||||
done ; echo "</td>" >>$@
|
||||
@echo "<td><a href='$(ARIA_BASE_URL)$(RESPONSIBLE_ENGINEER)'>$(RESPONSIBLE_ENGINEER)</a></td>" >>$@
|
||||
@echo "<td><a href='$(ARIA_BASE_URL)$(RESPONSIBLE_MANAGER)'>$(RESPONSIBLE_MANAGER)</a></td>" >>$@
|
||||
@echo "<td>$(TEAM)</td>" >>$@
|
||||
@echo "</tr>" >>$@
|
||||
|
||||
$(BUILD_DIR)/package-info: $(PKG_REPORTS)
|
||||
@cat $(PKG_REPORTS) | sort -u >$@
|
||||
|
||||
$(BUILD_DIR)/component-info: $(PKG_REPORTS)
|
||||
@echo "COMPONENT_NAME=\"$(COMPONENT_NAME)\"" >$@
|
||||
@echo "COMPONENT_VERSION=\"$(COMPONENT_VERSION)\"" >>$@
|
||||
@echo "COMPONENT_PROJECT_URL=\"$(COMPONENT_PROJECT_URL)\"" >>$@
|
||||
@echo "COMPONENT_ARCHIVE_URL=\"$(COMPONENT_ARCHIVE_URL)\"" >>$@
|
||||
@echo "COMPONENT_DIR=\"$(CDIR)\"" >>$@
|
||||
@echo "TPNO=\"$(TPNO)\"" >>$@
|
||||
@echo "COMPONENT_BUGDB=\"$(COMPONENT_BUGDB)\"" >>$@
|
||||
@echo "RESPONSIBLE_ENGINEER=\"$(RESPONSIBLE_ENGINEER)\"" >>$@
|
||||
@echo "RESPONSIBLE_MANAGER=\"$(RESPONSIBLE_MANAGER)\"" >>$@
|
||||
@echo "TEAM=\"$(TEAM)\"" >>$@
|
||||
|
||||
$(BUILD_DIR)/%.pkg-report: %.p5m $(BUILD_DIR)
|
||||
@$(PKGMOGRIFY) $(PKG_OPTIONS) -P $@ $< \
|
||||
$(REPORT_TRANSFORMS) >/dev/null
|
||||
|
||||
include $(BUILD_DIR)/package-info
|
||||
33
sample_data/make-rules/component.mk
Normal file
33
sample_data/make-rules/component.mk
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
# A simple rule to print the value of any macro. Ex:
|
||||
# $ gmake print-REQUIRED_PACKAGES
|
||||
# Note that some macros are set on a per target basis, so what you see
|
||||
# is not always what you get.
|
||||
print-%:
|
||||
@echo '$(subst ','\'',$*=$($*)) (origin: $(origin $*), flavor: $(flavor $*))'
|
||||
|
||||
# A simple rule to print only the value of any macro.
|
||||
print-value-%:
|
||||
@echo '$(subst ','\'',$($*))'
|
||||
|
||||
# Provide default print package targets for components that do not rely on IPS.
|
||||
# Define them implicitly so that the definitions do not collide with ips.mk
|
||||
define print-package-rule
|
||||
echo $(strip $(PACKAGE_$(1))) | tr ' ' '\n'
|
||||
endef
|
||||
|
||||
|
||||
COMPONENT_TOOL = $(WS_TOOLS)/userland-component
|
||||
|
||||
format:
|
||||
@$(COMPONENT_TOOL) --path $(COMPONENT_DIR);
|
||||
|
||||
update:
|
||||
@if [ "$(VERSION)X" = "X" ]; \
|
||||
then $(COMPONENT_TOOL) --path $(COMPONENT_DIR) --bump; \
|
||||
else $(COMPONENT_TOOL) --path $(COMPONENT_DIR) --bump $(VERSION); \
|
||||
fi;
|
||||
|
||||
update-latest:
|
||||
$(COMPONENT_TOOL) --path $(COMPONENT_DIR) --bump latest;
|
||||
|
||||
249
sample_data/make-rules/configure.mk
Normal file
249
sample_data/make-rules/configure.mk
Normal file
|
|
@ -0,0 +1,249 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright 2011 EveryCity Ltd. All rights reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Rules and Macros for building opens source software that uses configure /
|
||||
# GNU auto* tools to configure their build for the system they are on. This
|
||||
# uses GNU Make to build the components to take advantage of the viewpath
|
||||
# support and build multiple version (32/64 bit) from a shared source.
|
||||
#
|
||||
# To use these rules, include ../make-rules/configure.mk in your Makefile
|
||||
# and define "build", "install", and "test" targets appropriate to building
|
||||
# your component.
|
||||
# Ex:
|
||||
#
|
||||
# build: $(SOURCE_DIR)/build/$(MACH32)/.built \
|
||||
# $(SOURCE_DIR)/build/$(MACH64)/.built
|
||||
#
|
||||
# install: $(SOURCE_DIR)/build/$(MACH32)/.installed \
|
||||
# $(SOURCE_DIR)/build/$(MACH64)/.installed
|
||||
#
|
||||
# test: $(SOURCE_DIR)/build/$(MACH32)/.tested \
|
||||
# $(SOURCE_DIR)/build/$(MACH64)/.tested
|
||||
#
|
||||
# Any additional pre/post configure, build, or install actions can be specified
|
||||
# in your make file by setting them in on of the following macros:
|
||||
# COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION
|
||||
# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
|
||||
# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
|
||||
# COMPONENT_PRE_TEST_ACTION, COMPONENT_POST_TEST_ACTION
|
||||
#
|
||||
# If component specific make targets need to be used for build or install, they
|
||||
# can be specified in
|
||||
# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
|
||||
# COMPONENT_TEST_TARGETS
|
||||
#
|
||||
|
||||
CONFIGURE_PREFIX = /usr
|
||||
|
||||
# If the component prefers 64-bit binaries, then ensure builds deliver 64-bit
|
||||
# binaries to the standard directories and 32-bit binaries to the non-standard
|
||||
# location. This allows simplification of package manifests and makes it
|
||||
# easier to deliver the 64-bit binaries as the default.
|
||||
ifeq ($(strip $(PREFERRED_BITS)),64)
|
||||
CONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/bin/$(MACH32)
|
||||
CONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin
|
||||
CONFIGURE_SBINDIR.32 = $(CONFIGURE_PREFIX)/sbin/$(MACH32)
|
||||
CONFIGURE_SBINDIR.64 = $(CONFIGURE_PREFIX)/sbin
|
||||
else
|
||||
CONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/bin
|
||||
CONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin/$(MACH64)
|
||||
CONFIGURE_SBINDIR.32 = $(CONFIGURE_PREFIX)/sbin
|
||||
CONFIGURE_SBINDIR.64 = $(CONFIGURE_PREFIX)/sbin/$(MACH64)
|
||||
endif
|
||||
|
||||
# Regardless of PREFERRED_BITS, 64-bit libraries should always be delivered to
|
||||
# the appropriate subdirectory by default.
|
||||
CONFIGURE_LIBDIR.32 = $(CONFIGURE_PREFIX)/lib
|
||||
CONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib/$(MACH64)
|
||||
|
||||
CONFIGURE_MANDIR = $(CONFIGURE_PREFIX)/share/man
|
||||
CONFIGURE_LOCALEDIR = $(CONFIGURE_PREFIX)/share/locale
|
||||
# all texinfo documentation seems to go to /usr/share/info no matter what
|
||||
CONFIGURE_INFODIR = /usr/share/info
|
||||
CONFIGURE_INCLUDEDIR = /usr/include
|
||||
|
||||
CONFIGURE_ENV = CONFIG_SHELL="$(CONFIG_SHELL)"
|
||||
CONFIGURE_ENV += CC="$(CC)"
|
||||
CONFIGURE_ENV += CXX="$(CXX)"
|
||||
CONFIGURE_ENV += F77="$(F77)"
|
||||
CONFIGURE_ENV += FC="$(FC)"
|
||||
CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
|
||||
CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
|
||||
CONFIGURE_ENV += FFLAGS="$(F77FLAGS)"
|
||||
CONFIGURE_ENV += FCFLAGS="$(FCFLAGS)"
|
||||
CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
|
||||
CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
|
||||
|
||||
# Rewrite absolute source-code paths into relative for ccache, so that any
|
||||
# workspace with a shared CCACHE_DIR can benefit when compiling a component
|
||||
ifneq ($(strip $(CCACHE)),)
|
||||
CONFIGURE_ENV += CCACHE="$(CCACHE)"
|
||||
CONFIGURE_OPTIONS += CCACHE="$(CCACHE)"
|
||||
CONFIGURE_ENV += CC_gcc_32="$(CC_gcc_32)"
|
||||
CONFIGURE_ENV += CC_gcc_64="$(CC_gcc_32)"
|
||||
CONFIGURE_ENV += CXX_gcc_32="$(CXX_gcc_64)"
|
||||
CONFIGURE_ENV += CXX_gcc_64="$(CXX_gcc_64)"
|
||||
CONFIGURE_OPTIONS += CC_gcc_32="$(CC_gcc_32)"
|
||||
CONFIGURE_OPTIONS += CC_gcc_64="$(CC_gcc_32)"
|
||||
CONFIGURE_OPTIONS += CXX_gcc_32="$(CXX_gcc_64)"
|
||||
CONFIGURE_OPTIONS += CXX_gcc_64="$(CXX_gcc_64)"
|
||||
CONFIGURE_ENV.$(BITS) += CCACHE_BASEDIR="$(BUILD_DIR_$(BITS))"
|
||||
CONFIGURE_OPTIONS.$(BITS) += CCACHE_BASEDIR="$(BUILD_DIR_$(BITS))"
|
||||
|
||||
ifneq ($(strip $(CCACHE_DIR)),)
|
||||
CONFIGURE_ENV += CCACHE_DIR="$(CCACHE_DIR)"
|
||||
CONFIGURE_OPTIONS += CCACHE_DIR="$(CCACHE_DIR)"
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(CCACHE_LOGFILE)),)
|
||||
CONFIGURE_ENV += CCACHE_LOGFILE="$(CCACHE_LOGFILE)"
|
||||
CONFIGURE_OPTIONS += CCACHE_LOGFILE="$(CCACHE_LOGFILE)"
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
CONFIGURE_DEFAULT_DIRS?=yes
|
||||
|
||||
CONFIGURE_OPTIONS += CC="$(CC)"
|
||||
CONFIGURE_OPTIONS += CXX="$(CXX)"
|
||||
CONFIGURE_OPTIONS += F77="$(F77)"
|
||||
CONFIGURE_OPTIONS += FC="$(FC)"
|
||||
CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
|
||||
CONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)"
|
||||
CONFIGURE_OPTIONS += FFLAGS="$(F77FLAGS)"
|
||||
CONFIGURE_OPTIONS += FCFLAGS="$(FCFLAGS)"
|
||||
CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
|
||||
CONFIGURE_OPTIONS += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
|
||||
|
||||
CONFIGURE_OPTIONS += --prefix=$(CONFIGURE_PREFIX)
|
||||
ifeq ($(CONFIGURE_DEFAULT_DIRS),yes)
|
||||
CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
|
||||
CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS))
|
||||
CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))
|
||||
CONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_SBINDIR.$(BITS))
|
||||
endif
|
||||
CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
|
||||
|
||||
COMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
|
||||
|
||||
$(BUILD_DIR_32)/.configured: BITS=32
|
||||
$(BUILD_DIR_64)/.configured: BITS=64
|
||||
|
||||
CONFIGURE_ENV += $(CONFIGURE_ENV.$(BITS))
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
# parfait creates '*.bc' files which can confuse configure's
|
||||
# object/exe extension detection. which we really don't need it
|
||||
# to do anyway, so we'll just tell it what they are.
|
||||
CONFIGURE_ENV += ac_cv_objext=o
|
||||
CONFIGURE_ENV += ac_cv_exeext=""
|
||||
# this is fixed in the clang compiler but we can't use it yet
|
||||
CONFIGURE_ENV += ac_cv_header_stdbool_h=yes
|
||||
endif
|
||||
|
||||
|
||||
# temporarily work around some issues
|
||||
CONFIGURE_ENV += "ac_cv_func_realloc_0_nonnull=yes"
|
||||
COMPONENT_BUILD_ENV += "ac_cv_func_realloc_0_nonnull=yes"
|
||||
|
||||
# configure the unpacked source for building 32 and 64 bit version
|
||||
CONFIGURE_SCRIPT = $(SOURCE_DIR)/configure
|
||||
$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep
|
||||
($(RM) -rf $(@D) ; $(MKDIR) $(@D))
|
||||
$(COMPONENT_PRE_CONFIGURE_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(CONFIGURE_ENV) $(CONFIG_SHELL) \
|
||||
$(CONFIGURE_SCRIPT) $(CONFIGURE_OPTIONS))
|
||||
$(COMPONENT_POST_CONFIGURE_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# build the configured source
|
||||
$(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
|
||||
$(GMAKE) $(COMPONENT_BUILD_GMAKE_ARGS) $(COMPONENT_BUILD_ARGS) \
|
||||
$(COMPONENT_BUILD_TARGETS))
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
-$(PARFAIT) build
|
||||
endif
|
||||
$(TOUCH) $@
|
||||
|
||||
# install the built source into a prototype area
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
|
||||
$(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
CONFIGURE_TEST_TRANSFORMS = \
|
||||
'-n ' \
|
||||
'-e "/TOTAL:/p" ' \
|
||||
'-e "/SKIP:/p" ' \
|
||||
'-e "/PASS:/p" ' \
|
||||
'-e "/FAIL:/p" ' \
|
||||
'-e "/ERROR:/p" '
|
||||
|
||||
USE_DEFAULT_TEST_TRANSFORMS?=no
|
||||
ifeq ($(strip $(USE_DEFAULT_TEST_TRANSFORMS)),yes)
|
||||
COMPONENT_TEST_TRANSFORMS+= $(CONFIGURE_TEST_TRANSFORMS)
|
||||
endif
|
||||
|
||||
# test the built source
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
parfait: install
|
||||
-$(PARFAIT) build
|
||||
else
|
||||
parfait:
|
||||
$(MAKE) PARFAIT_BUILD=yes parfait
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
|
||||
25
sample_data/make-rules/depend.mk
Normal file
25
sample_data/make-rules/depend.mk
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"), version 1.0.
|
||||
# You may only use this file in accordance with the terms of version
|
||||
# 1.0 of the CDDL.
|
||||
#
|
||||
# A full copy of the text of the CDDL should have accompanied this
|
||||
# source. A copy of the CDDL is also available via the Internet at
|
||||
# http://www.illumos.org/license/CDDL.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright 2018 Adam Stevko
|
||||
#
|
||||
|
||||
print-required-packages::
|
||||
@for package in $(REQUIRED_PACKAGES) ; do \
|
||||
echo $$package ; \
|
||||
done | LANG=C LC_ALL=C sort -u
|
||||
|
||||
# update the metadata for current component
|
||||
update-metadata:
|
||||
@echo "generating metadata: $(CURDIR:$(WS_TOP)/components/%=%)"
|
||||
@$(BASS_O_MATIC) --workspace=$(WS_TOP) --pkg5
|
||||
|
||||
24
sample_data/make-rules/encumbered.mk
Normal file
24
sample_data/make-rules/encumbered.mk
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"), version 1.0.
|
||||
# You may only use this file in accordance with the terms of version
|
||||
# 1.0 of the CDDL.
|
||||
#
|
||||
# A full copy of the text of the CDDL should have accompanied this
|
||||
# source. A copy of the CDDL is also available via the Internet at
|
||||
# http://www.illumos.org/license/CDDL.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright 2015 Alexander Pyhalov
|
||||
#
|
||||
|
||||
WS_REPO = $(WS_TOP)/$(MACH)/encumbered-repo
|
||||
|
||||
COMPONENT_PKGLINT_ENV += ENCUMBERED=true
|
||||
|
||||
PUBLISHER = hipster-encumbered
|
||||
|
||||
BASS_O_MATIC = $(WS_TOOLS)/bass-o-matic --subdir=components/encumbered
|
||||
|
||||
ENCUMBERED = encumbered/
|
||||
119
sample_data/make-rules/environment.mk
Normal file
119
sample_data/make-rules/environment.mk
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, Adam Stevko
|
||||
#
|
||||
|
||||
PFEXEC = /usr/bin/pfexec
|
||||
|
||||
ZONE = $(WS_TOOLS)/userland-zone
|
||||
|
||||
define separator-line
|
||||
@$(PYTHON) -c 'l="="*int(40-len("$1")/2); print("%s%s%s" % (l, "$1", l))'
|
||||
endef
|
||||
|
||||
component-environment-check::
|
||||
$(call separator-line,Workspace)
|
||||
@echo " Path: $(WS_TOP)"
|
||||
@echo " Branch: $$(git rev-parse --abbrev-ref HEAD)"
|
||||
@echo " Changeset: $$(git rev-parse HEAD)"
|
||||
$(call separator-line,System)
|
||||
@/usr/bin/uname -a
|
||||
@echo "Zone: $$(/usr/bin/zonename)"
|
||||
@echo "Zone IP type: $$(/usr/bin/zonename -t)"
|
||||
@/usr/sbin/psrinfo -vp
|
||||
@/usr/sbin/ipadm show-addr
|
||||
$(call separator-line,Required Packages)
|
||||
@/usr/bin/pkg list -vH $(USERLAND_REQUIRED_PACKAGES:%=/%) $(REQUIRED_PACKAGES:%=/%)
|
||||
$(call separator-line)
|
||||
|
||||
component-environment-prep::
|
||||
@/usr/bin/pkg list -vH $(USERLAND_REQUIRED_PACKAGES:%=/%) $(REQUIRED_PACKAGES:%=/%) >/dev/null || \
|
||||
{ echo "Adding required packages to build environment..."; \
|
||||
RETVAL=7 ; \
|
||||
while [ $$RETVAL -eq 7 ] ; do \
|
||||
$(PFEXEC) /usr/bin/pkg install --accept -v $(REQUIRED_PACKAGES:%=/%) ; \
|
||||
RETVAL=$$? ; \
|
||||
if [ $$RETVAL -eq 4 ] || [ -z $$RETVAL ]; then break; fi; \
|
||||
sleep 10; \
|
||||
done; }
|
||||
ZONENAME_PREFIX = bz
|
||||
ZONENAME_ID = $(shell echo "$(WS_TOP)" | sha1sum | cut -c0-7)-$(COMPONENT_NAME)
|
||||
ZONENAME = $(ZONENAME_PREFIX)-$(ZONENAME_ID)
|
||||
|
||||
component-zone-template:
|
||||
$(call separator-line)
|
||||
$(call separator-line,Create template zone)
|
||||
USER_ID=$$(id -u) && \
|
||||
$(PFEXEC) $(ZONE) --prefix $(ZONENAME_PREFIX) create-template -u $${USER} -i $${USER_ID}
|
||||
|
||||
component-zone-build:
|
||||
$(call separator-line)
|
||||
$(call separator-line,Create $(ZONENAME))
|
||||
$(PFEXEC) $(ZONE) --prefix $(ZONENAME_PREFIX) spawn-zone --id $(ZONENAME_ID)
|
||||
$(call separator-line,Boot $(ZONENAME))
|
||||
@while $$(true); do \
|
||||
echo "Waiting for zone $(ZONENAME) to boot..."; \
|
||||
$(PFEXEC) /usr/sbin/zlogin -l $${USER} $(ZONENAME) \
|
||||
/bin/true >/dev/null 2>&1 && break; \
|
||||
sleep 10; \
|
||||
done
|
||||
# FIXME:
|
||||
# - remove once we figure out a better way how to enable zoneproxy-client inside the nlipkg brand
|
||||
@while $$(true); do \
|
||||
echo "Waiting for $(ZONENAME) config repository.."; \
|
||||
$(PFEXEC) /usr/bin/svcs -z $(ZONENAME) -a >/dev/null 2>&1 && break; \
|
||||
sleep 10; \
|
||||
done
|
||||
# We need to create door inside after zone-proxy-client is running
|
||||
$(call separator-line,Configure IPS for $(ZONENAME))
|
||||
$(PFEXEC) /usr/lib/zones/zoneproxy-adm $(ZONENAME)
|
||||
@while $$(true); do \
|
||||
echo "Waiting for zoneproxyd to be ready.."; \
|
||||
PROXY_PID=$$(/usr/bin/svcs -p svc:/application/pkg/zones-proxyd:default | \
|
||||
nawk '$$0 ~ /zoneproxyd/ {print $$2}') && \
|
||||
$(PFEXEC) /usr/bin/pfiles $${PROXY_PID} | \
|
||||
$(GNU_GREP) $(ZONENAME) >/dev/null 2>&1 && break; \
|
||||
sleep 10; \
|
||||
done
|
||||
$(PFEXEC) /usr/sbin/svcadm -z $(ZONENAME) \
|
||||
enable svc:/application/pkg/zones-proxy-client:default
|
||||
ZONEROOT="$$(/usr/sbin/zoneadm -z $(ZONENAME) list -p | cut -d: -f4)/root" && \
|
||||
$(PFEXEC) /usr/bin/pkg -R $${ZONEROOT} set-property use-system-repo True && \
|
||||
while $$(true); do \
|
||||
echo "Waiting for sysrepo to be ready..." && \
|
||||
$(PFEXEC) /usr/bin/pkg -R $${ZONEROOT} publisher | \
|
||||
$(GNU_GREP) syspub >/dev/null 2>&1 && break; \
|
||||
sleep 10; \
|
||||
done
|
||||
$(call separator-line,Build in $(ZONENAME))
|
||||
$(PFEXEC) /usr/sbin/zlogin -l $${USER} $(ZONENAME) \
|
||||
"cd $(COMPONENT_DIR); gmake install"
|
||||
$(call separator-line)
|
||||
|
||||
component-zone-cleanup:
|
||||
$(PFEXEC) $(ZONE) destroy-zone --id $(ZONENAME_ID)
|
||||
|
||||
# Short aliases for user convenience
|
||||
env-check:: component-environment-check
|
||||
env-prep:: component-environment-prep
|
||||
201
sample_data/make-rules/font.mk
Normal file
201
sample_data/make-rules/font.mk
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, Aurelien Larcher. All rights reserved.
|
||||
#
|
||||
BUILD_BITS ?= NO_ARCH
|
||||
BUILD_STYLE ?= archive
|
||||
|
||||
ifneq ($(findstring X11,$(FONT_TYPE)),)
|
||||
X11_CATEGORY = FONT
|
||||
include $(WS_MAKE_RULES)/x11.mk
|
||||
endif
|
||||
|
||||
include $(WS_MAKE_RULES)/common.mk
|
||||
|
||||
MKFONTSCALE = mkfontscale
|
||||
MKFONTDIR = mkfontdir
|
||||
|
||||
ETCFONTSDIR = $(ETCDIR)/fonts
|
||||
ETCFONTSCONFDIR = $(ETCFONTSDIR)/conf.avail
|
||||
USRSHAREFONTSDIR = $(USRSHAREDIR)/fonts
|
||||
|
||||
#
|
||||
# Font type macros
|
||||
#
|
||||
|
||||
TTFFONTDIR = TrueType
|
||||
OTFFONTDIR = OpenType
|
||||
X11FONTDIR = X11
|
||||
X11MISCFONTDIR = X11
|
||||
PKGFONTDIR?= $($(FONT_TYPE)FONTDIR)
|
||||
|
||||
# For compatibility
|
||||
USRSHARETTFFONTSDIR = $(USRSHAREFONTSDIR)/$(TTFFONTDIR)
|
||||
USRSHAREOTFFONTSDIR = $(USRSHAREFONTSDIR)/$(OTFFONTDIR)
|
||||
USRSHAREX11FONTSDIR = $(USRSHAREFONTSDIR)/$(X11FONTDIR)
|
||||
|
||||
TTFFONTSRC = ttf
|
||||
OTFFONTSRC = otf
|
||||
X11FONTSRC =
|
||||
X11MISCFONTSRC =
|
||||
PKGFONTSRC?= $($(FONT_TYPE)FONTSRC)
|
||||
|
||||
TTFFONTCLS = truetype
|
||||
OTFFONTCLS = opentype
|
||||
X11FONTCLS = xorg
|
||||
X11MISCFONTCLS =
|
||||
PKGFONTCLS?= $($(FONT_TYPE)FONTCLS)
|
||||
|
||||
TTFFONTEXT = *.ttc *.tte *.ttf
|
||||
OTFFONTEXT = *.otf *.otc *.ttf *.ttc
|
||||
X11FONTEXT = *.pcf
|
||||
X11MISCFONTEXT = *.pcf
|
||||
PKGFONTEXT?= $($(FONT_TYPE)FONTEXT)
|
||||
|
||||
PKGFONTCONFSRC = fontconfig
|
||||
PKGFONTCONFEXT = *.conf
|
||||
|
||||
#
|
||||
# Proto area directories
|
||||
#
|
||||
|
||||
PROTOFONTSDIR = $(PROTO_DIR)$(USRSHAREFONTSDIR)
|
||||
PROTOTTFFONTSDIR = $(PROTOFONTSDIR)/$(TTFFONTDIR)
|
||||
PROTOOTFFONTSDIR = $(PROTOFONTSDIR)/$(OTFFONTDIR)
|
||||
PROTOX11FONTSDIR = $(PROTOFONTSDIR)/$(X11FONTDIR)
|
||||
PROTOPKGFONTSDIR = $(PROTO$(FONT_TYPE)FONTSDIR)
|
||||
|
||||
PROTOFONTSCONFDIR = $(PROTO_DIR)$(ETCFONTSCONFDIR)
|
||||
|
||||
#
|
||||
# Default macros
|
||||
#
|
||||
|
||||
COMPONENT_FONT_TYPE = $(PKGFONTCLS)
|
||||
COMPONENT_FONT_NAME = $(COMPONENT_NAME)
|
||||
COMPONENT_FONT_PKG = $(COMPONENT_NAME)
|
||||
ifeq ($(strip $(COMPONENT_FONT_TYPE)),)
|
||||
COMPONENT_FMRI = \
|
||||
system/font/$(strip $(COMPONENT_FONT_PKG))
|
||||
else
|
||||
COMPONENT_FMRI = \
|
||||
system/font/$(strip $(COMPONENT_FONT_TYPE))/$(strip $(COMPONENT_FONT_PKG))
|
||||
endif
|
||||
COMPONENT_CLASSIFICATION = System/Fonts
|
||||
COMPONENT_CATEGORY = font
|
||||
|
||||
COMPONENT_FONT_DEST_DIR?= $(USRSHAREFONTSDIR)/$(PKGFONTDIR)/$(COMPONENT_FONT_NAME)
|
||||
COMPONENT_FONT_SRC_DIR ?= $(PKGFONTSRC)
|
||||
COMPONENT_FONT_FILES =
|
||||
|
||||
COMPONENT_FONTCONF_DEST_DIR?= $(ETCFONTSCONFDIR)
|
||||
COMPONENT_FONTCONF_SRC_DIR ?= $(PKGFONTCONFSRC)
|
||||
COMPONENT_FONTCONF_FILES = $(PKGFONTCONFEXT)
|
||||
|
||||
#
|
||||
# Build style specific rules
|
||||
#
|
||||
|
||||
ifeq ($(strip $(BUILD_STYLE)),archive)
|
||||
|
||||
POST_INSTALL_MKFONT?=no
|
||||
|
||||
COMPONENT_BUILD_ACTION?= true
|
||||
ifeq ($(strip $(POST_INSTALL_MKFONT)),no)
|
||||
COMPONENT_BUILD_ACTION = \
|
||||
cd $(@D)/$(COMPONENT_FONT_SRC_DIR); $(MKFONTSCALE); $(MKFONTDIR);
|
||||
endif
|
||||
|
||||
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
|
||||
($(RM) -rf $(@D) ; $(MKDIR) $(@D))
|
||||
$(CLONEY) $(SOURCE_DIR) $(@D)
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
($(COMPONENT_BUILD_ACTION))
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
build: $(BUILD_$(MK_BITS))
|
||||
|
||||
COMPONENT_FONT_POST_INSTALL_ACTION = \
|
||||
( $(MKFONTSCALE) $(PROTO_DIR)$(COMPONENT_FONT_DEST_DIR); \
|
||||
$(MKFONTDIR) $(PROTO_DIR)$(COMPONENT_FONT_DEST_DIR) )
|
||||
|
||||
ifeq ($(strip $(POST_INSTALL_MKFONT)),yes)
|
||||
COMPONENT_POST_INSTALL_ACTION+=$(COMPONENT_FONT_POST_INSTALL_ACTION)
|
||||
else
|
||||
COMPONENT_FONT_FILES += fonts.dir
|
||||
COMPONENT_FONT_FILES += fonts.scale
|
||||
endif
|
||||
|
||||
COMPONENT_INSTALL_ACTION = \
|
||||
cd $(@D)/$(COMPONENT_FONT_SRC_DIR) && \
|
||||
$(INSTALL) -m 0444 $(COMPONENT_FONT_FILES) \
|
||||
$(PROTO_DIR)$(COMPONENT_FONT_DEST_DIR) ; \
|
||||
if [ -n "$(strip $(COMPONENT_FONTCONF_FILES))" ]; \
|
||||
then \
|
||||
cd $(@D)/$(COMPONENT_FONTCONF_SRC_DIR) && \
|
||||
$(INSTALL) -m 0444 $(COMPONENT_FONTCONF_FILES) \
|
||||
$(PROTO_DIR)$(COMPONENT_FONTCONF_DEST_DIR) ; \
|
||||
fi;
|
||||
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(MKDIR) $(@D)
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
-$(RM) -r $(PROTO_DIR)$(COMPONENT_FONT_DEST_DIR)
|
||||
$(MKDIR) $(PROTO_DIR)$(COMPONENT_FONT_DEST_DIR)
|
||||
$(MKDIR) $(PROTO_DIR)$(COMPONENT_FONTCONF_DEST_DIR)
|
||||
($(COMPONENT_INSTALL_ACTION))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
install: $(INSTALL_$(MK_BITS))
|
||||
|
||||
clean::
|
||||
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(BUILD_STYLE)),configure)
|
||||
# We don't compress individual font files so that we get better compression
|
||||
# at higher levels in ZFS & IPS, and so that we aren't constantly replacing
|
||||
# font files in every build just because the timestamp in the compressed
|
||||
# version changed.
|
||||
CONFIGURE_OPTIONS += --without-compression
|
||||
endif
|
||||
|
||||
# Add font metadata to packages to make it easier to search for fonts
|
||||
$(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.mogrified): PUBLISH_TRANSFORMS += $(@:.mogrified=.font-transforms)
|
||||
|
||||
$(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.mogrified): font-transforms
|
||||
font-transforms: $(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.font-transforms)
|
||||
|
||||
$(MANIFEST_BASE)-%.font-transforms: %.p5m
|
||||
$(PERL) $(WS_TOOLS)/generate_font_metadata.pl \
|
||||
-p $(PROTO_DIR) -m $< > $@ || ( rm $@ ; exit 1 )
|
||||
|
||||
# Package containing fc-scan used in generate_font_metadata.pl
|
||||
REQUIRED_PACKAGES += system/library/fontconfig
|
||||
# Package containing $(MKFONTSCALE) & $(MKFONTDIR)
|
||||
REQUIRED_PACKAGES += x11/font-utilities
|
||||
|
||||
208
sample_data/make-rules/gcc-component.mk
Normal file
208
sample_data/make-rules/gcc-component.mk
Normal file
|
|
@ -0,0 +1,208 @@
|
|||
#
|
||||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"). You may
|
||||
# only use this file in accordance with the terms of the CDDL.
|
||||
#
|
||||
# A full copy of the text of the CDDL should have accompanied this
|
||||
# source. A copy of the CDDL is also available via the Internet at
|
||||
# http://www.illumos.org/license/CDDL.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright 2019 Aurelien Larcher
|
||||
#
|
||||
|
||||
GCC_COMPONENT_VERSION_MAJOR = $(shell echo $(COMPONENT_VERSION) | $(NAWK) -F. '{print $$1}')
|
||||
|
||||
ifeq ($(strip $(ILLUMOS_GCC_REVISION)),)
|
||||
GCC_COMPONENT_STRING_VERSION = $(COMPONENT_VERSION)-oi-$(COMPONENT_REVISION)
|
||||
else
|
||||
GCC_COMPONENT_STRING_VERSION = $(COMPONENT_VERSION)-il-$(ILLUMOS_GCC_REVISION)
|
||||
endif
|
||||
|
||||
GCC_COMPONENT_PREFIX = /usr/gcc/$(GCC_COMPONENT_VERSION_MAJOR)
|
||||
|
||||
#
|
||||
# Define default component variables for upstream GCC
|
||||
#
|
||||
ifeq ($(strip $(COMPONENT_VERSION)),)
|
||||
$(error Empty GCC version)
|
||||
endif
|
||||
ifeq ($(strip $(COMPONENT_ARCHIVE_HASH)),)
|
||||
$(error Empty GCC archive hash)
|
||||
endif
|
||||
COMPONENT_NAME= gcc
|
||||
COMPONENT_FMRI= developer/gcc-$(GCC_COMPONENT_VERSION_MAJOR)
|
||||
COMPONENT_SUMMARY= GNU Compiler Collection
|
||||
COMPONENT_CLASSIFICATION= Development/C
|
||||
COMPONENT_PROJECT_URL = https://gcc.gnu.org/
|
||||
COMPONENT_SRC ?= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
|
||||
COMPONENT_ARCHIVE ?= $(COMPONENT_SRC).tar.xz
|
||||
COMPONENT_ARCHIVE_URL ?= \
|
||||
https://ftp.gnu.org/gnu/gcc/gcc-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
|
||||
|
||||
PATCH_EACH_ARCHIVE=1
|
||||
PATCHDIR_PATCHES = $(shell find $(PATCH_DIR) -type f -name '$(PATCH_PATTERN)' \
|
||||
2>/dev/null | sort)
|
||||
|
||||
MPFR_NAME= mpfr
|
||||
ifeq ($(strip $(MPFR_VERSION)),)
|
||||
$(error Empty MPFR version)
|
||||
endif
|
||||
ifeq ($(strip $(MPFR_ARCHIVE_HASH)),)
|
||||
$(error Empty MPFR archive hash)
|
||||
endif
|
||||
COMPONENT_SRC_1= $(MPFR_NAME)-$(MPFR_VERSION)
|
||||
COMPONENT_ARCHIVE_1= $(COMPONENT_SRC_1).tar.bz2
|
||||
COMPONENT_ARCHIVE_URL_1= https://www.mpfr.org/$(COMPONENT_SRC_1)/$(COMPONENT_ARCHIVE_1)
|
||||
COMPONENT_ARCHIVE_HASH_1= $(MPFR_ARCHIVE_HASH)
|
||||
CLEAN_PATHS += $(COMPONENT_SRC_1)
|
||||
COMPONENT_POST_UNPACK_ACTION_1 += ( $(RM) -r $(COMPONENT_SRC)/$(MPFR_NAME) && $(CP) -rpP $(COMPONENT_SRC_1) $(COMPONENT_SRC)/$(MPFR_NAME) )
|
||||
|
||||
MPC_NAME=mpc
|
||||
ifeq ($(strip $(MPC_VERSION)),)
|
||||
$(error Empty MPC version)
|
||||
endif
|
||||
ifeq ($(strip $(MPC_ARCHIVE_HASH)),)
|
||||
$(error Empty MPC archive hash)
|
||||
endif
|
||||
COMPONENT_SRC_2= $(MPC_NAME)-$(MPC_VERSION)
|
||||
COMPONENT_ARCHIVE_2= $(COMPONENT_SRC_2).tar.gz
|
||||
COMPONENT_ARCHIVE_URL_2= https://ftp.gnu.org/gnu/mpc/$(COMPONENT_ARCHIVE_2)
|
||||
COMPONENT_ARCHIVE_HASH_2= $(MPC_ARCHIVE_HASH)
|
||||
CLEAN_PATHS += $(COMPONENT_SRC_2)
|
||||
COMPONENT_POST_UNPACK_ACTION_2 += ( $(RM) -r $(COMPONENT_SRC)/$(MPC_NAME) && $(CP) -rpP $(COMPONENT_SRC_2) $(COMPONENT_SRC)/$(MPC_NAME) )
|
||||
|
||||
GMP_NAME=gmp
|
||||
ifeq ($(strip $(GMP_VERSION)),)
|
||||
$(error Empty GMP version)
|
||||
endif
|
||||
ifeq ($(strip $(GMP_ARCHIVE_HASH)),)
|
||||
$(error Empty GMP archive hash)
|
||||
endif
|
||||
COMPONENT_SRC_3= $(GMP_NAME)-$(GMP_VERSION)
|
||||
COMPONENT_ARCHIVE_3= $(COMPONENT_SRC_3).tar.bz2
|
||||
COMPONENT_ARCHIVE_URL_3= https://ftp.gnu.org/gnu/gmp/$(COMPONENT_ARCHIVE_3)
|
||||
COMPONENT_ARCHIVE_HASH_3= $(GMP_ARCHIVE_HASH)
|
||||
CLEAN_PATHS += $(COMPONENT_SRC_3)
|
||||
COMPONENT_POST_UNPACK_ACTION_3 += ( $(RM) -r $(COMPONENT_SRC)/$(GMP_NAME) && $(CP) -rpP $(COMPONENT_SRC_3) $(COMPONENT_SRC)/$(GMP_NAME) )
|
||||
|
||||
BUILD_STYLE=configure
|
||||
|
||||
include $(WS_MAKE_RULES)/common.mk
|
||||
|
||||
PATH=$(PATH.gnu)
|
||||
|
||||
CC_BITS=
|
||||
CFLAGS= -O2
|
||||
CXXFLAGS= -O2
|
||||
FCFLAGS= -O2
|
||||
|
||||
COMMON_ENV= LD_OPTIONS="-zignore -zcombreloc -i"
|
||||
COMMON_ENV+= LD_FOR_TARGET=/usr/bin/ld
|
||||
COMMON_ENV+= LD_FOR_HOST=/usr/bin/ld
|
||||
COMMON_ENV+= STRIP="/usr/bin/strip -x"
|
||||
COMMON_ENV+= STRIP_FOR_TARGET="/usr/bin/strip -x"
|
||||
COMMON_ENV+= LD=/usr/bin/ld
|
||||
|
||||
CONFIGURE_ENV+= $(COMMON_ENV)
|
||||
COMPONENT_BUILD_ENV+= $(COMMON_ENV)
|
||||
COMPONENT_INSTALL_ENV+= $(COMMON_ENV)
|
||||
|
||||
CONFIGURE_PREFIX=$(GCC_COMPONENT_PREFIX)
|
||||
|
||||
# General options
|
||||
CONFIGURE_OPTIONS+= --sbindir=$(CONFIGURE_BINDIR.$(BITS))
|
||||
CONFIGURE_OPTIONS+= --libdir=$(CONFIGURE_LIBDIR.$(BITS))
|
||||
CONFIGURE_OPTIONS+= --libexecdir=$(CONFIGURE_LIBDIR.$(BITS))
|
||||
CONFIGURE_OPTIONS+= --host $(GNU_TRIPLET)
|
||||
CONFIGURE_OPTIONS+= --build $(GNU_TRIPLET)
|
||||
CONFIGURE_OPTIONS+= --target $(GNU_TRIPLET)
|
||||
#CONFIGURE_OPTIONS+= --with-boot-ldflags=-R$(CONFIGURE_PREFIX)/lib
|
||||
CONFIGURE_OPTIONS+= --with-pkgversion="OpenIndiana $(GCC_COMPONENT_STRING_VERSION)"
|
||||
CONFIGURE_OPTIONS+= --with-bugurl="https://bugs.openindiana.org"
|
||||
|
||||
# Toolchain options
|
||||
CONFIGURE_OPTIONS+= --without-gnu-ld
|
||||
CONFIGURE_OPTIONS+= --with-ld=/usr/bin/ld
|
||||
CONFIGURE_OPTIONS+= --with-build-time-tools=/usr/gnu/$(GNU_TRIPLET)/bin
|
||||
|
||||
# If the compiler used to build matches the compiler being built, there is no
|
||||
# need for a 3 stage build.
|
||||
ifneq ($(shell $(CC) --version | grep $(COMPONENT_VERSION)),)
|
||||
CONFIGURE_OPTIONS += --disable-bootstrap
|
||||
else
|
||||
COMPONENT_BUILD_TARGETS=bootstrap
|
||||
endif
|
||||
|
||||
# On SPARC systems, use Sun Assembler
|
||||
CONFIGURE_OPTIONS.sparc+= --without-gnu-as --with-as=/usr/bin/as
|
||||
CONFIGURE_OPTIONS.i386+= --with-gnu-as --with-as=/usr/bin/gas
|
||||
CONFIGURE_OPTIONS+= $(CONFIGURE_OPTIONS.$(MACH))
|
||||
|
||||
# Set path to library install prefix
|
||||
CONFIGURE_OPTIONS+= LDFLAGS="-R$(CONFIGURE_PREFIX)/lib"
|
||||
|
||||
# Strip the resulting binaries
|
||||
COMPONENT_INSTALL_TARGETS = install-strip
|
||||
|
||||
COMPONENT_POST_INSTALL_ACTION = \
|
||||
$(RM) -r $(PROTO_DIR)$(CONFIGURE_PREFIX)/lib/gcc/$(GNU_TRIPLET)/$(COMPONENT_VERSION)/include-fixed
|
||||
|
||||
unexport SHELLOPTS
|
||||
|
||||
#
|
||||
# Run the tests and generate a summary report, then output the summary
|
||||
# report into the results file. Note that list of reported tests is sorted
|
||||
# to allow parallel test run.
|
||||
#
|
||||
# To ensure that all tests that are expected to pass actually
|
||||
# pass, we have to increase the stacksize limit to at least
|
||||
# 16MB. Otherwise we'll get spurious failures in the test
|
||||
# harness (gcc.c-torture/compile/limits-exprparen.c and others).
|
||||
# With the soft stacksize limit set to 16384 we get reasonably good
|
||||
# test results.
|
||||
#
|
||||
ifeq ($(strip $(MACH)),i386)
|
||||
COMPONENT_PRE_TEST_ACTION += \
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
ulimit -Ss 16385 ; \
|
||||
$(ENV) $(COMPONENT_PRE_TEST_ENV) \
|
||||
$(GMAKE) -k -i $(JOBS:%=-j%) check check-target RUNTESTFLAGS="--target_board=unix/-m64\{,-msave-args\}" ; \
|
||||
$(FIND) . -name '*.sum' | while read f; do \
|
||||
gsed -e '1,/^Running target unix/p' -e 'd' $f > $f.2; \
|
||||
gsed -e '/^Running target unix/,/Summary ===$/p' -e 'd' $f | grep '^.*: ' | sort -k 2 >> $f.2; \
|
||||
gsed -e '/Summary ===$/,$p' -e 'd' $f >> $f.2; \
|
||||
mv $f.2 $f; done; \
|
||||
$(GMAKE) mail-report.log)
|
||||
else
|
||||
COMPONENT_PRE_TEST_ACTION += \
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
ulimit -Ss 16385 ; \
|
||||
$(ENV) $(COMPONENT_PRE_TEST_ENV) \
|
||||
$(GMAKE) -k -i $(JOBS:%=-j%) check check-target RUNTESTFLAGS="--target_board=unix/-m64" ; \
|
||||
$(FIND) . -name '*.sum' | while read f; do \
|
||||
gsed -e '1,/^Running target unix/p' -e 'd' $f > $f.2; \
|
||||
gsed -e '/^Running target unix/,/Summary ===$/p' -e 'd' $f | grep '^.*: ' | sort -k 2 >> $f.2; \
|
||||
gsed -e '/Summary ===$/,$p' -e 'd' $f >> $f.2; \
|
||||
mv $f.2 $f; done; \
|
||||
$(GMAKE) mail-report.log)
|
||||
endif
|
||||
|
||||
COMPONENT_TEST_CMD = $(CAT)
|
||||
COMPONENT_TEST_TARGETS = mail-report.log
|
||||
|
||||
# Master test results are different between x86 and SPARC.
|
||||
COMPONENT_TEST_MASTER = \
|
||||
$(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master
|
||||
|
||||
# Common dependencies
|
||||
REQUIRED_PACKAGES += SUNWcs
|
||||
REQUIRED_PACKAGES += system/library
|
||||
REQUIRED_PACKAGES += system/library/math
|
||||
|
||||
# Required by the test suite
|
||||
REQUIRED_PACKAGES += developer/test/dejagnu
|
||||
REQUIRED_PACKAGES += developer/build/autoconf-archive
|
||||
REQUIRED_PACKAGES += developer/build/autogen
|
||||
REQUIRED_PACKAGES += system/extended-system-utilities
|
||||
107
sample_data/make-rules/gem.mk
Normal file
107
sample_data/make-rules/gem.mk
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
GEM=/usr/ruby/$(RUBY_VERSION)/bin/gem
|
||||
|
||||
VENDOR_GEM_DIR=/usr/ruby/$(RUBY_VERSION)/lib/ruby/vendor_ruby/gems/$(RUBY_LIB_VERSION)
|
||||
|
||||
# Name of the gem spec to use. This will typically be
|
||||
# <component_name>.gemspec
|
||||
GEMSPEC=$(COMPONENT_NAME).gemspec
|
||||
|
||||
|
||||
# Some gems projects have to be built using rake
|
||||
# Allow GEM build/install commands to be overwritten
|
||||
# to account for possible differences
|
||||
GEM_BUILD_ACTION=(cd $(@D); $(GEM) build $(GEM_BUILD_ARGS) $(GEMSPEC))
|
||||
|
||||
# Build install args in a more readable fashion
|
||||
ifeq ($(firstword $(subst .,$(space),$(RUBY_VERSION))),2)
|
||||
# gem install 2.x does docs differently. Continue to generate both types
|
||||
GEM_INSTALL_ARGS += --document rdoc,ri
|
||||
endif
|
||||
|
||||
GEM_INSTALL_ARGS += -V --local --force
|
||||
GEM_INSTALL_ARGS += --install-dir $(PROTO_DIR)/$(VENDOR_GEM_DIR)
|
||||
GEM_INSTALL_ARGS += --bindir $(PROTO_DIR)/$(VENDOR_GEM_DIR)/bin
|
||||
|
||||
# cd into build directory
|
||||
# gem 2.2.3 uses .gem from the cwd ignoring command line .gem file
|
||||
# gem 1.8.23.2 uses command line .gem file OR .gem from cwd
|
||||
GEM_INSTALL_ACTION= (cd $(@D); $(GEM) install $(GEM_INSTALL_ARGS) $(COMPONENT_NAME))
|
||||
|
||||
|
||||
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
|
||||
$(RM) -r $(@D) ; $(MKDIR) $(@D)
|
||||
$(GTAR) -C $(SOURCE_DIR) -cpf - . | $(GTAR) -C $(@D) -xpf -
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
# Build the gem and cause the generation of a new gem spec
|
||||
# file in $(COMPONENT_SRC)
|
||||
$(GEM_BUILD_ACTION)
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
$(MKDIR) $(PROTO_DIR)/$(GEM_DIR)
|
||||
# Install the new recreated gem
|
||||
$(GEM_INSTALL_ACTION)
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
COMPONENT_TEST_TARGETS =
|
||||
|
||||
# Test the built source. If the output file shows up in the environment or
|
||||
# arguments, don't redirect stdout/stderr to it.
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
|
||||
$(if $(findstring $(COMPONENT_TEST_OUTPUT),$(COMPONENT_TEST_ENV)$(COMPONENT_TEST_ARGS)),,&> $(COMPONENT_TEST_OUTPUT))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(COMPONENT_TEST_DEP)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
clean::
|
||||
$(RM) -r $(SOURCE_DIR) $(BUILD_DIR)
|
||||
|
||||
USERLAND_REQUIRED_PACKAGES += runtime/ruby
|
||||
110
sample_data/make-rules/history.mk
Normal file
110
sample_data/make-rules/history.mk
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
# $(WS_MAKE_RULES)/ips.mk really isn't set up to allow you to bypass all
|
||||
# the automatic (and lengthy) manifest manipulation that it does, which we
|
||||
# really don't need to do for these static, uninteresting packages. So we just
|
||||
# write a simple set of publication rules to get the packages into the repo.
|
||||
|
||||
# For gmake clean to work
|
||||
COMPONENT_SRC=nonexistent
|
||||
|
||||
PKGSEND = /usr/bin/pkgsend
|
||||
PKGLINT = /usr/bin/python3.5 /usr/bin/pkglint
|
||||
PKGMOGRIFY = /usr/bin/pkgmogrify
|
||||
|
||||
GENERATE_HISTORY= $(WS_TOOLS)/generate-history
|
||||
HISTORY= history
|
||||
|
||||
MANIFEST_BASE = $(BUILD_DIR)/manifest-$(MACH)
|
||||
|
||||
CANONICAL_MANIFESTS = $(filter-out dummy.p5m,$(wildcard *.p5m))
|
||||
HISTORICAL_MANIFESTS = $(shell $(NAWK) -v FUNCTION=name -f $(GENERATE_HISTORY) < $(HISTORY))
|
||||
ARCH_MANIFESTS = $(wildcard *.p5m.$(MACH))
|
||||
GENERATED_ARCH_MANIFESTS = $(ARCH_MANIFESTS:%.p5m.$(MACH)=%.p5m)
|
||||
CANONICAL_MANIFESTS += $(GENERATED_ARCH_MANIFESTS)
|
||||
|
||||
MOGRIFIED = $(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.mogrified)
|
||||
HISTOGRIFIED = $(HISTORICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.histogrified)
|
||||
PUBLISHED = $(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.published)
|
||||
PUBLISHED += $(HISTORICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.published)
|
||||
|
||||
# Rule to generate historical manifests from the $(HISTORY) file.
|
||||
define history-manifest-rule
|
||||
$(MANIFEST_BASE)-$(1): $(HISTORY) $(BUILD_DIR)
|
||||
$(NAWK) -v FUNCTION=manifest -v TARGET=$1 -f $(GENERATE_HISTORY) < \
|
||||
$(HISTORY) > $$@
|
||||
endef
|
||||
$(foreach mfst,$(HISTORICAL_MANIFESTS),$(eval $(call history-manifest-rule,$(mfst))))
|
||||
|
||||
ASLR_MODE = $(ASLR_NOT_APPLICABLE)
|
||||
|
||||
PKG_MACROS = CONSOLIDATION=$(CONSOLIDATION)
|
||||
PKG_MACROS += BUILD_VERSION=$(BUILD_VERSION)
|
||||
PKG_MACROS += OS_VERSION=$(OS_VERSION)
|
||||
|
||||
PKG_OPTIONS += $(PKG_MACROS:%=-D %)
|
||||
|
||||
build install test system-test:
|
||||
@echo "nothing to be done for $@"
|
||||
|
||||
$(BUILD_DIR):
|
||||
$(MKDIR) $@
|
||||
|
||||
$(MANIFEST_BASE)-%.mogrified: %.p5m $(BUILD_DIR)
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) $< > $@
|
||||
|
||||
$(MANIFEST_BASE)-%.histogrified: $(MANIFEST_BASE)-%.p5m $(BUILD_DIR)
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) $< > $@
|
||||
|
||||
$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.mogrified $(BUILD_DIR)
|
||||
$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest --no-catalog $<
|
||||
$(CP) $< $@
|
||||
|
||||
$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.histogrified $(BUILD_DIR)
|
||||
$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest --no-catalog $<
|
||||
$(CP) $< $@
|
||||
|
||||
$(BUILD_DIR)/.linted-$(MACH): $(MOGRIFIED) $(HISTOGRIFIED) $(BUILD_DIR)
|
||||
if [[ -n "$(MOGRIFIED)" ]]; \
|
||||
then \
|
||||
$(ENV) PYTHONPATH=$(WS_TOOLS)/python \
|
||||
SOLARIS_VERSION=$(SOLARIS_VERSION) \
|
||||
$(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \
|
||||
-f $(WS_TOOLS)/pkglintrc $(MOGRIFIED); \
|
||||
fi
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/.published-$(MACH): $(BUILD_DIR)/.linted-$(MACH) $(PUBLISHED)
|
||||
$(TOUCH) $@
|
||||
|
||||
publish: $(BUILD_DIR)/.published-$(MACH)
|
||||
|
||||
print-package-names:
|
||||
@cat history | cut -f 1 -d '@'
|
||||
|
||||
%.p5m: %.p5m.$(MACH)
|
||||
$(CP) $< $@
|
||||
|
||||
clobber clean::
|
||||
$(RM) -r $(BUILD_DIR) $(GENERATED_ARCH_MANIFESTS)
|
||||
50
sample_data/make-rules/install.rb.mk
Normal file
50
sample_data/make-rules/install.rb.mk
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
VENDOR_RUBY = /usr/ruby/$(RUBY_VERSION)/lib/ruby/vendor_ruby/$(RUBY_LIB_VERSION)
|
||||
|
||||
# default user executable binaries to /usr/bin
|
||||
INSTALL_RB_BINDIR = $(USRBINDIR)
|
||||
|
||||
# install.rb scripts do not have any concept of 'build' so make this a
|
||||
# no-op
|
||||
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
|
||||
$(RM) -r $(@D) ; $(MKDIR) $(@D)
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# install the source into the proto directory
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
(cd $(SOURCE_DIR) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
|
||||
./install.rb --destdir=$(PROTO_DIR) \
|
||||
--ruby=$(RUBY) \
|
||||
--bindir=$(INSTALL_RB_BINDIR) \
|
||||
--sitelibdir=$(VENDOR_RUBY) \
|
||||
--mandir=$(USRSHAREMANDIR))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
clean::
|
||||
$(RM) -r $(SOURCE_DIR) $(BUILD_DIR)
|
||||
71
sample_data/make-rules/ips-buildinfo.mk
Normal file
71
sample_data/make-rules/ips-buildinfo.mk
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright 2014 Andrzej Szeszo. All rights reserved.
|
||||
#
|
||||
|
||||
|
||||
# The package branch version scheme is:
|
||||
#
|
||||
# release_major.release_minor.update.component_revision
|
||||
#
|
||||
|
||||
#
|
||||
# Release major number: 2014, 2015, etc.
|
||||
#
|
||||
RELEASE_MAJOR ?= 2022
|
||||
|
||||
#
|
||||
# Release minor number: 0, 1, 2, etc.
|
||||
#
|
||||
RELEASE_MINOR ?= 0
|
||||
|
||||
#
|
||||
# Release update number: 0, 1, 2, etc.
|
||||
#
|
||||
UPDATENUM ?= 0
|
||||
|
||||
#
|
||||
# Component revision. Should be specified in the component's Makefile
|
||||
#
|
||||
|
||||
COMPONENT_REVISION ?= 0
|
||||
|
||||
#
|
||||
# Branch Identifier. Used in the version section of the package name to
|
||||
# identify the operating system branch that the package was produced for.
|
||||
#
|
||||
BRANCHID ?= $(RELEASE_MAJOR).$(RELEASE_MINOR).$(UPDATENUM).$(COMPONENT_REVISION)
|
||||
|
||||
#
|
||||
# Build Version. Used in the version section of the package name to identify
|
||||
# the operating system version and branch that the package was produced for.
|
||||
#
|
||||
BUILD_VERSION ?= $(PKG_SOLARIS_VERSION)-$(BRANCHID)
|
||||
|
||||
# Set a default reference repository against which pkglint is run, in case it
|
||||
# hasn't been set in the environment.
|
||||
#CANONICAL_REPO ?= http://ipkg.us.oracle.com/solaris12/dev/
|
||||
|
||||
# Pre-set some variables with GIT repo details
|
||||
USERLAND_GIT_REMOTE ?= $(shell git remote -v | awk '/origin.*fetch/ { print $$2 }')
|
||||
USERLAND_GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||
USERLAND_GIT_REV ?= $(shell git rev-parse HEAD)
|
||||
627
sample_data/make-rules/ips.mk
Normal file
627
sample_data/make-rules/ips.mk
Normal file
|
|
@ -0,0 +1,627 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright 2014 Andrzej Szeszo. All rights reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Rules and Macros for generating an IPS package manifest and publishing an
|
||||
# IPS package to a pkg depot.
|
||||
#
|
||||
# To use these rules, include ../make-rules/ips.mk in your Makefile
|
||||
# and define an "install" target appropriate to building your component.
|
||||
# Ex:
|
||||
#
|
||||
# install: $(BUILD_DIR)/build/$(MACH32)/.installed \
|
||||
# $(BUILD_DIR)/build/$(MACH64)/.installed
|
||||
#
|
||||
# This set of rules makes the "publish" target the default target for make(1)
|
||||
#
|
||||
|
||||
PKGDEPEND = /usr/bin/pkgdepend
|
||||
PKGFMT = /usr/bin/pkgfmt
|
||||
PKGMOGRIFY = /usr/bin/pkgmogrify
|
||||
PKGSEND = /usr/bin/pkgsend
|
||||
ifeq ($(strip $(PKGLINT_COMPONENT)),)
|
||||
PKGLINT = /usr/bin/python3.5 /usr/bin/pkglint
|
||||
else
|
||||
PKGLINT = ${WS_TOOLS}/pkglint
|
||||
endif
|
||||
PKGMANGLE = $(WS_TOOLS)/userland-mangler
|
||||
|
||||
WS_TRANSFORMS = $(WS_TOP)/transforms
|
||||
|
||||
GENERATE_HISTORY= $(WS_TOOLS)/generate-history
|
||||
HISTORY= history
|
||||
|
||||
# Package headers should all pretty much follow the same format
|
||||
METADATA_TEMPLATE = $(WS_TOP)/transforms/manifest-metadata-template
|
||||
COPYRIGHT_TEMPLATE = $(WS_TOP)/transforms/copyright-template
|
||||
|
||||
# order is important
|
||||
GENERATE_TRANSFORMS += $(WS_TOP)/transforms/generate-cleanup
|
||||
|
||||
PKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/libtool-drop
|
||||
PKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/ignore-libs
|
||||
|
||||
ifneq ($(GCC_ROOT), /usr/gcc/4.9)
|
||||
PKGMOGRIFY_TRANSFORMS += $(WS_TOP)/transforms/ignore-gcc-usr-lib
|
||||
endif
|
||||
|
||||
COMPARISON_TRANSFORMS += $(WS_TOP)/transforms/comparison-cleanup
|
||||
COMPARISON_TRANSFORMS += $(PKGMOGRIFY_TRANSFORMS)
|
||||
|
||||
LICENSE_TRANSFORMS = $(WS_TOP)/transforms/license-changes
|
||||
|
||||
# order is important
|
||||
PUBLISH_TRANSFORMS += $(LICENSE_TRANSFORMS)
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/variant-cleanup
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/autopyc
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/defaults
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/actuators
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/devel
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/docs
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/locale
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/python-3-soabi
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/python-3-no-32bit
|
||||
PUBLISH_TRANSFORMS += $(PKGMOGRIFY_TRANSFORMS)
|
||||
PUBLISH_TRANSFORMS += $(WS_TOP)/transforms/publish-cleanup
|
||||
|
||||
FINAL_TRANSFORMS += $(WS_TOP)/transforms/final-cleanup
|
||||
|
||||
define add-limiting-variable
|
||||
PKG_VARS += $(1)
|
||||
MANIFEST_LIMITING_VARS += -D $(1)="$(subst #,\#,$($(1)))"
|
||||
endef
|
||||
|
||||
# Make all the limiting variables available to manifest processing
|
||||
$(foreach var, $(filter PY3_%_NAMING,$(.VARIABLES)), \
|
||||
$(eval $(call add-limiting-variable,$(var))))
|
||||
|
||||
|
||||
ifeq ($(strip $(COMPONENT_AUTOGEN_MANIFEST)),yes)
|
||||
AUTOGEN_MANIFEST_TRANSFORMS += $(WS_TOP)/transforms/generate-cleanup
|
||||
else
|
||||
AUTOGEN_MANIFEST_TRANSFORMS += $(WS_TOP)/transforms/drop-all
|
||||
endif
|
||||
|
||||
# For items defined as variables or that may contain whitespace, add
|
||||
# them to a list to be expanded into PKG_OPTIONS later.
|
||||
PKG_VARS += ARC_CASE TPNO
|
||||
PKG_VARS += MACH MACH32 MACH64
|
||||
PKG_VARS += BUILD_VERSION OS_VERSION PKG_SOLARIS_VERSION
|
||||
PKG_VARS += GNU_TRIPLET
|
||||
PKG_VARS += CONSOLIDATION
|
||||
PKG_VARS += COMPONENT_VERSION IPS_COMPONENT_VERSION HUMAN_VERSION
|
||||
PKG_VARS += COMPONENT_ARCHIVE_URL COMPONENT_PROJECT_URL COMPONENT_NAME
|
||||
PKG_VARS += COMPONENT_FMRI COMPONENT_LICENSE_FILE
|
||||
PKG_VARS += COMPONENT_SUMMARY COMPONENT_DESCRIPTION COMPONENT_LICENSE
|
||||
PKG_VARS += HG_REPO HG_REV HG_URL COMPONENT_HG_URL COMPONENT_HG_REV
|
||||
PKG_VARS += GIT_COMMIT_ID GIT_REPO GIT_TAG
|
||||
PKG_VARS += PUBLISHER PUBLISHER_LOCALIZABLE
|
||||
PKG_VARS += USERLAND_GIT_REMOTE USERLAND_GIT_BRANCH USERLAND_GIT_REV
|
||||
|
||||
# For items that need special definition, add them to PKG_MACROS.
|
||||
# IPS_COMPONENT_VERSION suitable for use in regular expressions.
|
||||
PKG_MACROS += IPS_COMPONENT_RE_VERSION=$(subst .,\\.,$(IPS_COMPONENT_VERSION))
|
||||
# COMPONENT_VERSION suitable for use in regular expressions.
|
||||
PKG_MACROS += COMPONENT_RE_VERSION=$(subst .,\\.,$(COMPONENT_VERSION))
|
||||
|
||||
PKG_OPTIONS += $(PKG_MACROS:%=-D %) \
|
||||
-D COMPONENT_CLASSIFICATION="org.opensolaris.category.2008:$(strip $(COMPONENT_CLASSIFICATION))"
|
||||
|
||||
define mach-list-generate-macros
|
||||
ifeq ($(MACH),$(1))
|
||||
PKG_MACROS += $(1)_ONLY=
|
||||
PKG_MACROS += $(1)_EXCL=\#
|
||||
else
|
||||
PKG_MACROS += $(1)_ONLY=\#
|
||||
PKG_MACROS += $(1)_EXCL=
|
||||
endif
|
||||
endef
|
||||
$(foreach isa,$(MACH_LIST),$(eval $(call mach-list-generate-macros,$(isa))))
|
||||
|
||||
define python-generate-macros
|
||||
PKG_MACROS += PYTHON_$(1)_ONLY=\#
|
||||
PKG_MACROS += PYTHON_$(1)_EXCL=
|
||||
endef
|
||||
$(foreach ver,$(PYTHON_VERSIONS),$(eval $(call python-generate-macros,$(ver))))
|
||||
|
||||
PKG_MACROS += PYTHON_32_ONLY=
|
||||
|
||||
MANGLED_DIR = $(PROTO_DIR)/mangled
|
||||
|
||||
PKG_PROTO_DIRS += $(MANGLED_DIR) $(PROTO_DIR) $(@D) $(COMPONENT_DIR) $(COMPONENT_SRC)
|
||||
|
||||
MANIFEST_BASE = $(BUILD_DIR)/manifest-$(MACH)
|
||||
|
||||
SAMPLE_MANIFEST_DIR = $(COMPONENT_DIR)/manifests
|
||||
SAMPLE_MANIFEST_FILE = $(SAMPLE_MANIFEST_DIR)/sample-manifest.p5m
|
||||
GENERIC_MANIFEST_FILE = $(SAMPLE_MANIFEST_DIR)/generic-manifest.p5m
|
||||
|
||||
CANONICAL_MANIFESTS = $(wildcard *.p5m)
|
||||
ifneq ($(wildcard $(HISTORY)),)
|
||||
HISTORICAL_MANIFESTS = $(shell $(NAWK) -v FUNCTION=name -f $(GENERATE_HISTORY) < $(HISTORY))
|
||||
endif
|
||||
|
||||
define ips-print-depend-require-rule
|
||||
$(shell cat $(1) $(WS_TOP)/transforms/print-depend-require |\
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 |\
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u)
|
||||
endef
|
||||
|
||||
define ips-print-depend-require-versioned-rule
|
||||
$(foreach v,$($(1)V_VALUES),\
|
||||
$(shell cat $(2) $(WS_TOP)/transforms/print-pkgs |\
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) -D $($(1)V_FMRI_VERSION)=$(v) /dev/fd/0 |\
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | sort -u))
|
||||
endef
|
||||
|
||||
define ips-print-depend-require-type-rule
|
||||
$(foreach m,$($(1)_MANIFESTS),$(call ips-print-depend-require-versioned-rule,$(1),$(m)))
|
||||
endef
|
||||
|
||||
define ips-print-names-rule
|
||||
$(shell cat $(1) $(WS_TOP)/transforms/print-pkgs |\
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 |\
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | LANG=C LC_ALL=C sort -u)
|
||||
endef
|
||||
|
||||
define ips-print-names-versioned-rule
|
||||
$(foreach v,$($(1)V_VALUES),\
|
||||
$(shell cat $(2) $(WS_TOP)/transforms/print-pkgs |\
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) -D $($(1)V_FMRI_VERSION)=$(v) /dev/fd/0 |\
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | LANG=C LC_ALL=C sort -u))
|
||||
endef
|
||||
|
||||
#
|
||||
# In addition to the concrete per-version packages, we also need to emit the
|
||||
# name of the generic package which pulls in the concrete packages.
|
||||
#
|
||||
define ips-print-names-generic-rule
|
||||
$(shell cat $(2) $(WS_TOP)/transforms/mkgeneric $(BUILD_DIR)/mkgeneric-python \
|
||||
$(WS_TOP)/transforms/print-pkgs |\
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) -D $($(1)V_FMRI_VERSION)=\#\#\# /dev/fd/0 |\
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | LANG=C LC_ALL=C sort -u)
|
||||
endef
|
||||
|
||||
define ips-print-names-type-rule
|
||||
$(foreach m,$($(1)_MANIFESTS),\
|
||||
$(call ips-print-names-versioned-rule,$(1),$(m))\
|
||||
$(call ips-print-names-generic-rule,$(1),$(m))\
|
||||
)
|
||||
endef
|
||||
|
||||
VERSIONED_MANIFEST_TYPES =
|
||||
UNVERSIONED_MANIFESTS = $(filter-out %-GENFRAG.p5m, $(CANONICAL_MANIFESTS))
|
||||
GENERATE_GENERIC_TRANSFORMS=
|
||||
|
||||
# Look for manifests which need to be duplicated for each version of python.
|
||||
ifeq ($(findstring -PYVER,$(CANONICAL_MANIFESTS)),-PYVER)
|
||||
VERSIONED_MANIFEST_TYPES+= PY
|
||||
NOPY_MANIFESTS = $(filter-out %-PYVER.p5m,$(UNVERSIONED_MANIFESTS))
|
||||
PY_MANIFESTS = $(filter %-PYVER.p5m,$(CANONICAL_MANIFESTS))
|
||||
PYV_VALUES = $(shell echo $(PYTHON_VERSIONS) | tr -d .)
|
||||
PYV_FMRI_VERSION = PYV
|
||||
PYV_MANIFESTS = $(foreach v,$(PYV_VALUES),$(shell echo $(PY_MANIFESTS) | sed -e 's/-PYVER.p5m/-$(v).p5m/g'))
|
||||
PYNV_MANIFESTS = $(shell echo $(PY_MANIFESTS) | sed -e 's/-PYVER//')
|
||||
MKGENERIC_SCRIPTS += $(BUILD_DIR)/mkgeneric-python
|
||||
GENERATE_GENERIC_TRANSFORMS+=$(PYTHON_VERSIONS:%=-e 's/%/\$$\(PYVER\)/g')
|
||||
else
|
||||
NOPY_MANIFESTS = $(UNVERSIONED_MANIFESTS)
|
||||
endif
|
||||
|
||||
# Look for manifests which need to be duplicated for each version of perl.
|
||||
ifeq ($(findstring -PERLVER,$(UNVERSIONED_MANIFESTS)),-PERLVER)
|
||||
VERSIONED_MANIFEST_TYPES+= PERL
|
||||
NOPERL_MANIFESTS = $(filter-out %-PERLVER.p5m,$(NOPY_MANIFESTS))
|
||||
PERL_MANIFESTS = $(filter %-PERLVER.p5m,$(UNVERSIONED_MANIFESTS))
|
||||
PERLV_VALUES = $(shell echo $(PERL_VERSIONS) | tr -d .)
|
||||
PERLV_FMRI_VERSION = PLV
|
||||
PERLV_MANIFESTS = $(foreach v,$(PERLV_VALUES),$(shell echo $(PERL_MANIFESTS) | sed -e 's/-PERLVER.p5m/-$(v).p5m/g'))
|
||||
PERLNV_MANIFESTS = $(shell echo $(PERL_MANIFESTS) | sed -e 's/-PERLVER//')
|
||||
else
|
||||
NOPERL_MANIFESTS = $(NOPY_MANIFESTS)
|
||||
endif
|
||||
|
||||
# Look for manifests which need to be duplicated for each version of ruby.
|
||||
# NOPERL_MANIFESTS represents the manifests that are not Python or
|
||||
# Perl manifests. Extract the Ruby Manifests from NOPERL_MANIFESTS.
|
||||
# Any remaining manifests are stored in NONRUBY_MANIFESTS
|
||||
ifeq ($(findstring -RUBYVER,$(NOPERL_MANIFESTS)),-RUBYVER)
|
||||
VERSIONED_MANIFEST_TYPES+= RUBY
|
||||
NORUBY_MANIFESTS = $(filter-out %-RUBYVER.p5m,$(NOPERL_MANIFESTS))
|
||||
RUBY_MANIFESTS = $(filter %-RUBYVER.p5m,$(NOPERL_MANIFESTS))
|
||||
RUBYV_VALUES = $(RUBY_VERSIONS)
|
||||
RUBYV_FMRI_VERSION = RUBYV
|
||||
RUBYV_MANIFESTS = $(foreach v,$(RUBY_VERSIONS),\
|
||||
$(shell echo $(RUBY_MANIFESTS) |\
|
||||
sed -e 's/-RUBYVER.p5m/-$(shell echo $(v) |\
|
||||
cut -d. -f1,2 | tr -d .).p5m/g'))
|
||||
RUBYNV_MANIFESTS = $(shell echo $(RUBY_MANIFESTS) | sed -e 's/-RUBYVER//')
|
||||
else
|
||||
NORUBY_MANIFESTS = $(NOPERL_MANIFESTS)
|
||||
endif
|
||||
|
||||
NONVER_MANIFESTS = $(NORUBY_MANIFESTS)
|
||||
|
||||
VERSIONED_MANIFESTS = \
|
||||
$(PYV_MANIFESTS) $(PYNV_MANIFESTS) \
|
||||
$(PERLV_MANIFESTS) $(PERLNV_MANIFESTS) \
|
||||
$(RUBYV_MANIFESTS) $(RUBYNV_MANIFESTS) \
|
||||
$(NORUBY_MANIFESTS) $(HISTORICAL_MANIFESTS)
|
||||
|
||||
GENERATED = $(MANIFEST_BASE)-generated
|
||||
COMBINED = $(MANIFEST_BASE)-combined
|
||||
MANIFESTS = $(VERSIONED_MANIFESTS:%=$(MANIFEST_BASE)-%)
|
||||
|
||||
|
||||
DEPENDED=$(VERSIONED_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.depend)
|
||||
RESOLVED=$(VERSIONED_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.depend.res)
|
||||
PRE_PUBLISHED=$(RESOLVED:%.depend.res=%.pre-published)
|
||||
PUBLISHED=$(RESOLVED:%.depend.res=%.published)
|
||||
|
||||
COPYRIGHT_FILE ?= $(COMPONENT_NAME)-$(COMPONENT_VERSION).copyright
|
||||
IPS_COMPONENT_VERSION ?= $(COMPONENT_VERSION)
|
||||
|
||||
.DEFAULT: publish
|
||||
|
||||
.SECONDARY:
|
||||
|
||||
# allow publishing to be overridden, such as when
|
||||
# a package is for one architecture only.
|
||||
PRE_PUBLISH_STAMP ?= $(BUILD_DIR)/.pre-published-$(MACH)
|
||||
PUBLISH_STAMP ?= $(BUILD_DIR)/.published-$(MACH)
|
||||
|
||||
# Do all that is needed to ensure the package is consistent for publishing,
|
||||
# except actually pushing to a repo, separately from the push to the repo.
|
||||
pre-publish: build install $(PRE_PUBLISH_STAMP)
|
||||
publish: pre-publish update-metadata $(PUBLISH_STAMP)
|
||||
|
||||
sample-manifest: $(GENERATED).p5m
|
||||
|
||||
$(GENERATED).p5m: install
|
||||
[ ! -d $(SAMPLE_MANIFEST_DIR) ] && $(MKDIR) $(SAMPLE_MANIFEST_DIR) || true
|
||||
$(PKGSEND) generate $(PKG_HARDLINKS:%=--target %) $(PROTO_DIR) | \
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 $(GENERATE_TRANSFORMS) | \
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' \
|
||||
-e '/\.la$$/d' -e '/\.pyo$$/d' -e '/usr\/lib\/python[23]\..*\.pyc$$/d' \
|
||||
-e '/usr\/lib\/python3\..*\/__pycache__\/.*/d' | \
|
||||
$(PKGFMT) | \
|
||||
cat $(METADATA_TEMPLATE) - | \
|
||||
$(TEE) $@ $(SAMPLE_MANIFEST_FILE) >/dev/null
|
||||
if [ "$(GENERATE_GENERIC_TRANSFORMS)X" != "X" ]; \
|
||||
then sed $(GENERATE_GENERIC_TRANSFORMS) $(SAMPLE_MANIFEST_FILE) \
|
||||
| gawk '!seen[$$0]++' > $(GENERIC_MANIFEST_FILE); fi;
|
||||
|
||||
# copy the canonical manifest(s) to the build tree
|
||||
$(MANIFEST_BASE)-%.generate: %.p5m canonical-manifests
|
||||
cat $(METADATA_TEMPLATE) $< >$@
|
||||
|
||||
# The text of a transform that will emit a dependency conditional on the
|
||||
# presence of a particular version of a runtime, which will then draw in the
|
||||
# runtime-version-specific version of the package we're operating on. $(1) is
|
||||
# the name of the runtime package, and $(2) is the version suffix.
|
||||
mkgeneric = \
|
||||
echo "<transform set name=pkg.fmri value=(?:pkg:/)?(.+)-\#\#\#@(.*)" \
|
||||
"-> emit depend nodrop=true type=conditional" \
|
||||
"predicate=$(1)-$(2) fmri=%<1>-$(2)@%<2>>" >> $@;
|
||||
|
||||
mkgenericdep = \
|
||||
( echo -n "<transform set name=pkg.fmri value=(?:pkg:/)?(.+)-\#\#\#@(.*)" \
|
||||
"-> emit depend nodrop=true type=require-any " ; \
|
||||
for i in $(2); do echo -n "fmri=%<1>-$$i@%<2> " ; done ; \
|
||||
echo ">" ) >> $@
|
||||
|
||||
# Define and execute a macro that generates a rule to create a manifest for a
|
||||
# python module specific to a particular version of the python runtime.
|
||||
define python-manifest-rule
|
||||
$(MANIFEST_BASE)-%-$(2).mogrified: PKG_MACROS += PYTHON_$(1)_ONLY= PYTHON_$(1)_EXCL=\#
|
||||
|
||||
ifneq ($(filter $(1),$(PYTHON_64_ONLY_VERSIONS)),)
|
||||
$(MANIFEST_BASE)-%-$(2).mogrified: PKG_MACROS += PYTHON_32_ONLY=\#
|
||||
endif
|
||||
|
||||
$(MANIFEST_BASE)-%-$(2).p5m: %-PYVER.p5m
|
||||
$(PKGMOGRIFY) -D PYVER=$(1) $(MANIFEST_LIMITING_VARS) -D PYV=$(2) $$< > $$@
|
||||
endef
|
||||
$(foreach ver,$(PYTHON_VERSIONS),$(eval $(call python-manifest-rule,$(ver),$(shell echo $(ver)|tr -d .))))
|
||||
|
||||
# A rule to create a helper transform package for python, that will insert the
|
||||
# appropriate conditional dependencies into a python library's
|
||||
# runtime-version-generic package to pull in the version-specific bits when the
|
||||
# corresponding version of python is on the system.
|
||||
$(BUILD_DIR)/mkgeneric-python: $(WS_TOP)/make-rules/shared-macros.mk $(MAKEFILE_PREREQ) $(BUILD_DIR)
|
||||
$(RM) $@
|
||||
$(foreach ver,$(shell echo $(PYTHON_VERSIONS) | tr -d .), \
|
||||
$(call mkgeneric,runtime/python,$(ver)))
|
||||
$(call mkgenericdep,runtime/python,$(shell echo $(PYTHON_VERSIONS) | tr -d .))
|
||||
|
||||
# Build Python version-wrapping manifests from the generic version.
|
||||
$(MANIFEST_BASE)-%.p5m: %-PYVER.p5m $(BUILD_DIR)/mkgeneric-python
|
||||
$(PKGMOGRIFY) -D PYV=### $(BUILD_DIR)/mkgeneric-python \
|
||||
$(WS_TOP)/transforms/mkgeneric $< > $@
|
||||
if [ -f $*-GENFRAG.p5m ]; then cat $*-GENFRAG.p5m >> $@; fi
|
||||
|
||||
# Define and execute a macro that generates a rule to create a manifest for a
|
||||
# perl module specific to a particular version of the perl runtime.
|
||||
define perl-manifest-rule
|
||||
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).p5m: %-PERLVER.p5m
|
||||
$(PKGMOGRIFY) -D PERLVER=$(1) -D PLV=$(shell echo $(1) | tr -d .) \
|
||||
-D PERL_ARCH=$(call PERL_ARCH_FUNC,$(PERL.$(1))) $$< > $$@
|
||||
endef
|
||||
$(foreach ver,$(PERL_VERSIONS),$(eval $(call perl-manifest-rule,$(ver))))
|
||||
|
||||
# A rule to create a helper transform package for perl, that will insert the
|
||||
# appropriate conditional dependencies into a perl library's
|
||||
# runtime-version-generic package to pull in the version-specific bits when the
|
||||
# corresponding version of perl is on the system.
|
||||
$(BUILD_DIR)/mkgeneric-perl: $(WS_TOP)/make-rules/shared-macros.mk $(MAKEFILE_PREREQ)
|
||||
$(RM) $@
|
||||
$(foreach ver,$(shell echo $(PERL_VERSIONS) | tr -d .), \
|
||||
$(call mkgeneric,runtime/perl,$(ver)))
|
||||
$(call mkgenericdep,runtime/perl,$(shell echo $(PERL_VERSIONS) | tr -d .))
|
||||
|
||||
# Build Perl version-wrapping manifests from the generic version.
|
||||
$(MANIFEST_BASE)-%.p5m: %-PERLVER.p5m $(BUILD_DIR)/mkgeneric-perl
|
||||
$(PKGMOGRIFY) -D PLV=### $(BUILD_DIR)/mkgeneric-perl \
|
||||
$(WS_TOP)/transforms/mkgeneric $< > $@
|
||||
if [ -f $*-GENFRAG.p5m ]; then cat $*-GENFRAG.p5m >> $@; fi
|
||||
|
||||
# Rule to generate historical manifests from the $(HISTORY) file.
|
||||
define history-manifest-rule
|
||||
$(MANIFEST_BASE)-$(1): $(HISTORY) $(BUILD_DIR)
|
||||
$(NAWK) -v TARGET=$(1) -v FUNCTION=manifest -f $(GENERATE_HISTORY) < \
|
||||
$(HISTORY) > $$@
|
||||
endef
|
||||
$(foreach mfst,$(HISTORICAL_MANIFESTS),$(eval $(call history-manifest-rule,$(mfst))))
|
||||
|
||||
# Define and execute a macro that generates a rule to create a manifest for a
|
||||
# ruby module specific to a particular version of the ruby runtime.
|
||||
# Creates build/manifest-*-modulename-##.p5m file where ## is replaced with
|
||||
# the version number.
|
||||
define ruby-manifest-rule
|
||||
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).mogrified: \
|
||||
PKG_MACROS += RUBY_VERSION=$(1) RUBY_LIB_VERSION=$(2) \
|
||||
RUBYV=$(subst .,,$(1))
|
||||
|
||||
$(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).p5m: %-RUBYVER.p5m
|
||||
if [ -f $$*-$(shell echo $(1) | tr -d .)GENFRAG.p5m ]; then \
|
||||
cat $$*-$(shell echo $(1) | tr -d .)GENFRAG.p5m >> $$@; \
|
||||
fi
|
||||
$(PKGMOGRIFY) -D RUBY_VERSION=$(1) -D RUBY_LIB_VERSION=$(2) \
|
||||
-D RUBYV=$(shell echo $(1) | tr -d .) $$< > $$@
|
||||
endef
|
||||
$(foreach ver,$(RUBY_VERSIONS),\
|
||||
$(eval $(call ruby-manifest-rule,$(shell echo $(ver) | \
|
||||
cut -d. -f1,2),$(ver))))
|
||||
|
||||
# A rule to create a helper transform package for ruby, that will insert the
|
||||
# appropriate conditional dependencies into a ruby library's
|
||||
# runtime-version-generic package to pull in the version-specific bits when the
|
||||
# corresponding version of ruby is on the system.
|
||||
$(BUILD_DIR)/mkgeneric-ruby: $(WS_TOP)/make-rules/shared-macros.mk $(MAKEFILE_PREREQ)
|
||||
$(RM) $@
|
||||
$(foreach ver,$(RUBY_VERSIONS),\
|
||||
$(call mkgeneric,runtime/ruby,$(shell echo $(ver) | \
|
||||
cut -d. -f1,2 | tr -d .)))
|
||||
$(call mkgenericdep,runtime/ruby,$(shell echo $(RUBY_VERSIONS) | cut -d. -f1,2 | tr -d .))
|
||||
|
||||
# Build Ruby version-wrapping manifests from the generic version.
|
||||
# Creates build/manifest-*-modulename.p5m file.
|
||||
#
|
||||
$(MANIFEST_BASE)-%.p5m: %-RUBYVER.p5m $(BUILD_DIR)/mkgeneric-ruby
|
||||
$(PKGMOGRIFY) -D RUBYV=### $(BUILD_DIR)/mkgeneric-ruby \
|
||||
$(WS_TOP)/transforms/mkgeneric $< > $@
|
||||
if [ -f $*-GENFRAG.p5m ]; then cat $*-GENFRAG.p5m >> $@; fi
|
||||
|
||||
ifeq ($(strip $(COMPONENT_AUTOGEN_MANIFEST)),yes)
|
||||
# auto-generate file/directory list
|
||||
$(MANIFEST_BASE)-%.generated: %.p5m $(BUILD_DIR)
|
||||
(cat $(METADATA_TEMPLATE); \
|
||||
$(PKGSEND) generate $(PKG_HARDLINKS:%=--target %) $(PROTO_DIR)) | \
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 $(AUTOGEN_MANIFEST_TRANSFORMS) | \
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | $(PKGFMT) | \
|
||||
cat $< - >$@
|
||||
|
||||
# mogrify non-parameterized manifests
|
||||
$(MANIFEST_BASE)-%.mogrified: %.generated
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) $< \
|
||||
$(PUBLISH_TRANSFORMS) | \
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >$@
|
||||
|
||||
# mogrify parameterized manifests
|
||||
$(MANIFEST_BASE)-%.mogrified: $(MANIFEST_BASE)-%.generated
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) $< \
|
||||
$(PUBLISH_TRANSFORMS) | \
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >$@
|
||||
else
|
||||
# mogrify non-parameterized manifests
|
||||
$(MANIFEST_BASE)-%.mogrified: %.p5m $(BUILD_DIR)
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) $< \
|
||||
$(PUBLISH_TRANSFORMS) | \
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >$@
|
||||
|
||||
# mogrify parameterized manifests
|
||||
$(MANIFEST_BASE)-%.mogrified: $(MANIFEST_BASE)-%.p5m $(BUILD_DIR)
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) $< \
|
||||
$(PUBLISH_TRANSFORMS) | \
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >$@
|
||||
endif
|
||||
|
||||
# mangle the file contents
|
||||
$(BUILD_DIR) $(MANGLED_DIR):
|
||||
$(MKDIR) $@
|
||||
|
||||
PKGMANGLE_OPTIONS = -D $(MANGLED_DIR) $(PKG_PROTO_DIRS:%=-d %)
|
||||
$(MANIFEST_BASE)-%.mangled: $(MANIFEST_BASE)-%.mogrified $(MANGLED_DIR)
|
||||
$(PKGMANGLE) $(PKGMANGLE_OPTIONS) -m $< >$@
|
||||
|
||||
# generate dependencies
|
||||
PKGDEPEND_GENERATE_OPTIONS = -m $(PKG_PROTO_DIRS:%=-d %)
|
||||
$(MANIFEST_BASE)-%.depend: $(MANIFEST_BASE)-%.mangled
|
||||
$(PKGDEPEND) generate $(PKGDEPEND_GENERATE_OPTIONS) $< >$@
|
||||
|
||||
# pkgdepend resolve builds a map of all installed packages by default. This
|
||||
# makes dependency resolution particularly slow. We can dramatically improve
|
||||
# performance here by creating a file with a list of packages that we know
|
||||
# are needed, dramatically reducing the overhead involved in creating and
|
||||
# searching this map.
|
||||
#
|
||||
# Generate a resolve.deps file from the dependencies in the Makefile and
|
||||
# fragments that it uses.
|
||||
RESOLVE_DEPS=$(BUILD_DIR)/resolve.deps
|
||||
|
||||
$(RESOLVE_DEPS): Makefile $(BUILD_DIR) $(DEPENDED)
|
||||
@(for pkg in $(REQUIRED_PACKAGES:%=/%) ; do \
|
||||
echo $${pkg} ; \
|
||||
done ; \
|
||||
$(PKGMOGRIFY) $(WS_TRANSFORMS)/PRINT_COMPONENT_FMRIS $(DEPENDED) | \
|
||||
$(GSED) -e '/^[\t ]*$$/d' -e '/^#/d' ;) | sort -u >$@
|
||||
|
||||
# resolve the dependencies all at once
|
||||
$(BUILD_DIR)/.resolved-$(MACH): $(DEPENDED) $(RESOLVE_DEPS)
|
||||
$(PKGDEPEND) resolve $(RESOLVE_DEPS:%=-e %) -m $(DEPENDED)
|
||||
$(TOUCH) $@
|
||||
|
||||
# Set REQUIRED_PACKAGES macro substitution rules
|
||||
REQUIRED_PACKAGES_TRANSFORM=$(foreach p,$(REQUIRED_PACKAGES_SUBST), -e 's|$($(p))|$$($(p))|')
|
||||
|
||||
#
|
||||
# Generate a set of REQUIRED_PACKAGES based on what is needed for pkgdepend to
|
||||
# resolve properly. Automatically update the list in your Makefile for the
|
||||
# truly lazy among us. This is only a piece of the REQUIRED_PACKAGES puzzle.
|
||||
# You must still include packages for tools you build and test with.
|
||||
#
|
||||
REQUIRED_PACKAGES:: $(RESOLVED)
|
||||
$(GMAKE) RESOLVE_DEPS= $(BUILD_DIR)/.resolved-$(MACH)
|
||||
@$(GSED) -i -e '/^# Auto-generated dependencies$$/,$$d' Makefile
|
||||
@echo "# Auto-generated dependencies" >>Makefile
|
||||
@$(PKGMOGRIFY) $(WS_TRANSFORMS)/$@ $(RESOLVED) | \
|
||||
$(GSED) -e '/^[\t ]*$$/d' -e '/^#/d' $(REQUIRED_PACKAGES_TRANSFORM) \
|
||||
| sort -u >>Makefile
|
||||
@echo "*** Please edit your Makefile and verify the new or updated content at the end ***"
|
||||
|
||||
|
||||
# lint the manifests all at once
|
||||
$(BUILD_DIR)/.linted-$(MACH): $(BUILD_DIR)/.resolved-$(MACH)
|
||||
@echo "VALIDATING MANIFEST CONTENT: $(RESOLVED)"
|
||||
$(ENV) PYTHONPATH=$(WS_TOOLS)/python PROTO_PATH="$(PKG_PROTO_DIRS)" $(COMPONENT_PKGLINT_ENV)\
|
||||
$(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \
|
||||
-f $(WS_TOOLS)/pkglintrc $(RESOLVED)
|
||||
$(TOUCH) $@
|
||||
|
||||
lintme: FRC
|
||||
@echo "VALIDATING MANIFEST CONTENT: $(RESOLVED)"
|
||||
$(ENV) PYTHONPATH=$(WS_TOOLS)/python PROTO_PATH="$(PKG_PROTO_DIRS)" $(COMPONENT_PKGLINT_ENV)\
|
||||
$(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \
|
||||
-f $(WS_TOOLS)/pkglintrc $(RESOLVED)
|
||||
|
||||
FRC:
|
||||
|
||||
|
||||
# published
|
||||
PKGSEND_PUBLISH_OPTIONS = -s $(WS_REPO) publish --fmri-in-manifest
|
||||
PKGSEND_PUBLISH_OPTIONS += $(PKG_PROTO_DIRS:%=-d %)
|
||||
PKGSEND_PUBLISH_OPTIONS += -T \*.py
|
||||
|
||||
# Do all the hard work that is needed to ensure the package is consistent
|
||||
# and ready for publishing, except actually pushing bits to a repository
|
||||
$(MANIFEST_BASE)-%.pre-published: $(MANIFEST_BASE)-%.depend.res $(BUILD_DIR)/.linted-$(MACH)
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) $< \
|
||||
$(FINAL_TRANSFORMS) | \
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | uniq >$@
|
||||
@echo "NEW PACKAGE CONTENTS ARE LOCALLY VALIDATED AND READY TO GO"
|
||||
|
||||
# Push to the repo
|
||||
$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.pre-published
|
||||
$(PKGSEND) $(PKGSEND_PUBLISH_OPTIONS) $<
|
||||
$(PKGFMT) <$< >$@
|
||||
|
||||
$(BUILD_DIR)/.pre-published-$(MACH): $(PRE_PUBLISHED)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/.published-$(MACH): $(PUBLISHED)
|
||||
$(TOUCH) $@
|
||||
|
||||
print-depend-require: canonical-manifests
|
||||
@echo $(call ips-print-depend-require-rule,$(NONVER_MANIFESTS)) \
|
||||
$(foreach t,$(VERSIONED_MANIFEST_TYPES),$(call ips-print-depend-require-type-rule,$(t))) | tr ' ' '\n'
|
||||
|
||||
print-package-names: canonical-manifests $(MKGENERIC_SCRIPTS)
|
||||
@echo $(call ips-print-names-rule,$(NONVER_MANIFESTS)) \
|
||||
$(foreach t,$(VERSIONED_MANIFEST_TYPES),\
|
||||
$(call ips-print-names-type-rule,$(t))) \
|
||||
| tr ' ' '\n'
|
||||
|
||||
print-package-paths: canonical-manifests
|
||||
@cat $(CANONICAL_MANIFESTS) $(WS_TOP)/transforms/print-paths | \
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' | \
|
||||
LANG=C LC_ALL=C sort -u
|
||||
|
||||
install-packages: publish
|
||||
@if [ $(IS_GLOBAL_ZONE) = 0 -o x$(ROOT) != x ]; then \
|
||||
cat $(VERSIONED_MANIFESTS) $(WS_TOP)/transforms/print-paths | \
|
||||
$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \
|
||||
sed -e '/^$$/d' -e '/^#.*$$/d' -e 's;/;;' | \
|
||||
LANG=C LC_ALL=C sort -u | \
|
||||
(cd $(PROTO_DIR) ; pfexec /bin/cpio -dump $(ROOT)) ; \
|
||||
else ; \
|
||||
echo "unsafe to install package(s) automatically" ; \
|
||||
fi
|
||||
|
||||
$(RESOLVED): install
|
||||
|
||||
canonical-manifests: $(CANONICAL_MANIFESTS) Makefile $(PATCHES)
|
||||
ifeq ($(strip $(CANONICAL_MANIFESTS)),)
|
||||
# If there were no canonical manifests in the workspace, nothing will
|
||||
# be published and we should fail. A sample manifest can be generated
|
||||
# with
|
||||
# $ gmake sample-manifest
|
||||
# Once created, it will need to be reviewed, edited, and added to the
|
||||
# workspace.
|
||||
$(error Missing canonical manifest(s))
|
||||
endif
|
||||
|
||||
# Component variables are expanded directly to PKG_OPTIONS instead of via
|
||||
# PKG_MACROS since the values may contain whitespace.
|
||||
mkdefine = -D $(1)="$$(strip $(2))"
|
||||
|
||||
# Expand PKG_VARS into defines via PKG_OPTIONS.
|
||||
$(foreach var, $(PKG_VARS), \
|
||||
$(eval PKG_OPTIONS += $(call mkdefine,$(var),$$($(var)))) \
|
||||
)
|
||||
|
||||
# This converts required paths to containing package names for be able to
|
||||
# properly setup the build environment for a component.
|
||||
required-pkgs.mk: Makefile
|
||||
@echo "generating $@ from Makefile REQUIRED_* data"
|
||||
@pkg search -H -l '<$(DEPENDS:%=% OR) /bin/true>' \
|
||||
| sed -e 's/pkg:\/\(.*\)@.*/REQUIRED_PKGS += \1/g' >$@
|
||||
|
||||
pre-prep: required-pkgs.mk
|
||||
|
||||
|
||||
CLEAN_PATHS += required-pkgs.mk
|
||||
CLEAN_PATHS += $(BUILD_DIR)/mkgeneric-perl
|
||||
CLEAN_PATHS += $(BUILD_DIR)/mkgeneric-python
|
||||
CLEAN_PATHS += $(BUILD_DIR)/mkgeneric-ruby
|
||||
116
sample_data/make-rules/justmake.mk
Normal file
116
sample_data/make-rules/justmake.mk
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
#
|
||||
# Rules and Macros for building opens source software that just uses their
|
||||
# own make and no autoconf-style tools.
|
||||
#
|
||||
# To use these rules, include ../make-rules/justmake.mk in your Makefile
|
||||
# and define "build", "install" targets appropriate to building your component.
|
||||
# Ex:
|
||||
#
|
||||
# build: $(BUILD_32) \
|
||||
# $(BUILD_64)
|
||||
#
|
||||
# install: $(INSTALL_32) \
|
||||
# $(INSTALL_64)
|
||||
#
|
||||
# Any additional pre/post configure, build, or install actions can be specified
|
||||
# in your Makefile by setting them in on of the following macros:
|
||||
# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
|
||||
# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
|
||||
#
|
||||
# If component specific make targets need to be used for build or install, they
|
||||
# can be specified in
|
||||
# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
|
||||
#
|
||||
|
||||
COMPONENT_INSTALL_ARGS += DESTDIR=$(PROTO_DIR)
|
||||
COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
|
||||
|
||||
COMPONENT_COPY_ACTION ?= \
|
||||
$(CLONEY) $(SOURCE_DIR) $(@D)
|
||||
|
||||
COMPONENT_BUILD_ACTION ?= \
|
||||
cd $(@D); $(ENV) $(COMPONENT_BUILD_ENV) \
|
||||
$(GMAKE) $(COMPONENT_BUILD_GMAKE_ARGS) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS)
|
||||
|
||||
# build the configured source
|
||||
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
|
||||
$(RM) -r $(@D) ; $(MKDIR) $(@D)
|
||||
$(COMPONENT_COPY_ACTION)
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
($(COMPONENT_BUILD_ACTION))
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
-$(PARFAIT) build
|
||||
endif
|
||||
$(TOUCH) $@
|
||||
|
||||
COMPONENT_INSTALL_ACTION ?= \
|
||||
cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
|
||||
$(GMAKE) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS)
|
||||
|
||||
# install the built source into a prototype area
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
($(COMPONENT_INSTALL_ACTION))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# test the built source
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
parfait: install
|
||||
-$(PARFAIT) build
|
||||
else
|
||||
parfait:
|
||||
$(MAKE) PARFAIT_BUILD=yes parfait
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
|
||||
173
sample_data/make-rules/makemaker.mk
Normal file
173
sample_data/make-rules/makemaker.mk
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
# perl-5.22 is 32 bit (only), perl-5.24 and later are 64 bit (only)
|
||||
|
||||
COMMON_PERL_ENV += MAKE=$(GMAKE)
|
||||
COMMON_PERL_ENV += PATH=$(dir $(CC)):$(SPRO_VROOT)/bin:$(PATH)
|
||||
COMMON_PERL_ENV += LANG=""
|
||||
COMMON_PERL_ENV += CC="$(CC)"
|
||||
COMMON_PERL_ENV += CFLAGS="$(CC_BITS) $(PERL_OPTIMIZE)"
|
||||
|
||||
# Yes. Perl is just scripts, for now, but we need architecture
|
||||
# directories so that it populates all architecture prototype
|
||||
# directories.
|
||||
|
||||
$(BUILD_DIR)/%-5.22/.configured: PERL_VERSION=5.22
|
||||
$(BUILD_DIR)/%-5.24/.configured: PERL_VERSION=5.24
|
||||
$(BUILD_DIR)/%-5.34/.configured: PERL_VERSION=5.34
|
||||
$(BUILD_DIR)/$(MACH32)-%/.configured: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.configured: BITS=64
|
||||
|
||||
$(BUILD_DIR)/%-5.22/.built: PERL_VERSION=5.22
|
||||
$(BUILD_DIR)/%-5.24/.built: PERL_VERSION=5.24
|
||||
$(BUILD_DIR)/%-5.34/.built: PERL_VERSION=5.34
|
||||
$(BUILD_DIR)/$(MACH32)-%/.built: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.built: BITS=64
|
||||
|
||||
$(BUILD_DIR)/%-5.22/.installed: PERL_VERSION=5.22
|
||||
$(BUILD_DIR)/%-5.24/.installed: PERL_VERSION=5.24
|
||||
$(BUILD_DIR)/%-5.34/.installed: PERL_VERSION=5.34
|
||||
$(BUILD_DIR)/$(MACH32)-%/.installed: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.installed: BITS=64
|
||||
|
||||
$(BUILD_DIR)/%-5.22/.tested: PERL_VERSION=5.22
|
||||
$(BUILD_DIR)/%-5.24/.tested: PERL_VERSION=5.24
|
||||
$(BUILD_DIR)/%-5.34/.tested: PERL_VERSION=5.34
|
||||
$(BUILD_DIR)/$(MACH32)-%/.tested: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.tested: BITS=64
|
||||
|
||||
$(BUILD_DIR)/%-5.22/.tested-and-compared: PERL_VERSION=5.22
|
||||
$(BUILD_DIR)/%-5.24/.tested-and-compared: PERL_VERSION=5.24
|
||||
$(BUILD_DIR)/%-5.34/.tested-and-compared: PERL_VERSION=5.34
|
||||
$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared: BITS=64
|
||||
|
||||
PERL_32_ONLY_VERSIONS = $(filter-out $(PERL_64_ONLY_VERSIONS), $(PERL_VERSIONS))
|
||||
|
||||
BUILD_32 = $(PERL_32_ONLY_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.built)
|
||||
BUILD_64 = $(PERL_64_ONLY_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
|
||||
BUILD_NO_ARCH = $(PERL_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.built)
|
||||
|
||||
ifeq ($(PERL_VERSION),5.24)
|
||||
BUILD_32_and_64 = $(BUILD_64)
|
||||
BUILD_64_and_32 = $(BUILD_64)
|
||||
endif
|
||||
ifeq ($(PERL_VERSION),5.34)
|
||||
BUILD_32_and_64 = $(BUILD_64)
|
||||
BUILD_64_and_32 = $(BUILD_64)
|
||||
endif
|
||||
|
||||
INSTALL_32 = $(PERL_32_ONLY_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.installed)
|
||||
INSTALL_64 = $(PERL_64_ONLY_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
|
||||
INSTALL_NO_ARCH = $(PERL_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.installed)
|
||||
|
||||
COMPONENT_CONFIGURE_ENV += $(COMMON_PERL_ENV)
|
||||
COMPONENT_CONFIGURE_ENV += PERL="$(PERL)"
|
||||
$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep
|
||||
($(RM) -r $(@D) ; $(MKDIR) $(@D))
|
||||
$(CLONEY) $(SOURCE_DIR) $(@D)
|
||||
$(COMPONENT_PRE_CONFIGURE_ACTION)
|
||||
(cd $(@D) ; $(COMPONENT_CONFIGURE_ENV) $(PERL) $(PERL_FLAGS) \
|
||||
Makefile.PL $(PERL_STUDIO_OVERWRITE) $(CONFIGURE_OPTIONS))
|
||||
$(COMPONENT_POST_CONFIGURE_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
|
||||
COMPONENT_BUILD_ENV += $(COMMON_PERL_ENV)
|
||||
$(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
|
||||
$(GMAKE) $(COMPONENT_BUILD_GMAKE_ARGS) $(COMPONENT_BUILD_ARGS) \
|
||||
$(COMPONENT_BUILD_TARGETS))
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
|
||||
COMPONENT_INSTALL_ARGS += DESTDIR="$(PROTO_DIR)"
|
||||
COMPONENT_INSTALL_TARGETS = install_vendor
|
||||
COMPONENT_INSTALL_ENV += $(COMMON_PERL_ENV)
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
|
||||
$(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# Define bit specific and Perl version specific filenames.
|
||||
COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-$(PERL_VERSION)-$(BITS).master
|
||||
COMPONENT_TEST_OUTPUT = $(COMPONENT_TEST_BUILD_DIR)/test-$(PERL_VERSION)-$(BITS)-results
|
||||
COMPONENT_TEST_DIFFS = $(COMPONENT_TEST_BUILD_DIR)/test-$(PERL_VERSION)-$(BITS)-diffs
|
||||
COMPONENT_TEST_SNAPSHOT = $(COMPONENT_TEST_BUILD_DIR)/results-$(PERL_VERSION)-$(BITS).snapshot
|
||||
COMPONENT_TEST_TRANSFORM_CMD = $(COMPONENT_TEST_BUILD_DIR)/transform-$(PERL_VERSION)-$(BITS)-results
|
||||
|
||||
COMPONENT_TEST_TARGETS = test
|
||||
COMPONENT_TEST_ENV += $(COMMON_PERL_ENV)
|
||||
|
||||
# determine the type of tests we want to run.
|
||||
ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR)/results-*.master)),)
|
||||
TEST_32 = $(PERL_32_ONLY_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested)
|
||||
TEST_64 = $(PERL_64_ONLY_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested)
|
||||
TEST_NO_ARCH = $(PERL_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested)
|
||||
else
|
||||
TEST_32 = $(PERL_32_ONLY_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared)
|
||||
TEST_64 = $(PERL_64_ONLY_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared)
|
||||
TEST_NO_ARCH = $(PERL_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested-and-compared)
|
||||
endif
|
||||
|
||||
# test the built source
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
parfait: build
|
||||
else
|
||||
parfait:
|
||||
$(MAKE) PARFAIT_BUILD=yes parfait
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
|
||||
60
sample_data/make-rules/mate.mk
Normal file
60
sample_data/make-rules/mate.mk
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"). You may
|
||||
# only use this file in accordance with the terms of the CDDL.
|
||||
#
|
||||
# A full copy of the text of the CDDL should have accompanied this
|
||||
# source. A copy of the CDDL is also available via the Internet at
|
||||
# http://www.illumos.org/license/CDDL.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2021, Andreas Wacknitz. All rights reserved.
|
||||
#
|
||||
|
||||
COMPONENT_VERSION= $(COMPONENT_MJR_VERSION).$(COMPONENT_MNR_VERSION)
|
||||
COMPONENT_PROJECT_URL= https://www.mate-desktop.org
|
||||
COMPONENT_ARCHIVE_URL= https://pub.mate-desktop.org/releases/$(COMPONENT_MJR_VERSION)/$(COMPONENT_ARCHIVE)
|
||||
COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
|
||||
COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
|
||||
COMPONENT_LICENSE= GPLv2, LGPLv2, FDLv1.1
|
||||
|
||||
TEST_TARGET= $(NO_TESTS)
|
||||
|
||||
PATH=$(PATH.gnu)
|
||||
|
||||
COMPONENT_PREP_ACTION= cd $(@D) && NOCONFIGURE=1 ./autogen.sh
|
||||
|
||||
CONFIGURE_OPTIONS+= --sysconfdir=/etc
|
||||
CONFIGURE_OPTIONS+= --libexecdir=$(CONFIGURE_LIBDIR.$(BITS))/mate
|
||||
CONFIGURE_OPTIONS+= --disable-static
|
||||
CONFIGURE_OPTIONS+= --localstatedir=/var/lib
|
||||
|
||||
CONFIGURE_ENV+= PYTHON="$(PYTHON)"
|
||||
|
||||
COMPONENT_BUILD_ENV += CC="$(CC)"
|
||||
COMPONENT_BUILD_ENV += CFLAGS="$(CFLAGS)"
|
||||
|
||||
#
|
||||
# Set defaults for Mate libraries
|
||||
#
|
||||
ifeq ($(strip $(MATE_CATEGORY)),LIB)
|
||||
BUILD_BITS = 32_and_64
|
||||
COMPONENT_CLASSIFICATION= System/Libraries
|
||||
COMPONENT_FMRI= library/desktop/mate/$(COMPONENT_NAME)
|
||||
endif
|
||||
|
||||
|
||||
#
|
||||
# Set defaults for Mate applications
|
||||
#
|
||||
ifeq ($(strip $(MATE_CATEGORY)),APP)
|
||||
BUILD_BITS = 64
|
||||
PREFERRED_BITS= 64
|
||||
COMPONENT_FMRI= desktop/mate/$(COMPONENT_NAME)
|
||||
endif
|
||||
|
||||
# Default build dependencies
|
||||
REQUIRED_PACKAGES += developer/build/autoconf
|
||||
REQUIRED_PACKAGES += developer/build/pkg-config
|
||||
REQUIRED_PACKAGES += developer/documentation-tool/gtk-doc
|
||||
REQUIRED_PACKAGES += library/desktop/mate/mate-common
|
||||
166
sample_data/make-rules/meson.mk
Normal file
166
sample_data/make-rules/meson.mk
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Rules and Macros for building open source software that uses meson
|
||||
# to configure their build for the system they are on. It then includes
|
||||
# ninja.mk to handle the build/install/test macros
|
||||
#
|
||||
# To use these rules in your component Makefile, set BUILD_STYLE=meson and
|
||||
# then include $(WS_MAKE_RULES)/common.mk.
|
||||
#
|
||||
# Any additional pre/post configure actions can be specified
|
||||
# in your make file by setting them in one of the following macros:
|
||||
# COMPONENT_PRE_CONFIGURE_ACTION, COMPONENT_POST_CONFIGURE_ACTION
|
||||
#
|
||||
|
||||
CONFIGURE_PREFIX ?= /usr
|
||||
|
||||
# When debugging a component, override this to be debug or debugoptimized
|
||||
MESON_BUILDTYPE ?= plain
|
||||
|
||||
ifeq ($(strip $(MESON_BUILDTYPE)), debug)
|
||||
MESON_OPTIMIZATION ?= g
|
||||
else
|
||||
MESON_OPTIMIZATION ?= 3
|
||||
endif
|
||||
|
||||
MESON_BUILDPIE ?= false
|
||||
|
||||
# If the component prefers 64-bit binaries, then ensure builds deliver 64-bit
|
||||
# binaries to the standard directories and 32-bit binaries to the non-standard
|
||||
# location. This allows simplification of package manifests and makes it
|
||||
# easier to deliver the 64-bit binaries as the default.
|
||||
ifeq ($(strip $(PREFERRED_BITS)),64)
|
||||
CONFIGURE_BINDIR.32 ?= $(CONFIGURE_PREFIX)/bin/$(MACH32)
|
||||
CONFIGURE_SBINDIR.32 ?= $(CONFIGURE_PREFIX)/sbin/$(MACH32)
|
||||
CONFIGURE_BINDIR.64 ?= $(CONFIGURE_PREFIX)/bin
|
||||
CONFIGURE_SBINDIR.64 ?= $(CONFIGURE_PREFIX)/sbin
|
||||
else
|
||||
CONFIGURE_BINDIR.32 ?= $(CONFIGURE_PREFIX)/bin
|
||||
CONFIGURE_SBINDIR.32 ?= $(CONFIGURE_PREFIX)/sbin
|
||||
CONFIGURE_BINDIR.64 ?= $(CONFIGURE_PREFIX)/bin/$(MACH64)
|
||||
CONFIGURE_SBINDIR.64 ?= $(CONFIGURE_PREFIX)/sbin/$(MACH64)
|
||||
endif
|
||||
|
||||
# Regardless of PREFERRED_BITS, 64-bit libraries should always be delivered to
|
||||
# the appropriate subdirectory by default.
|
||||
CONFIGURE_LIBDIR.32 ?= $(CONFIGURE_PREFIX)/lib
|
||||
CONFIGURE_LIBDIR.64 ?= $(CONFIGURE_PREFIX)/lib/$(MACH64)
|
||||
|
||||
CONFIGURE_MANDIR ?= $(CONFIGURE_PREFIX)/share/man
|
||||
CONFIGURE_LOCALEDIR ?= $(CONFIGURE_PREFIX)/share/locale
|
||||
# all texinfo documentation seems to go to /usr/share/info no matter what
|
||||
CONFIGURE_INFODIR ?= /usr/share/info
|
||||
CONFIGURE_INCLUDEDIR ?= /usr/include
|
||||
|
||||
# Some components require an architecture-specific directory for their
|
||||
# configuration, so these are specified per-bits.
|
||||
CONFIGURE_ETCDIR.32 ?= $(ETCDIR)
|
||||
CONFIGURE_ETCDIR.64 ?= $(ETCDIR)
|
||||
|
||||
CONFIGURE_DEFAULT_DIRS?=yes
|
||||
|
||||
CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
|
||||
CONFIGURE_ENV += CC="$(CC)"
|
||||
CONFIGURE_ENV += CXX="$(CXX)"
|
||||
CONFIGURE_ENV += F77="$(F77)"
|
||||
CONFIGURE_ENV += FC="$(FC)"
|
||||
ifneq ($(strip $(CFLAGS)),)
|
||||
CONFIGURE_ENV += CFLAGS="$(strip $(CFLAGS))"
|
||||
endif
|
||||
ifneq ($(strip $(CXXFLAGS)),)
|
||||
CONFIGURE_ENV += CXXFLAGS="$(strip $(CXXFLAGS))"
|
||||
endif
|
||||
CONFIGURE_CPPFLAGS ?= $(CC_BITS)
|
||||
ifneq ($(strip $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)),)
|
||||
CONFIGURE_ENV += CPPFLAGS="$(strip $(CONFIGURE_CPPFLAGS) $(CPPFLAGS))"
|
||||
endif
|
||||
CONFIGURE_ENV += LDFLAGS="$(strip $(LDFLAGS))"
|
||||
ifneq ($(strip $(F77FLAGS)),)
|
||||
CONFIGURE_ENV += FFLAGS="$(strip $(F77FLAGS))"
|
||||
endif
|
||||
ifneq ($(strip $(FCFLAGS)),)
|
||||
CONFIGURE_ENV += FCFLAGS="$(strip $(FCFLAGS))"
|
||||
endif
|
||||
|
||||
# Options here should be limited to the built-in options listed on
|
||||
# https://mesonbuild.com/Builtin-options.html
|
||||
CONFIGURE_OPTIONS += --buildtype=$(MESON_BUILDTYPE)
|
||||
CONFIGURE_OPTIONS += --optimization=$(MESON_OPTIMIZATION)
|
||||
CONFIGURE_OPTIONS += -Ddefault_library=shared
|
||||
CONFIGURE_OPTIONS += -Db_pie=$(MESON_BUILDPIE)
|
||||
|
||||
# Install paths
|
||||
CONFIGURE_OPTIONS += --prefix=$(CONFIGURE_PREFIX)
|
||||
ifeq ($(CONFIGURE_DEFAULT_DIRS),yes)
|
||||
CONFIGURE_OPTIONS += --bindir="$(CONFIGURE_BINDIR.$(BITS))"
|
||||
CONFIGURE_OPTIONS += --sbindir="$(CONFIGURE_SBINDIR.$(BITS))"
|
||||
CONFIGURE_OPTIONS += --libdir="$(CONFIGURE_LIBDIR.$(BITS))"
|
||||
CONFIGURE_OPTIONS += --libexecdir="$(CONFIGURE_LIBDIR.32)"
|
||||
CONFIGURE_OPTIONS += --localstatedir="$(VARDIR)"
|
||||
CONFIGURE_OPTIONS += --mandir="$(CONFIGURE_MANDIR)"
|
||||
CONFIGURE_OPTIONS += --sysconfdir="$(CONFIGURE_ETCDIR.$(BITS))"
|
||||
endif
|
||||
CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
|
||||
CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
|
||||
CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH).$(BITS))
|
||||
|
||||
$(BUILD_DIR_32)/.configured: BITS=32
|
||||
$(BUILD_DIR_64)/.configured: BITS=64
|
||||
|
||||
CONFIGURE_ENV += $(CONFIGURE_ENV.$(BITS))
|
||||
|
||||
# This MUST be set in the build environment so that if pkg-config is executed
|
||||
# during the build process, the correct header files and libraries will be
|
||||
# picked up. In the Linux world, a system is generally only 32-bit or 64-bit
|
||||
# at one time so this isn't an issue that various auto* files account for (they
|
||||
# don't set PKG_CONFIG_PATH when executing pkg-config even if it was specified
|
||||
# during ./configure).
|
||||
COMPONENT_BUILD_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
|
||||
|
||||
MESON = /usr/bin/meson
|
||||
|
||||
# configure the unpacked source for building 32 and 64 bit version
|
||||
# meson insists on separate source & build directories, so no cloney here.
|
||||
$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep
|
||||
($(RM) -rf $(@D) ; $(MKDIR) $(@D))
|
||||
$(COMPONENT_PRE_CONFIGURE_ACTION)
|
||||
(cd $(SOURCE_DIR) ; $(ENV) $(CONFIGURE_ENV) $(MESON) setup $(@D) \
|
||||
$(CONFIGURE_OPTIONS))
|
||||
$(COMPONENT_POST_CONFIGURE_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# If BUILD_STYLE is set, provide a default configure target.
|
||||
ifeq ($(strip $(BUILD_STYLE)),meson)
|
||||
configure: $(CONFIGURE_$(MK_BITS))
|
||||
endif
|
||||
|
||||
REQUIRED_PACKAGES += developer/build/meson
|
||||
|
||||
# Meson generates build.ninja files for the ninja build tool to run,
|
||||
# so we include ninja.mk for the build/install/test rules
|
||||
|
||||
include $(WS_MAKE_RULES)/ninja.mk
|
||||
29
sample_data/make-rules/modules.mk
Normal file
29
sample_data/make-rules/modules.mk
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2015, Aurelien Larcher. All rights reserved.
|
||||
#
|
||||
|
||||
MODULES_ENV= . /etc/profile.d/modules.sh
|
||||
|
||||
MODULE_PURGE= module purge
|
||||
MODULE_LOAD= module load
|
||||
MODULE_UNLOAD= module unload
|
||||
|
||||
156
sample_data/make-rules/mpi-macros.mk
Normal file
156
sample_data/make-rules/mpi-macros.mk
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2013-2017, Aurelien Larcher. All rights reserved.
|
||||
#
|
||||
|
||||
MPI_IMPLEMENTATIONS_LIST = mpich openmpi
|
||||
|
||||
# Define compilers
|
||||
MPI.mpich = mpich
|
||||
|
||||
MPICC.mpich = mpicc
|
||||
MPICXX.mpich = mpicxx
|
||||
MPIF77.mpich = mpif77
|
||||
MPIFC.mpich = mpif90
|
||||
|
||||
MPI.openmpi = openmpi
|
||||
|
||||
MPICC.openmpi = mpicc
|
||||
MPICXX.openmpi = mpicxx
|
||||
MPIF77.openmpi = mpif77
|
||||
MPIFC.openmpi = mpif90
|
||||
|
||||
# Default to mpich
|
||||
MPI_IMPLEMENTATION ?= $(MPI.mpich)
|
||||
|
||||
MPICC = $(MPICC.$(MPI_IMPLEMENTATION))
|
||||
MPICXX = $(MPICXX.$(MPI_IMPLEMENTATION))
|
||||
MPIF77 = $(MPIF77.$(MPI_IMPLEMENTATION))
|
||||
MPIFC = $(MPIFC.$(MPI_IMPLEMENTATION))
|
||||
|
||||
# Define compiler enviromnent
|
||||
MPI_COMPILER = $(COMPILER)
|
||||
MPI_COMPILER_ROOT=
|
||||
MPI_COMPILER_LIBDIR=
|
||||
|
||||
ifeq ($(strip $(MPI_COMPILER)),gcc)
|
||||
|
||||
MPI_COMPILER_ROOT=$(GCC_ROOT)
|
||||
MPI_COMPILER_LIBDIR=$(MPI_COMPILER_ROOT)/lib/$(ARCHLIBSUBDIR$(BITS))
|
||||
|
||||
endif
|
||||
|
||||
# Define implementation specific paths
|
||||
MPI_BUNDLE = $(MPI_IMPLEMENTATION)-$(MPI_COMPILER)
|
||||
|
||||
MPI_PREFIX.32 = $(USRLIBDIR)/$(MPI_IMPLEMENTATION)/$(MPI_COMPILER)
|
||||
MPI_PREFIX.64 = $(USRLIBDIR64)/$(MPI_IMPLEMENTATION)/$(MPI_COMPILER)
|
||||
MPI_PREFIX = $(MPI_PREFIX.$(BITS))
|
||||
|
||||
MPI_BINDIR.32 = $(MPI_PREFIX.32)/bin
|
||||
MPI_BINDIR.64 = $(MPI_PREFIX.64)/bin
|
||||
MPI_BINDIR = $(MPI_BINDIR.$(BITS))
|
||||
|
||||
MPI_SBINDIR.32 = $(MPI_PREFIX.32)/sbin
|
||||
MPI_SBINDIR.64 = $(MPI_PREFIX.64)/sbin
|
||||
MPI_SBINDIR = $(MPI_SBINDIR.$(BITS))
|
||||
|
||||
MPI_LIBDIR.32 = $(MPI_PREFIX.32)/lib
|
||||
MPI_LIBDIR.64 = $(MPI_PREFIX.64)/lib
|
||||
MPI_LIBDIR = $(MPI_LIBDIR.$(BITS))
|
||||
|
||||
MPI_ETCDIR.32 = $(MPI_PREFIX.32)/etc
|
||||
MPI_ETCDIR.64 = $(MPI_PREFIX.64)/etc
|
||||
MPI_ETCDIR = $(MPI_ETCDIR.$(BITS))
|
||||
|
||||
MPI_INCDIR = $(USRINCDIR)/$(MPI_IMPLEMENTATION)
|
||||
|
||||
MPI_SHAREDIR = $(USRSHAREDIR)
|
||||
MPI_DATADIR = $(MPI_SHAREDIR)/$(MPI_IMPLEMENTATION)
|
||||
MPI_DOCDIR = $(USRSHAREDOCDIR)/$(MPI_IMPLEMENTATION)
|
||||
MPI_HTMLDIR = $(USRSHAREDOCDIR)/www
|
||||
MPI_MANDIR = $(USRSHAREMANDIR)
|
||||
|
||||
|
||||
# Create meta rule to trigger build for each listed implementation
|
||||
|
||||
ifneq ($(strip $(COMPONENT_MPI_BUILD)),)
|
||||
|
||||
$(BUILD_DIR_32)/%/.configured: BITS=32
|
||||
$(BUILD_DIR_64)/%/.configured: BITS=64
|
||||
|
||||
$(BUILD_DIR_32)/%/.built: BITS=32
|
||||
$(BUILD_DIR_64)/%/.built: BITS=64
|
||||
|
||||
BUILD_32=
|
||||
BUILD_64=
|
||||
|
||||
$(BUILD_DIR_32)/%/.installed: BITS=32
|
||||
$(BUILD_DIR_64)/%/.installed: BITS=64
|
||||
|
||||
INSTALL_32=
|
||||
INSTALL_64=
|
||||
|
||||
$(BUILD_DIR_32)/%/.tested: BITS=32
|
||||
$(BUILD_DIR_64)/%/.tested: BITS=64
|
||||
|
||||
$(BUILD_DIR_32)/%/.tested-and-compared: BITS=32
|
||||
$(BUILD_DIR_64)/%/.tested-and-compared: BITS=64
|
||||
|
||||
TEST_32=
|
||||
TEST_64=
|
||||
|
||||
define mpi-rule
|
||||
|
||||
BUILD_DIR_32_$(1) = $$(BUILD_DIR)/$$(MACH32)/$(1)
|
||||
BUILD_DIR_64_$(1) = $$(BUILD_DIR)/$$(MACH64)/$(1)
|
||||
|
||||
$(BUILD_DIR)/%/$(1)/.configured: MPI_IMPLEMENTATION=$(1)
|
||||
|
||||
$(BUILD_DIR)/%/$(1)/.built: MPI_IMPLEMENTATION=$(1)
|
||||
|
||||
BUILD_32+= $$(BUILD_DIR_32_$(1))/.built
|
||||
BUILD_64+= $$(BUILD_DIR_64_$(1))/.built
|
||||
|
||||
$(BUILD_DIR)/%/$(1)/.installed: MPI_IMPLEMENTATION=$(1)
|
||||
|
||||
INSTALL_32+= $$(BUILD_DIR_32_$(1))/.installed
|
||||
INSTALL_64+= $$(BUILD_DIR_64_$(1))/.installed
|
||||
|
||||
$(BUILD_DIR)/%/$(1)/.tested: MPI_IMPLEMENTATION=$(1)
|
||||
|
||||
$(BUILD_DIR)/%/$(1)/.tested-and-compared: MPI_IMPLEMENTATION=$(1)
|
||||
|
||||
ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR)/results-*.master)),)
|
||||
TEST_32+= $$(BUILD_DIR_32_$(1))/.tested
|
||||
TEST_64+= $$(BUILD_DIR_64_$(1))/.tested
|
||||
else
|
||||
TEST_32+= $$(BUILD_DIR_32_$(1))/.tested-and-compared
|
||||
TEST_64+= $$(BUILD_DIR_64_$(1))/.tested-and-compared
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
$(foreach mpi, $(COMPONENT_MPI_BUILD), $(eval $(call mpi-rule,$(mpi))))
|
||||
|
||||
endif
|
||||
|
||||
COMPONENT_MPI_BUILD_DIR= $(BUILD_DIR_$(BITS)_$(MPI_IMPLEMENTATION))
|
||||
119
sample_data/make-rules/ninja.mk
Normal file
119
sample_data/make-rules/ninja.mk
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
#
|
||||
# Rules and Macros for building open source software that builds with
|
||||
# ninja (whether using a provided ninja file or one generated by a tool
|
||||
# such as meson).
|
||||
#
|
||||
# To use these rules on their own, set BUILD_STYLE=ninja before including
|
||||
# $(WS_MAKE_RULES)/common.mk. They will also be used for the build rules
|
||||
# if you set BUILD_STYLE=meson.
|
||||
#
|
||||
# Any additional pre/post configure, build, or install actions can be specified
|
||||
# in your Makefile by setting them in on of the following macros:
|
||||
# COMPONENT_PRE_BUILD_ACTION, COMPONENT_BUILD_ACTION,
|
||||
# COMPONENT_POST_BUILD_ACTION, COMPONENT_PRE_INSTALL_ACTION,
|
||||
# COMPONENT_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
|
||||
#
|
||||
# If component specific ninja targets need to be used for build or install, they
|
||||
# can be specified in
|
||||
# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
|
||||
#
|
||||
|
||||
NINJA = /usr/bin/ninja
|
||||
|
||||
COMPONENT_INSTALL_ENV += DESTDIR=$(PROTO_DIR)
|
||||
COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
|
||||
|
||||
COMPONENT_BUILD_ACTION ?= \
|
||||
$(ENV) $(COMPONENT_BUILD_ENV) \
|
||||
$(NINJA) -C $(@D) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS)
|
||||
|
||||
# build the configured source
|
||||
$(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
($(COMPONENT_BUILD_ACTION))
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
-$(PARFAIT) $(@D)
|
||||
endif
|
||||
$(TOUCH) $@
|
||||
|
||||
COMPONENT_INSTALL_ACTION ?= \
|
||||
$(ENV) $(COMPONENT_INSTALL_ENV) \
|
||||
$(NINJA) -C $(@D) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS)
|
||||
|
||||
# install the built source into a prototype area
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
($(COMPONENT_INSTALL_ACTION))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# set the default command to use for test of the component
|
||||
COMPONENT_TEST_CMD = $(NINJA)
|
||||
COMPONENT_SYSTEM_TEST_CMD = $(NINJA)
|
||||
|
||||
# set the default target for test of the component
|
||||
COMPONENT_TEST_TARGETS = test
|
||||
COMPONENT_SYSTEM_TEST_TARGETS = test
|
||||
|
||||
# test the built source
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
parfait: build
|
||||
else
|
||||
parfait:
|
||||
$(MAKE) PARFAIT_BUILD=yes parfait
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
|
||||
REQUIRED_PACKAGES += developer/build/ninja
|
||||
19
sample_data/make-rules/ocaml.mk
Normal file
19
sample_data/make-rules/ocaml.mk
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"). You may
|
||||
# only use this file in accordance with the terms of the CDDL.
|
||||
#
|
||||
# A full copy of the text of the CDDL should have accompanied this
|
||||
# source. A copy of the CDDL is also available via the Internet at
|
||||
# http://www.illumos.org/license/CDDL.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2020, Aurelien Larcher. All rights reserved.
|
||||
#
|
||||
|
||||
OCAML_ETCDIR = $(ETCDIR)/ocaml
|
||||
OCAML_LIBDIR = $(USRLIBDIR64)/ocaml
|
||||
|
||||
# Select preferred Python version
|
||||
OCAML_PYTHON_VERSION = 3.5
|
||||
PYTHON_VERSION = $(OCAML_PYTHON_VERSION)
|
||||
84
sample_data/make-rules/prep-download.mk
Normal file
84
sample_data/make-rules/prep-download.mk
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
FETCH = $(WS_TOOLS)/userland-fetch
|
||||
|
||||
#
|
||||
# Anything that we download must have a COMPONENT_ARCHIVE_URL{_[0-9]+} macro
|
||||
# that tells us where the canonical source for the archive can be found. The
|
||||
# macro for the first archive is typically un-suffixed. By convention,
|
||||
# subsequent archives will include a _[0-9]+ in the macro name. This allows
|
||||
# an arbitrary number of archives to be downloaded for a particular component
|
||||
# Makefile. It is also important to note that there is a corresponding
|
||||
# COMPONENT_ARCHIVE macro defining a local file name for the archive, and
|
||||
# optional COMPONENT_ARCHIVE_HASH and COMPONENT_SIG_URL containing a hash of
|
||||
# the file and signature for verification of its contents.
|
||||
#
|
||||
|
||||
URL_SUFFIXES = $(subst COMPONENT_ARCHIVE_URL_,, \
|
||||
$(filter COMPONENT_ARCHIVE_URL_%, $(.VARIABLES)))
|
||||
|
||||
# Argument to "userland-fetch" script that causes it to download and verify
|
||||
# files, but not to remove mismatches; good to save traffic when initially
|
||||
# fetching a new archive just to learn what checksum to expect in Makefile.
|
||||
#FETCH_KEEP ?= --keep
|
||||
FETCH_KEEP ?=
|
||||
|
||||
# Template for download rules.
|
||||
define download-rules
|
||||
ifdef COMPONENT_ARCHIVE_URL$(1)
|
||||
|
||||
ARCHIVES += $$(COMPONENT_ARCHIVE$(1))
|
||||
CLOBBER_PATHS += $$(COMPONENT_ARCHIVE$(1))
|
||||
|
||||
fetch:: FETCH_KEEP=--keep
|
||||
fetch:: $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
|
||||
|
||||
download:: $$(USERLAND_ARCHIVES)
|
||||
download:: $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
|
||||
|
||||
$$(USERLAND_ARCHIVES):
|
||||
$$(MKDIR) $$(USERLAND_ARCHIVES)
|
||||
|
||||
$$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)): $(MAKEFILE_PREREQ)
|
||||
$$(FETCH) $$(FETCH_KEEP) --file $$@ \
|
||||
$$(COMPONENT_ARCHIVE_URL$(1):%=--url %) \
|
||||
$$(COMPONENT_ARCHIVE_HASH$(1):%=--hash %) \
|
||||
$$(COMPONENT_SIG_URL$(1):%=--sigurl %) \
|
||||
$$(if $$(COMPONENT_FETCH_USER_AGENT$(1)),--user-agent $$(COMPONENT_FETCH_USER_AGENT$(1)))
|
||||
$$(TOUCH) $$@
|
||||
|
||||
USERLAND_REQUIRED_PACKAGES += runtime/python-27
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
#
|
||||
# Define the rules required to download any source archives and augment any
|
||||
# cleanup macros.
|
||||
#
|
||||
$(eval $(call download-rules,))
|
||||
$(foreach suffix, $(URL_SUFFIXES), $(eval $(call download-rules,_$(suffix))))
|
||||
|
||||
# Needed for signature validation of downloads
|
||||
USERLAND_REQUIRED_PACKAGES += crypto/gnupg
|
||||
127
sample_data/make-rules/prep-git.mk
Normal file
127
sample_data/make-rules/prep-git.mk
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
GIT = /usr/bin/git
|
||||
|
||||
COMPONENT_PREP_GIT?=yes
|
||||
ifeq ($(strip $(COMPONENT_PREP_GIT)), yes)
|
||||
|
||||
#
|
||||
# Anything that we pull from a GIT repo must have a GIT_REPO{_[0-9]+} and
|
||||
# GIT_COMMIT_ID{_[0-9]+} to match.
|
||||
#
|
||||
|
||||
GIT_SUFFIXES = $(subst GIT_REPO_,, $(filter GIT_REPO_%, $(.VARIABLES)))
|
||||
|
||||
# Templates for git variables and rules. We separate the variable assignments
|
||||
# from the rules so that all the variable assignments are given a chance to
|
||||
# complete before those variables are used in targets or prerequisites, where
|
||||
# they'll be expanded immediately.
|
||||
define git-variables
|
||||
ifdef GIT_REPO$(1)
|
||||
ifeq ("",$(strip $(or $(GIT_BRANCH$(1)),$(GIT_COMMIT_ID$(1)))))
|
||||
$$(error GIT_BRANCH$(1) and/or GIT_COMMIT_ID$(1) must be defined)
|
||||
endif
|
||||
|
||||
ifdef GIT_BRANCH$(1)
|
||||
GIT_BRANCH_ARG$(1) = -b $$(GIT_BRANCH$(1))
|
||||
else
|
||||
GIT_BRANCH_ARG$(1) = -b master
|
||||
endif
|
||||
|
||||
# If the label is not already defined (including to empty), set it to the version.
|
||||
COMPONENT_LABEL$(1) ?= $$(COMPONENT_VERSION$(1))
|
||||
# The source directory is <name>-(<label>|<version>)[-(<tag>|<branch>)][-<commit].
|
||||
COMPONENT_SRC$(1) ?= $$(COMPONENT_NAME$(1))$$(COMPONENT_LABEL$(1):%=-%)$$($$(or $$(GIT_TAG$(1)),$$(GIT_BRANCH$(1))))$$(GIT_COMMIT_ID$(1):%=-%)
|
||||
COMPONENT_ARCHIVE$(1) ?= $$(COMPONENT_SRC$(1)).tar.gz
|
||||
# If the source is github attempt to generate an archive url. Defining
|
||||
# COMPONENT_ARCHIVE_URL here messes with prep-download.mk, which keys off of
|
||||
# that variable to build download rules, so keep track of which suffixes
|
||||
# generated a github archive URL, and prep-download.mk will use that list to
|
||||
# remove those URLs. If the primary (unsuffixed) archive is from github, then
|
||||
# we add a dummy __BLANK__ suffix to the list, and filter that out separately.
|
||||
ifeq (github,$(findstring github,$(GIT_REPO$(1))))
|
||||
COMPONENT_ARCHIVE_URL$(1) ?= $(GIT_REPO$(1))/archive/$(GIT_BRANCH$(1)).tar.gz
|
||||
GITHUB_ARCHIVE_SUFFIXES += $(or $(strip $(1:_%=%)),__BLANK__)
|
||||
else
|
||||
COMPONENT_ARCHIVE_SRC$(1) = git
|
||||
endif
|
||||
|
||||
CLEAN_PATHS += $$(COMPONENT_SRC$(1))
|
||||
CLOBBER_PATHS += $$(COMPONENT_ARCHIVE$(1))
|
||||
SOURCE_DIR$(1) = $$(COMPONENT_DIR)/$(COMPONENT_SRC$(1))
|
||||
endif
|
||||
endef
|
||||
|
||||
define git-rules
|
||||
ifdef GIT_REPO$(1)
|
||||
download:: $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
|
||||
|
||||
# First attempt to download a cached archive of the SCM repo at the proper
|
||||
# changeset ID, If COMPONENT_ARCHIVE_URL is defined try that as well.
|
||||
# If that fails, create an archive by cloning the SCM repo,
|
||||
# updating to the selected changeset, archiving that directory, and cleaning up
|
||||
# when complete.
|
||||
#
|
||||
# GIT CLONE ARGS
|
||||
# A shallow clone (--depth=1) to git clone takes only the top level (named)
|
||||
# commits on any branches or tags and can cause use of other commit IDs to
|
||||
# fail. As such, it should never be used here as it can make it impossible to
|
||||
# reliably reproduce archives created from the result since git clone (unlike
|
||||
# mercurial) currently has no way of cloning to a specific commit id.
|
||||
$$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)): $(MAKEFILE_PREREQ)
|
||||
$$(FETCH) --file $$@ $$(GIT_HASH$(1):%=--hash %) --url GIT || \
|
||||
($$(FETCH) --file $$@ $$(COMPONENT_ARCHIVE_URL$(1):%=--url %) || \
|
||||
(TMP_REPO=$$$$($(MKTEMP) --directory) && \
|
||||
$(GIT) clone $$(GIT_REPO$(1)) $$(GIT_BRANCH_ARG$(1)) $$$${TMP_REPO} && \
|
||||
(cd $$$${TMP_REPO} ; $(GIT) checkout \
|
||||
$$(GIT_COMMIT_ID$(1))) && \
|
||||
(cd $$$${TMP_REPO} ; \
|
||||
$(GIT) config tar.tar.bz2.command "bzip2 -c"; \
|
||||
$(GIT) config tar.tar.xz.command "xz -c"; \
|
||||
$(GIT) archive \
|
||||
--format $(subst $(COMPONENT_SRC$(1)).,,$(COMPONENT_ARCHIVE$(1))) \
|
||||
--prefix $$(COMPONENT_SRC$(1))/ \
|
||||
$$(or $$(GIT_COMMIT_ID$(1)),$$(GIT_BRANCH$(1)))) > $$@ && \
|
||||
$(RM) -r $$$${TMP_REPO} ) && \
|
||||
( GIT_HASH=$$$$(digest -a sha256 $$@) && \
|
||||
$(GSED) -i \
|
||||
-e "s/\(GIT_HASH$(1)[[:space:]]*=[[:space:]]*\).*/\1sha256:$$$${GIT_HASH}/" \
|
||||
Makefile ))
|
||||
|
||||
|
||||
REQUIRED_PACKAGES += developer/versioning/git
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
# Evaluate the variable assignments immediately
|
||||
$(eval $(call git-variables,))
|
||||
$(foreach suffix, $(GIT_SUFFIXES), $(eval $(call git-variables,_$(suffix))))
|
||||
|
||||
$(eval $(call git-rules,))
|
||||
$(foreach suffix, $(GIT_SUFFIXES), $(eval $(call git-rules,_$(suffix))))
|
||||
|
||||
endif
|
||||
97
sample_data/make-rules/prep-hg.mk
Normal file
97
sample_data/make-rules/prep-hg.mk
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
HG = /usr/bin/hg
|
||||
MKTEMP = /usr/gnu/bin/mktemp
|
||||
|
||||
COMPONENT_PREP_HG?=yes
|
||||
ifeq ($(strip $(COMPONENT_PREP_HG)), yes)
|
||||
|
||||
#
|
||||
# Anything that we pull from a Mercurial repo must have a HG_REPO{_[0-9]+} and
|
||||
# HG_REV{_[0-9]+} to match.
|
||||
#
|
||||
|
||||
HG_SUFFIXES = $(subst HG_REPO_,, $(filter HG_REPO_%, $(.VARIABLES)))
|
||||
|
||||
# Templates for download variables and rules. We separate the variable
|
||||
# assignments from the rules so that all the variable assignments are given a
|
||||
# chance to complete before those variables are used in targets or
|
||||
# prerequisites, where they'll be expanded immediately.
|
||||
define hg-variables
|
||||
ifdef HG_REPO$(1)
|
||||
ifdef HG_REV$(1)
|
||||
|
||||
# If the label is not already defined (including to empty), set it to the version.
|
||||
COMPONENT_LABEL$(1) ?= $$(COMPONENT_VERSION$(1))
|
||||
# The source directory is <name>-(<label>|<version>)[-(<tag>|<branch>)][-<commit].
|
||||
COMPONENT_SRC$(1) ?= $$(COMPONENT_NAME$(1))$$(COMPONENT_LABEL$(1):%=-%)$$($$(or $$(HG_TAG$(1)),$$(HG_BRANCH$(1))))$$(HG_REV$(1):%=-%)
|
||||
COMPONENT_ARCHIVE$(1) ?= $$(COMPONENT_SRC$(1)).tar.gz
|
||||
COMPONENT_ARCHIVE_SRC$(1) = hg
|
||||
|
||||
CLEAN_PATHS += $$(COMPONENT_SRC$(1))
|
||||
CLOBBER_PATHS += $$(COMPONENT_ARCHIVE$(1))
|
||||
SOURCE_DIR$(1) = $$(COMPONENT_DIR)/$(COMPONENT_SRC$(1))
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
define hg-rules
|
||||
ifdef HG_REPO$(1)
|
||||
ifdef HG_REV$(1)
|
||||
download:: $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
|
||||
|
||||
# First attempt to download a cached archive of the SCM repo at the proper
|
||||
# changeset ID. If that fails, create an archive by cloning the SCM repo,
|
||||
# updating to the selected changeset, archiving that directory, and cleaning up
|
||||
# when complete.
|
||||
$$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)): $(MAKEFILE_PREREQ)
|
||||
$$(FETCH) --file $$@ $$(HG_HASH$(1):%=--hash %) --url HG || \
|
||||
(TMP_REPO=$$$$($(MKTEMP) --directory) && \
|
||||
$(HG) clone $$(HG_REPO$(1)) $$(HG_REV$(1):%=--rev %) \
|
||||
$$(HG_REV$(1):%=--updaterev %) \
|
||||
$$(HG_BRANCH$(1):%=--branch %) \
|
||||
$$$${TMP_REPO} && \
|
||||
$(HG) -R $$$${TMP_REPO} archive --prefix $$(COMPONENT_SRC$(1)) $$@ && \
|
||||
$(RM) -rf $${TMP_REPO} && \
|
||||
HG_HASH=$$$$(digest -a sha256 $$@) && \
|
||||
$(GSED) -i \
|
||||
-e "s/\(HG_HASH$(1)[[:space:]]*=[[:space:]]*\).*/\1sha256:$$$${HG_HASH}/" \
|
||||
Makefile)
|
||||
|
||||
USERLAND_REQUIRED_PACKAGES += developer/versioning/mercurial
|
||||
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
# Evaluate the variable assignments immediately.
|
||||
$(eval $(call hg-variables,))
|
||||
$(foreach suffix, $(HG_SUFFIXES), $(eval $(call hg-variables,_$(suffix))))
|
||||
|
||||
$(eval $(call hg-rules,))
|
||||
$(foreach suffix, $(HG_SUFFIXES), $(eval $(call hg-rules,_$(suffix))))
|
||||
|
||||
endif
|
||||
111
sample_data/make-rules/prep-patch.mk
Normal file
111
sample_data/make-rules/prep-patch.mk
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
GPATCH = /usr/gnu/bin/patch
|
||||
PATCH_LEVEL ?= 1
|
||||
GPATCH_BACKUP = --backup --version-control=numbered
|
||||
GPATCH_FLAGS = --strip=$(PATCH_LEVEL) $(GPATCH_BACKUP)
|
||||
|
||||
#
|
||||
# Rules for patching source that is downloaded and unpacked or pulled from
|
||||
# a source repository. Patches should be named
|
||||
# patches/{patch-file-name}.patch{version} where {patch-file-name} is a
|
||||
# meaningful name for the patch contents and {version} corresponds to the
|
||||
# COMPONENT_NAME{version} of the source to be patched. Typically, version
|
||||
# would be something like "_1", "_2", ... After all {version} patches have
|
||||
# been applied, a final set of patches without a {version} suffix may be
|
||||
# applied.
|
||||
#
|
||||
# PATCH_DIR can be overridden to move patches to a different location
|
||||
# PATCH_PATTERN can be overridden to adjust the patch naming scheme that the
|
||||
# build recognizes.
|
||||
# ADDITIONAL_PATCHES can be defined in the component Makefile to include
|
||||
# additional patches.
|
||||
#
|
||||
|
||||
PATCH_PATTERN ?= *.patch*
|
||||
|
||||
PATCH_DIR ?= patches
|
||||
# patches specific to parfait builds.
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
PARFAIT_PATCH_DIR = parfait
|
||||
endif
|
||||
|
||||
PATCHES = $(shell find $(PATCH_DIR) $(PARFAIT_PATCH_DIR) -type f \
|
||||
-name '$(PATCH_PATTERN)' 2>/dev/null | \
|
||||
LC_COLLATE=C sort)
|
||||
|
||||
PCH_SUFFIXES = $(patsubst .patch_%,%, $(filter-out .patch,$(suffix $(PATCHES))))
|
||||
|
||||
define patch-rule
|
||||
|
||||
ifeq ($(1),_0)
|
||||
PATCH_PATTERN$(1) ?= %.patch
|
||||
PATCHES$(1) = $(filter %.patch,$(PATCHES))
|
||||
else
|
||||
PATCH_PATTERN$(1) ?= %.patch$(1)
|
||||
PATCHES$(1) = $(filter %.patch$(1),$(PATCHES))
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(ADDITIONAL_PATCHES$(1))),)
|
||||
PATCHES$(1) += $(ADDITIONAL_PATCHES$(1))
|
||||
endif
|
||||
|
||||
ifneq ($$(PATCHES$(1)),)
|
||||
PATCH_STAMPS$(1) += $$(PATCHES$(1):$(PATCH_DIR)/%=$$(SOURCE_DIR$(1))/.patched-%)
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
PATCH_STAMPS$(1) += $$(PATCHES$(1):$(PARFAIT_PATCH_DIR)/%=$$(SOURCE_DIR$(1))/.patched-%)
|
||||
endif
|
||||
|
||||
# We should unpack the source that we patch before we patch it.
|
||||
$$(PATCH_STAMPS$(1)): unpack
|
||||
|
||||
# Adding MAKEFILE_PREREQ because gmake seems to evaluate the need to patch
|
||||
# before re-unpacking if the Makefile changed. The various stamps are
|
||||
# removed as part of the unpacking process, and it doesn't appear to
|
||||
# re-evaluate the need for patching. If we ever move the stamps to the build
|
||||
# directory, we may not need the dependency any more.
|
||||
$$(SOURCE_DIR$(1))/.patched-%: $(PATCH_DIR)/% $(MAKEFILE_PREREQ)
|
||||
$(GPATCH) -d $$(@D) $$(GPATCH_FLAGS) < $$<
|
||||
$(TOUCH) $$(@)
|
||||
|
||||
$$(SOURCE_DIR$(1))/.patched-%: $(PARFAIT_PATCH_DIR)/% $(MAKEFILE_PREREQ)
|
||||
$(GPATCH) -d $$(@D) $$(GPATCH_FLAGS) < $$<
|
||||
$(TOUCH) $$(@)
|
||||
|
||||
$$(SOURCE_DIR$(1))/.patched: $$(PATCH_STAMPS$(1))
|
||||
$(TOUCH) $$(@)
|
||||
|
||||
patch:: $$(SOURCE_DIR$(1))/.patched
|
||||
|
||||
USERLAND_REQUIRED_PACKAGES += text/gnu-patch
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
#
|
||||
# Define the rules required to download any source archives and augment any
|
||||
# cleanup macros.
|
||||
#
|
||||
$(foreach suffix, $(PCH_SUFFIXES), $(eval $(call patch-rule,_$(suffix))))
|
||||
$(eval $(call patch-rule,)) # this must be last so we don't drop *.patch_%.
|
||||
84
sample_data/make-rules/prep-svn.mk
Normal file
84
sample_data/make-rules/prep-svn.mk
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
SVN = /usr/bin/svn
|
||||
MKTEMP = /usr/gnu/bin/mktemp
|
||||
|
||||
COMPONENT_PREP_SVN?=yes
|
||||
ifeq ($(strip $(COMPONENT_PREP_SVN)), yes)
|
||||
|
||||
#
|
||||
# Anything that we pull from a Subversion repo must have a SVN_REPO{_[0-9]+} and
|
||||
# SVN_REV{_[0-9]+} to match.
|
||||
#
|
||||
|
||||
SVN_SUFFIXES = $(subst SVN_REPO_,, $(filter SVN_REPO_%, $(.VARIABLES)))
|
||||
|
||||
define subversion-rules
|
||||
ifdef SVN_REPO$(1)
|
||||
ifdef SVN_REV$(1)
|
||||
|
||||
COMPONENT_SRC$(1) = $$(COMPONENT_NAME$(1))-$$(SVN_REV$(1))
|
||||
COMPONENT_ARCHIVE$(1) = $$(COMPONENT_SRC$(1)).tar.bz2
|
||||
COMPONENT_ARCHIVE_SRC$(1) = svn
|
||||
|
||||
CLEAN_PATHS += $$(COMPONENT_SRC$(1))
|
||||
CLOBBER_PATHS += COMPONENT_ARCHIVE$(1)
|
||||
SOURCE_DIR$(1) = $$(COMPONENT_DIR)/$(COMPONENT_SRC$(1))
|
||||
|
||||
download:: $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
|
||||
|
||||
# First attempt to download a cached archive of the SCM repo at the proper
|
||||
# changeset ID. If that fails, create an archive by cloning the SCM repo,
|
||||
# updating to the selected changeset, archiving that directory, and cleaning up # when complete.
|
||||
$$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)): $(MAKEFILE_PREREQ)
|
||||
$$(FETCH) --file $$@ $$(SVN_HASH$(1):%=--hash %) --url SVN || \
|
||||
(TMP_REPO=$$$$($(MKTEMP) --directory --dry-run) && \
|
||||
$(SVN) export $$(SVN_REPO$(1)) $$(SVN_REV$(1):%=--revision %) \
|
||||
$$$${TMP_REPO} && \
|
||||
/usr/gnu/bin/tar --create --file - --absolute-names \
|
||||
--sort=name --mtime="2018-10-05 00:00Z" --owner=0 --group=0 --numeric-owner \
|
||||
--transform="s;$$$${TMP_REPO};$$(COMPONENT_SRC$(1));g" \
|
||||
--bzip2 $$$${TMP_REPO} >$$@ && \
|
||||
$(RM) -rf $$$${TMP_REPO} && \
|
||||
SVN_HASH=$$$$(digest -a sha256 $$@) && \
|
||||
$(GSED) -i \
|
||||
-e "s/^SVN_HASH$(1)=.*/SVN_HASH$(1)= sha256:$$$${SVN_HASH}/" \
|
||||
Makefile)
|
||||
|
||||
USERLAND_REQUIRED_PACKAGES += developer/versioning/subversion
|
||||
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
#
|
||||
# Define the rules required to download any source archives and augment any
|
||||
# cleanup macros.
|
||||
#
|
||||
$(eval $(call subversion-rules,))
|
||||
$(foreach suffix, $(SVN_SUFFIXES), $(eval $(call subversion-rules,_$(suffix))))
|
||||
|
||||
endif
|
||||
76
sample_data/make-rules/prep-unpack.mk
Normal file
76
sample_data/make-rules/prep-unpack.mk
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, Michal Nowak
|
||||
#
|
||||
|
||||
UNPACK = $(WS_TOOLS)/userland-unpack
|
||||
|
||||
#
|
||||
# Anything that we downloaded and want to unpack must have a
|
||||
# COMPONENT_ARCHIVE{_[0-9]+} macro.
|
||||
#
|
||||
PCK_SUFFIXES = $(subst COMPONENT_ARCHIVE_,, \
|
||||
$(filter COMPONENT_ARCHIVE_%, $(.VARIABLES)))
|
||||
|
||||
# Template for unpacking rules.
|
||||
define unpack-rules
|
||||
ifdef COMPONENT_ARCHIVE$(1)
|
||||
ifdef COMPONENT_SRC$(1)
|
||||
|
||||
CLEAN_PATHS += $$(COMPONENT_SRC$(1))
|
||||
SOURCE_DIR$(1) = $$(COMPONENT_DIR)/$(COMPONENT_SRC$(1))
|
||||
|
||||
UNPACK_STAMP$(1) = $$(SOURCE_DIR$(1))/.unpacked
|
||||
|
||||
# RUBY_VERSION is passed on to ensure userland-unpack uses the
|
||||
# correct gem command for the ruby version specified
|
||||
$$(UNPACK_STAMP$(1)): $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)) $(MAKEFILE_PREREQ) download
|
||||
$$(RM) -r $$(SOURCE_DIR$(1))
|
||||
$(ENV) RUBY_VERSION=$(RUBY_VERSION) \
|
||||
$$(UNPACK) $$(UNPACK_ARGS$(1)) $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
|
||||
$$(COMPONENT_POST_UNPACK_ACTION$(1))
|
||||
$$(TOUCH) $$@
|
||||
|
||||
unpack:: $$(UNPACK_STAMP$(1))
|
||||
|
||||
USERLAND_REQUIRED_PACKAGES += archiver/gnu-tar
|
||||
USERLAND_REQUIRED_PACKAGES += compress/bzip2
|
||||
USERLAND_REQUIRED_PACKAGES += compress/gzip
|
||||
USERLAND_REQUIRED_PACKAGES += compress/p7zip
|
||||
USERLAND_REQUIRED_PACKAGES += compress/unzip
|
||||
USERLAND_REQUIRED_PACKAGES += compress/lzip
|
||||
USERLAND_REQUIRED_PACKAGES += compress/xz
|
||||
USERLAND_REQUIRED_PACKAGES += compress/zip
|
||||
USERLAND_REQUIRED_PACKAGES += compress/zstd
|
||||
USERLAND_REQUIRED_PACKAGES += developer/java/openjdk8
|
||||
USERLAND_REQUIRED_PACKAGES += runtime/ruby
|
||||
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
#
|
||||
# Define the rules required to download any source archives and augment any
|
||||
# cleanup macros.
|
||||
#
|
||||
$(eval $(call unpack-rules,))
|
||||
$(foreach suffix, $(PCK_SUFFIXES), $(eval $(call unpack-rules,_$(suffix))))
|
||||
51
sample_data/make-rules/prep.mk
Normal file
51
sample_data/make-rules/prep.mk
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
include $(WS_MAKE_RULES)/prep-download.mk
|
||||
|
||||
include $(WS_MAKE_RULES)/prep-hg.mk
|
||||
include $(WS_MAKE_RULES)/prep-git.mk
|
||||
include $(WS_MAKE_RULES)/prep-svn.mk
|
||||
include $(WS_MAKE_RULES)/prep-unpack.mk
|
||||
include $(WS_MAKE_RULES)/prep-patch.mk
|
||||
|
||||
download::
|
||||
|
||||
unpack:: download
|
||||
|
||||
patch:: unpack
|
||||
|
||||
$(SOURCE_DIR)/.prep: component-environment-prep download unpack patch
|
||||
$(COMPONENT_PREP_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
prep:: $(SOURCE_DIR)/.prep
|
||||
|
||||
clean::
|
||||
$(PRE_CLEAN_ACTION)
|
||||
$(RM) -r $(CLEAN_PATHS)
|
||||
|
||||
clobber:: clean
|
||||
$(RM) -r $(CLOBBER_PATHS)
|
||||
43
sample_data/make-rules/ruby.mk
Normal file
43
sample_data/make-rules/ruby.mk
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
# This is only useful for a single ruby version substtution NOT using
|
||||
# -RUBYVER and -GENFRAG manifests
|
||||
|
||||
# Transform file paths for ruby version without creating version specific
|
||||
# packages
|
||||
PKG_MACROS += RUBY_VERSION=$(RUBY_VERSION)
|
||||
PKG_MACROS += RUBY_LIB_VERSION=$(RUBY_LIB_VERSION)
|
||||
PKG_MACROS += RUBYV=$(subst .,,$(RUBY_VERSION))
|
||||
VENDOR_RUBY = /usr/ruby/$(RUBY_VERSION)/lib/ruby/vendor_ruby/$(RUBY_LIB_VERSION)
|
||||
VENDOR_RUBY_ARCH = /usr/ruby/$(RUBY_VERSION)/lib/ruby/vendor_ruby/$(RUBY_LIB_VERSION)/$(MACH64)-solaris$(SOLARIS_VERSION)
|
||||
|
||||
# Modify ruby scripts in the ruby-version-specific path of the proto area,
|
||||
# under usr/ruby/$(RUBY_VERSION), containing "#!/usr/bin/env ruby" to
|
||||
# use the version-specific ruby path, defined by the $(RUBY_VERSION) macro.
|
||||
# Without this change, the mediated ruby version in /usr/bin/ruby
|
||||
# will probably be used, which may not match the ruby
|
||||
# version supported by the component.
|
||||
COMPONENT_POST_INSTALL_ACTION += \
|
||||
cd $(PROTO_DIR)/usr/ruby/$(RUBY_VERSION); \
|
||||
$(RUBY_SCRIPT_FIX_FUNC);
|
||||
185
sample_data/make-rules/setup.py.mk
Normal file
185
sample_data/make-rules/setup.py.mk
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
# Set default PyPI name
|
||||
COMPONENT_PYPI?=$(COMPONENT_NAME)
|
||||
# Set default to PyPI url
|
||||
COMPONENT_ARCHIVE_URL?=$(call pypi_url)
|
||||
|
||||
define python-rule
|
||||
$(BUILD_DIR)/%-$(1)/.built: PYTHON_VERSION=$(1)
|
||||
$(BUILD_DIR)/%-$(1)/.installed: PYTHON_VERSION=$(1)
|
||||
$(BUILD_DIR)/%-$(1)/.tested: PYTHON_VERSION=$(1)
|
||||
$(BUILD_DIR)/%-$(1)/.tested-and-compared: PYTHON_VERSION=$(1)
|
||||
endef
|
||||
|
||||
$(foreach pyver, $(PYTHON_VERSIONS), $(eval $(call python-rule,$(pyver))))
|
||||
|
||||
$(BUILD_DIR)/$(MACH32)-%/.built: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.built: BITS=64
|
||||
$(BUILD_DIR)/$(MACH32)-%/.installed: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.installed: BITS=64
|
||||
$(BUILD_DIR)/$(MACH32)-%/.tested: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.tested: BITS=64
|
||||
$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared: BITS=64
|
||||
|
||||
PYTHON_32_VERSIONS = $(filter-out $(PYTHON_64_ONLY_VERSIONS), $(PYTHON_VERSIONS))
|
||||
|
||||
BUILD_32 = $(PYTHON_32_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.built)
|
||||
BUILD_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
|
||||
BUILD_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.built)
|
||||
|
||||
ifeq ($(filter-out $(PYTHON_64_ONLY_VERSIONS), $(PYTHON_VERSION)),)
|
||||
BUILD_32_and_64 = $(BUILD_64)
|
||||
endif
|
||||
|
||||
INSTALL_32 = $(PYTHON_32_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.installed)
|
||||
INSTALL_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
|
||||
INSTALL_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.installed)
|
||||
|
||||
PYTHON_ENV = CC="$(CC)"
|
||||
PYTHON_ENV += CFLAGS="$(CFLAGS)"
|
||||
PYTHON_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
|
||||
|
||||
COMPONENT_BUILD_ENV += $(PYTHON_ENV)
|
||||
COMPONENT_INSTALL_ENV += $(PYTHON_ENV)
|
||||
COMPONENT_TEST_ENV += $(PYTHON_ENV)
|
||||
|
||||
# Reset arguments specified as environmnent variables
|
||||
COMPONENT_BUILD_ARGS =
|
||||
|
||||
# If we are building Python 3.5 support, build it and install it
|
||||
# before Python 2.7, so 2.7 is installed last and is the canonical version.
|
||||
# When we change the default, the new default should go last.
|
||||
ifneq ($(findstring 3.5,$(PYTHON_VERSIONS)),)
|
||||
$(BUILD_DIR)/%-2.7/.built: $(BUILD_DIR)/%-3.5/.built
|
||||
$(BUILD_DIR)/%-2.7/.installed: $(BUILD_DIR)/%-3.5/.installed
|
||||
endif
|
||||
|
||||
# Create a distutils config file specific to the combination of build
|
||||
# characteristics (bittedness x Python version), and put it in its own
|
||||
# directory. We can set $HOME to point distutils at it later, allowing
|
||||
# the install phase to find the temporary build directories.
|
||||
CFG=.pydistutils.cfg
|
||||
$(BUILD_DIR)/config-%/$(CFG):
|
||||
$(MKDIR) $(@D)
|
||||
echo "[build]\nbuild_base = $(BUILD_DIR)/$*" > $@
|
||||
|
||||
# build the configured source
|
||||
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep $(BUILD_DIR)/config-%/$(CFG)
|
||||
$(RM) -r $(@D) ; $(MKDIR) $(@D)
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
(cd $(SOURCE_DIR) ; $(ENV) HOME=$(BUILD_DIR)/config-$* $(COMPONENT_BUILD_ENV) \
|
||||
$(PYTHON.$(BITS)) ./setup.py build $(COMPONENT_BUILD_ARGS))
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
-$(PARFAIT) $(SOURCE_DIR)/$(@D:$(BUILD_DIR)/%=%)
|
||||
endif
|
||||
$(TOUCH) $@
|
||||
|
||||
|
||||
COMPONENT_INSTALL_ARGS += --root $(PROTO_DIR)
|
||||
COMPONENT_INSTALL_ARGS += --install-lib=$(PYTHON_LIB)
|
||||
COMPONENT_INSTALL_ARGS += --install-purelib=$(PYTHON_LIB)
|
||||
COMPONENT_INSTALL_ARGS += --install-platlib=$(PYTHON_LIB)
|
||||
COMPONENT_INSTALL_ARGS += --install-data=$(PYTHON_DATA)
|
||||
COMPONENT_INSTALL_ARGS += --force
|
||||
|
||||
# install the built source into a prototype area
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built $(BUILD_DIR)/config-%/$(CFG)
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
(cd $(SOURCE_DIR) ; $(ENV) HOME=$(BUILD_DIR)/config-$* $(COMPONENT_INSTALL_ENV) \
|
||||
$(PYTHON.$(BITS)) ./setup.py install $(COMPONENT_INSTALL_ARGS))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# Define bit specific and Python version specific filenames.
|
||||
ifeq ($(strip $(USE_COMMON_TEST_MASTER)),no)
|
||||
COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-$(PYTHON_VERSION)-$(BITS).master
|
||||
endif
|
||||
COMPONENT_TEST_OUTPUT = $(COMPONENT_TEST_BUILD_DIR)/test-$(PYTHON_VERSION)-$(BITS)-results
|
||||
COMPONENT_TEST_DIFFS = $(COMPONENT_TEST_BUILD_DIR)/test-$(PYTHON_VERSION)-$(BITS)-diffs
|
||||
COMPONENT_TEST_SNAPSHOT = $(COMPONENT_TEST_BUILD_DIR)/results-$(PYTHON_VERSION)-$(BITS).snapshot
|
||||
COMPONENT_TEST_TRANSFORM_CMD = $(COMPONENT_TEST_BUILD_DIR)/transform-$(PYTHON_VERSION)-$(BITS)-results
|
||||
|
||||
COMPONENT_TEST_DEP = $(BUILD_DIR)/%/.installed
|
||||
COMPONENT_TEST_DIR = $(COMPONENT_SRC)/test
|
||||
COMPONENT_TEST_ENV_CMD = $(ENV)
|
||||
COMPONENT_TEST_ENV += PYTHONPATH=$(PROTO_DIR)$(PYTHON_VENDOR_PACKAGES)
|
||||
COMPONENT_TEST_CMD = $(PYTHON)
|
||||
COMPONENT_TEST_ARGS += ./runtests.py
|
||||
|
||||
# determine the type of tests we want to run.
|
||||
ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR)/results-*.master)),)
|
||||
TEST_32 = $(PYTHON_32_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested)
|
||||
TEST_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested)
|
||||
TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested)
|
||||
else
|
||||
TEST_32 = $(PYTHON_32_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared)
|
||||
TEST_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared)
|
||||
TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested-and-compared)
|
||||
endif
|
||||
|
||||
# test the built source
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(COMPONENT_TEST_DEP)
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) $(COMPONENT_TEST_ARGS)) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(COMPONENT_TEST_DEP)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) $(COMPONENT_TEST_ARGS))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
parfait: install
|
||||
-$(PARFAIT) build
|
||||
else
|
||||
parfait:
|
||||
$(MAKE) PARFAIT_BUILD=yes parfait
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(RM) -r $(SOURCE_DIR) $(BUILD_DIR)
|
||||
|
||||
# Make it easy to construct a URL for a pypi source download. This
|
||||
# construct supports an optional call to a number from
|
||||
# NUM_EXTRA_ARCHIVES for multiple archive downloads.
|
||||
pypi_url_multi = pypi:///$(COMPONENT_NAME_$(1))==$(COMPONENT_VERSION_$(1))
|
||||
pypi_url_single = pypi:///$(COMPONENT_NAME)==$(COMPONENT_VERSION)
|
||||
pypi_url = $(if $(COMPONENT_NAME_$(1)),$(pypi_url_multi),$(pypi_url_single))
|
||||
1435
sample_data/make-rules/shared-macros.mk
Normal file
1435
sample_data/make-rules/shared-macros.mk
Normal file
File diff suppressed because it is too large
Load diff
81
sample_data/make-rules/shared-targets.mk
Normal file
81
sample_data/make-rules/shared-targets.mk
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# (hopefully) helpful common targets.
|
||||
#
|
||||
|
||||
PROTOMAN1FILES=$(MAN1FILES:%=$(PROTOUSRSHAREMAN1DIR)/%)
|
||||
PROTOMAN1MFILES=$(MAN1MFILES:%=$(PROTOUSRSHAREMAN1MDIR)/%)
|
||||
PROTOMAN3FILES=$(MAN3FILES:%=$(PROTOUSRSHAREMAN3DIR)/%)
|
||||
PROTOMAN4FILES=$(MAN4FILES:%=$(PROTOUSRSHAREMAN4DIR)/%)
|
||||
|
||||
$(PROTOUSRSHAREMAN1DIR)/% $(PROTOUSRSHAREMAN1MDIR)/% $(PROTOUSRSHAREMAN3DIR)/% \
|
||||
$(PROTOUSRSHAREMAN4DIR)/%: manpages/%
|
||||
$(INS.file)
|
||||
|
||||
PROTOSFWLINKS= $(SFWPROGS:%=$(PROTOSFWBIN)/%)
|
||||
|
||||
$(PROTOSFWLINKS): $(PROTOSFWBIN)
|
||||
$(RM) $@ ; $(SYMLINK) ../../bin/$(@F) $@
|
||||
|
||||
PROTOSFWMAN1LINKS= $(SFWMAN1:%=$(PROTOSFWSHAREMAN1)/%)
|
||||
|
||||
$(PROTOSFWMAN1LINKS): $(PROTOSFWSHAREMAN1)
|
||||
$(RM) $@ ; $(SYMLINK) ../../../../share/man/man1/$(@F) $@
|
||||
|
||||
PROTOGNULINKS= $(GNUPROGS:%=$(PROTOGNUBIN)/%)
|
||||
|
||||
$(PROTOGNULINKS): $(PROTOGNUBIN)
|
||||
$(RM) $@ ; $(SYMLINK) ../../bin/g$(@F) $@
|
||||
|
||||
PROTOGNUMAN1LINKS = $(GNUMAN1:%=$(PROTOGNUSHAREMAN1)/%)
|
||||
|
||||
$(PROTOGNUMAN1LINKS): $(PROTOGNUSHAREMAN1)
|
||||
$(RM) $@ ; $(SYMLINK) ../../../../share/man/man1/g$(@F) $@
|
||||
|
||||
|
||||
$(PROTOETCDIR) \
|
||||
$(PROTOETCSECDIR) \
|
||||
$(PROTOLIBDIR) \
|
||||
$(PROTOUSRSHAREMAN1DIR) \
|
||||
$(PROTOUSRSHAREMAN1MDIR) \
|
||||
$(PROTOUSRSHAREMAN3DIR) \
|
||||
$(PROTOUSRSHAREMAN4DIR) \
|
||||
$(PROTOUSRSHAREDOCDIR) \
|
||||
$(PROTOGNUBIN) \
|
||||
$(PROTOGNUSHAREMAN1) \
|
||||
$(PROTOSFWBIN) \
|
||||
$(PROTOSFWSHAREMAN1) \
|
||||
$(PROTOUSRSBINDIR) \
|
||||
$(PROTOUSRBINDIR):
|
||||
$(MKDIR) $@
|
||||
|
||||
|
||||
$(PROTOMAN1FILES): $(PROTOUSRSHAREMAN1DIR)
|
||||
|
||||
$(PROTOMAN1MFILES): $(PROTOUSRSHAREMAN1MDIR)
|
||||
|
||||
$(PROTOMAN3FILES): $(PROTOUSRSHAREMAN3DIR)
|
||||
|
||||
$(PROTOMAN4FILES): $(PROTOUSRSHAREMAN4DIR)
|
||||
246
sample_data/make-rules/waf.mk
Normal file
246
sample_data/make-rules/waf.mk
Normal file
|
|
@ -0,0 +1,246 @@
|
|||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
#
|
||||
# Rules and Macros for building opens source software that uses the waf
|
||||
# build system from https://waf.io/
|
||||
#
|
||||
# To use these rules, include $(WS_MAKE_RULES)/waf.mk in your Makefile
|
||||
# and define "build", "install" targets appropriate to building your component.
|
||||
# Ex:
|
||||
#
|
||||
# build: $(BUILD_32) \
|
||||
# $(BUILD_64)
|
||||
#
|
||||
# install: $(INSTALL_32) \
|
||||
# $(INSTALL_64)
|
||||
#
|
||||
# Any additional pre/post configure, build, or install actions can be specified
|
||||
# in your Makefile by setting them in on of the following macros:
|
||||
# COMPONENT_PRE_BUILD_ACTION, COMPONENT_POST_BUILD_ACTION
|
||||
# COMPONENT_PRE_INSTALL_ACTION, COMPONENT_POST_INSTALL_ACTION
|
||||
#
|
||||
# If component specific make targets need to be used for build or install, they
|
||||
# can be specified in
|
||||
# COMPONENT_BUILD_TARGETS, COMPONENT_INSTALL_TARGETS
|
||||
#
|
||||
|
||||
# Defaults to looking for waf script in top level of cloned source
|
||||
WAF = $(PYTHON) waf
|
||||
|
||||
CONFIGURE_PREFIX = /usr
|
||||
|
||||
ifeq ($(strip $(PREFERRED_BITS)),64)
|
||||
CONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/bin/$(MACH32)
|
||||
CONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin
|
||||
CONFIGURE_SBINDIR.32 = $(CONFIGURE_PREFIX)/sbin/$(MACH32)
|
||||
CONFIGURE_SBINDIR.64 = $(CONFIGURE_PREFIX)/sbin
|
||||
else
|
||||
CONFIGURE_BINDIR.32 = $(CONFIGURE_PREFIX)/bin
|
||||
CONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin/$(MACH64)
|
||||
CONFIGURE_SBINDIR.32 = $(CONFIGURE_PREFIX)/sbin
|
||||
CONFIGURE_SBINDIR.64 = $(CONFIGURE_PREFIX)/sbin/$(MACH64)
|
||||
endif
|
||||
CONFIGURE_LIBDIR.32 = $(CONFIGURE_PREFIX)/lib
|
||||
CONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib/$(MACH64)
|
||||
CONFIGURE_MANDIR = $(CONFIGURE_PREFIX)/share/man
|
||||
CONFIGURE_LOCALEDIR = $(CONFIGURE_PREFIX)/share/locale
|
||||
|
||||
CONFIGURE_DEFAULT_DIRS?=yes
|
||||
CONFIGURE_OPTIONS += --prefix=$(CONFIGURE_PREFIX)
|
||||
ifeq ($(CONFIGURE_DEFAULT_DIRS),yes)
|
||||
CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
|
||||
ifeq ($(INITIAL_BITS),64)
|
||||
CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.32)
|
||||
CONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_SBINDIR.32)
|
||||
else
|
||||
CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS))
|
||||
CONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_SBINDIR.$(BITS))
|
||||
endif
|
||||
CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))
|
||||
endif
|
||||
CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))
|
||||
CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
|
||||
CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH).$(BITS))
|
||||
|
||||
CONFIGURE_ENV += CC="$(CC) $(CC_BITS)"
|
||||
CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
|
||||
CONFIGURE_ENV += CXX="$(CXX) $(CC_BITS)"
|
||||
CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
|
||||
CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
|
||||
CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"
|
||||
CONFIGURE_ENV += PYTHON="$(PYTHON)"
|
||||
CONFIGURE_ENV += PYTHONDIR="$(PYTHON_LIB)"
|
||||
CONFIGURE_ENV += PYTHONARCHDIR="$(PYTHON_VENDOR_PACKAGES)"
|
||||
|
||||
# configure the unpacked source
|
||||
COMPONENT_CONFIGURE_TARGETS ?= configure
|
||||
|
||||
$(BUILD_DIR_32)/.configured: BITS=32
|
||||
$(BUILD_DIR_64)/.configured: BITS=64
|
||||
$(BUILD_DIR)/$(MACH32)-%/.configured: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.configured: BITS=64
|
||||
$(foreach pyver, $(PYTHON_VERSIONS), \
|
||||
$(eval $(BUILD_DIR)/%-$(pyver)/.configured: PYTHON_VERSION=$(pyver)) \
|
||||
)
|
||||
|
||||
$(BUILD_DIR)/%/.configured: $(SOURCE_DIR)/.prep
|
||||
$(RM) -r $(@D) ; $(MKDIR) $(@D)
|
||||
$(CLONEY) $(SOURCE_DIR) $(@D)
|
||||
$(COMPONENT_PRE_CONFIGURE_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(CONFIGURE_ENV) \
|
||||
$(WAF) $(COMPONENT_CONFIGURE_TARGETS) $(CONFIGURE_OPTIONS))
|
||||
$(COMPONENT_POST_CONFIGURE_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# build the configured source
|
||||
COMPONENT_BUILD_TARGETS ?= build
|
||||
|
||||
$(BUILD_DIR_32)/.built: BITS=32
|
||||
$(BUILD_DIR_64)/.built: BITS=64
|
||||
$(BUILD_DIR)/$(MACH32)-%/.built: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.built: BITS=64
|
||||
$(foreach pyver, $(PYTHON_VERSIONS), \
|
||||
$(eval $(BUILD_DIR)/%-$(pyver)/.built: PYTHON_VERSION=$(pyver)) \
|
||||
)
|
||||
|
||||
$(BUILD_DIR)/%/.built: $(BUILD_DIR)/%/.configured
|
||||
$(COMPONENT_PRE_BUILD_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
|
||||
$(WAF) $(COMPONENT_BUILD_TARGETS) $(COMPONENT_BUILD_ARGS))
|
||||
$(COMPONENT_POST_BUILD_ACTION)
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
-$(PARFAIT) $(@D)
|
||||
endif
|
||||
$(TOUCH) $@
|
||||
|
||||
# If BUILD_STYLE is set, provide a default configure target.
|
||||
ifeq ($(strip $(BUILD_STYLE)),waf)
|
||||
configure: $(CONFIGURE_$(MK_BITS))
|
||||
endif
|
||||
|
||||
# install the built source into a prototype area
|
||||
COMPONENT_INSTALL_ARGS += --destdir=$(PROTO_DIR)
|
||||
COMPONENT_INSTALL_ARGS += $(COMPONENT_INSTALL_ARGS.$(BITS))
|
||||
|
||||
$(BUILD_DIR_32)/.installed: BITS=32
|
||||
$(BUILD_DIR_64)/.installed: BITS=64
|
||||
$(BUILD_DIR)/$(MACH32)-%/.installed: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.installed: BITS=64
|
||||
$(foreach pyver, $(PYTHON_VERSIONS), \
|
||||
$(eval $(BUILD_DIR)/%-$(pyver)/.installed: PYTHON_VERSION=$(pyver)) \
|
||||
)
|
||||
|
||||
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_INSTALL_ACTION)
|
||||
(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
|
||||
$(WAF) $(COMPONENT_INSTALL_TARGETS) $(COMPONENT_INSTALL_ARGS))
|
||||
$(COMPONENT_POST_INSTALL_ACTION)
|
||||
$(TOUCH) $@
|
||||
|
||||
# test the built source
|
||||
COMPONENT_TEST_CMD = $(WAF)
|
||||
COMPONENT_TEST_TARGETS = test
|
||||
|
||||
$(BUILD_DIR_32)/.tested-and-compared: BITS=32
|
||||
$(BUILD_DIR_64)/.tested-and-compared: BITS=64
|
||||
$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared: BITS=64
|
||||
$(foreach pyver, $(PYTHON_VERSIONS), \
|
||||
$(eval $(BUILD_DIR)/%-$(pyver)/.tested-and-compared: PYTHON_VERSION=$(pyver)) \
|
||||
)
|
||||
|
||||
$(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
-(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_TARGETS) $(COMPONENT_TEST_ARGS)) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR_32)/.tested: BITS=32
|
||||
$(BUILD_DIR_64)/.tested: BITS=64
|
||||
$(BUILD_DIR)/$(MACH32)-%/.tested: BITS=32
|
||||
$(BUILD_DIR)/$(MACH64)-%/.tested: BITS=64
|
||||
$(foreach pyver, $(PYTHON_VERSIONS), \
|
||||
$(eval $(BUILD_DIR)/%-$(pyver)/.tested: PYTHON_VERSION=$(pyver)) \
|
||||
)
|
||||
|
||||
$(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
|
||||
$(COMPONENT_PRE_TEST_ACTION)
|
||||
(cd $(COMPONENT_TEST_DIR) ; \
|
||||
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
|
||||
$(COMPONENT_TEST_CMD) \
|
||||
$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
|
||||
$(COMPONENT_POST_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
# Test the installed packages. The targets above depend on .built which
|
||||
# means $(CLONEY) has already run. System-test needs cloning but not
|
||||
# building; thus ideally, we would want to depend on .cloned here and below,
|
||||
# but since we don't have that, we depend on .prep and run $(CLONEY) here.
|
||||
$(BUILD_DIR)/%/.system-tested-and-compared: $(SOURCE_DIR)/.prep
|
||||
$(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
|
||||
$(CLONEY) $(SOURCE_DIR) $(@D)
|
||||
$(COMPONENT_PRE_SYSTEM_TEST_ACTION)
|
||||
-(cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
|
||||
$(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
|
||||
$(COMPONENT_SYSTEM_TEST_CMD) \
|
||||
$(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS)) \
|
||||
&> $(COMPONENT_TEST_OUTPUT)
|
||||
$(COMPONENT_POST_SYSTEM_TEST_ACTION)
|
||||
$(COMPONENT_TEST_CREATE_TRANSFORMS)
|
||||
$(COMPONENT_TEST_PERFORM_TRANSFORM)
|
||||
$(COMPONENT_TEST_COMPARE)
|
||||
$(COMPONENT_SYSTEM_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(BUILD_DIR)/%/.system-tested: $(SOURCE_DIR)/.prep
|
||||
$(CLONEY) $(SOURCE_DIR) $(@D)
|
||||
$(COMPONENT_PRE_SYSTEM_TEST_ACTION)
|
||||
(cd $(COMPONENT_SYSTEM_TEST_DIR) ; \
|
||||
$(COMPONENT_SYSTEM_TEST_ENV_CMD) $(COMPONENT_SYSTEM_TEST_ENV) \
|
||||
$(COMPONENT_SYSTEM_TEST_CMD) \
|
||||
$(COMPONENT_SYSTEM_TEST_ARGS) $(COMPONENT_SYSTEM_TEST_TARGETS))
|
||||
$(COMPONENT_POST_SYSTEM_TEST_ACTION)
|
||||
$(COMPONENT_SYSTEM_TEST_CLEANUP)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(strip $(PARFAIT_BUILD)),yes)
|
||||
parfait: build
|
||||
else
|
||||
parfait:
|
||||
$(MAKE) PARFAIT_BUILD=yes parfait
|
||||
endif
|
||||
|
||||
clean::
|
||||
$(RM) -r $(BUILD_DIR) $(PROTO_DIR)
|
||||
145
sample_data/make-rules/x11.mk
Normal file
145
sample_data/make-rules/x11.mk
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"). You may
|
||||
# only use this file in accordance with the terms of the CDDL.
|
||||
#
|
||||
# A full copy of the text of the CDDL should have accompanied this
|
||||
# source. A copy of the CDDL is also available via the Internet at
|
||||
# http://www.illumos.org/license/CDDL.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2017, Aurelien Larcher. All rights reserved.
|
||||
#
|
||||
|
||||
# All X11 components should now prefer 64-bits unless specified
|
||||
|
||||
PREFERRED_BITS=64
|
||||
|
||||
#
|
||||
# General macros
|
||||
#
|
||||
PKG_X11_VERSION=7.7
|
||||
|
||||
X11_COMPONENTS_DIR = $(WS_COMPONENTS)/x11
|
||||
|
||||
#
|
||||
# Provide macros for commonly used urls
|
||||
#
|
||||
|
||||
XORG_PROJECT_URL = https://www.x.org/
|
||||
XORG_BASE_URL = https://www.x.org/releases/individual
|
||||
SOLARIS_XORG_URL = https://github.com/oracle/solaris-userland
|
||||
|
||||
XORG_APP_BASE_URL = $(XORG_BASE_URL)/app
|
||||
XORG_DATA_BASE_URL = $(XORG_BASE_URL)/data
|
||||
XORG_DOC_BASE_URL = $(XORG_BASE_URL)/doc
|
||||
XORG_DRIVER_BASE_URL = $(XORG_BASE_URL)/driver
|
||||
XORG_FONT_BASE_URL = $(XORG_BASE_URL)/font
|
||||
XORG_LIB_BASE_URL = $(XORG_BASE_URL)/lib
|
||||
XORG_PROTO_BASE_URL = $(XORG_BASE_URL)/proto
|
||||
XORG_TEST_BASE_URL = $(XORG_BASE_URL)/test
|
||||
XORG_UTIL_BASE_URL = $(XORG_BASE_URL)/util
|
||||
XORG_XCB_BASE_URL = $(XORG_BASE_URL)/xcb
|
||||
XORG_XSERVER_BASE_URL = $(XORG_BASE_URL)/xserver
|
||||
|
||||
#
|
||||
# Default X11 component values
|
||||
#
|
||||
COMPONENT_X11_DEFAULTS?= yes
|
||||
ifeq ($(COMPONENT_X11_DEFAULTS),yes)
|
||||
COMPONENT_PROJECT_URL ?= $(XORG_PROJECT_URL)
|
||||
COMPONENT_SRC ?= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
|
||||
COMPONENT_ARCHIVE ?= $(COMPONENT_SRC).tar.bz2
|
||||
ifneq ($(strip $(X11_CATEGORY)),)
|
||||
COMPONENT_ARCHIVE_URL ?= $(XORG_$(X11_CATEGORY)_BASE_URL)/$(COMPONENT_ARCHIVE)
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Set defaults for X11 applications
|
||||
#
|
||||
ifeq ($(strip $(X11_CATEGORY)),APP)
|
||||
BUILD_BITS = 64
|
||||
PATH=$(PATH.gnu)
|
||||
COMPONENT_CLASSIFICATION = System/X11
|
||||
COMPONENT_LICENSE = MIT License
|
||||
endif
|
||||
|
||||
#
|
||||
# Set defaults for X11 libraries
|
||||
#
|
||||
ifeq ($(strip $(X11_CATEGORY)),LIB)
|
||||
BUILD_BITS = 32_and_64
|
||||
PATH=$(PATH.gnu)
|
||||
COMPONENT_CLASSIFICATION = System/X11
|
||||
COMPONENT_LICENSE = MIT License
|
||||
endif
|
||||
|
||||
#
|
||||
# Set defaults for X11 drivers
|
||||
#
|
||||
ifeq ($(strip $(X11_CATEGORY)),DRIVER)
|
||||
BUILD_BITS = 64
|
||||
PATH=$(PATH.gnu)
|
||||
ifneq (,$(findstring video,$(COMPONENT_NAME)))
|
||||
COMPONENT_CLASSIFICATION = Drivers/Display
|
||||
else
|
||||
COMPONENT_CLASSIFICATION = Drivers/Other Peripherals
|
||||
endif
|
||||
COMPONENT_LICENSE = MIT License
|
||||
COMPONENT_LICENSE_FILE = COPYING
|
||||
COMPONENT_PREP_ACTION = ( cd $(@D) && \
|
||||
libtoolize --automake --copy --force && \
|
||||
aclocal && \
|
||||
autoheader && \
|
||||
automake -a -f -c && \
|
||||
autoconf )
|
||||
endif
|
||||
|
||||
#
|
||||
# Set no test target by default
|
||||
#
|
||||
TEST_TARGET = $(NO_TESTS)
|
||||
|
||||
#
|
||||
# Define library and modules install paths
|
||||
#
|
||||
|
||||
XORG_LIBDIR.32 = $(USRLIBDIR)/xorg
|
||||
XORG_LIBDIR.64 = $(USRLIBDIR)/xorg/$(MACH64)
|
||||
XORG_LIBDIR = $(XORG_LIBDIR.$(BITS))
|
||||
|
||||
X11_SERVERMOD_SUBDIR.32=
|
||||
X11_SERVERMOD_SUBDIR.64=/$(MACH64)
|
||||
X11_SERVERMOD_SUBDIR=$(X11_SERVERMOD_SUBDIR.$(BITS))
|
||||
|
||||
X11_SERVERLIBS_DIR = $(USRLIBDIR)/xorg$(X11_SERVERMOD_SUBDIR)
|
||||
X11_SERVERMODS_DIR = $(USRLIBDIR)/xorg/modules$(X11_SERVERMOD_SUBDIR)
|
||||
|
||||
X11_SERVERMODS_DRI_DIR = $(USRLIBDIR)/xorg/modules/dri$(X11_SERVERMOD_SUBDIR)
|
||||
X11_SERVERMODS_DRIVERS_DIR = $(USRLIBDIR)/xorg/modules/drivers$(X11_SERVERMOD_SUBDIR)
|
||||
X11_SERVERMODS_EXTENSIONS_DIR = $(USRLIBDIR)/xorg/modules/extensions$(X11_SERVERMOD_SUBDIR)
|
||||
x11_SERVERMODS_INPUT_DIR = $(USRLIBDIR)/xorg/modules/input$(X11_SERVERMOD_SUBDIR)
|
||||
X11_SERVERMODS_MULTIMEDIA_DIR = $(USRLIBDIR)/xorg/modules/multimedia$(X11_SERVERMOD_SUBDIR)
|
||||
|
||||
#
|
||||
# Define MESA paths
|
||||
#
|
||||
|
||||
MESA_XSERVERLIBS_DIR = $(USRLIBDIR)/mesa$(X11_SERVERMOD_SUBDIR)
|
||||
MESA_XSERVERMODS_DIR = $(USRLIBDIR)/mesa/modules$(X11_SERVERMOD_SUBDIR)
|
||||
|
||||
MESA_XSERVERMODS_EXTENSIONS_DIR = $(USRLIBDIR)/mesa/modules/extensions$(X11_SERVERMOD_SUBDIR)
|
||||
|
||||
#
|
||||
# Define PKG macros
|
||||
#
|
||||
|
||||
PKG_MACROS += X11PKGVERS=$(PKG_X11_VERSION)
|
||||
|
||||
#
|
||||
# Default build dependencies
|
||||
#
|
||||
REQUIRED_PACKAGES += x11/header/x11-protocols
|
||||
REQUIRED_PACKAGES += developer/build/autoconf/xorg-macros
|
||||
|
||||
Loading…
Add table
Reference in a new issue