Makefile revision 4337
067e6fbc95594b0edea4ed21eab04b538e2da60cjerenkrantz# CDDL HEADER START
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# The contents of this file are subject to the terms of the
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# Common Development and Distribution License (the "License").
a8d5ccbcbde8cb6cf3a9dcf2eb05f393ab76baa9ianh# You may not use this file except in compliance with the License.
4214e98fc9045e5010e66f9a967bd6d68f40d342aaron# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4a257be29f8aeab984fe5622fa69e0b2aab204d7jerenkrantz# See the License for the specific language governing permissions
91cacb801f6c0215b38322f6d2fc58cbfedfecfbjerenkrantz# and limitations under the License.
df14f0d3a5191cdd7c4bb5b03acd135d43a6f51brbb# When distributing Covered Code, include this CDDL HEADER in each
df14f0d3a5191cdd7c4bb5b03acd135d43a6f51brbb# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ab71b233b3a36489e44a7b061c48293be0b17788jwoolley# If applicable, add the following below this CDDL HEADER, with the
571760de5e60c0b459cb11be45507b923cd023eejwoolley# fields enclosed by brackets "[]" replaced with your own identifying
571760de5e60c0b459cb11be45507b923cd023eejwoolley# information: Portions Copyright [yyyy] [name of copyright owner]
bcb6e1be6041dfeb549c8ea8d37f97ad4e90a0c3rbb# CDDL HEADER END
2900ab946a2d76b73a14cebfe2985d253f01c967stoddard# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# Since upstream only offers the latest snapshot for download, without
af4c982a7cf4515f124935f99a329744035fc699slive# any way to retrieve a specific version, we just keep the currently
af4c982a7cf4515f124935f99a329744035fc699slive# shipped versions of these two text files directly in the gate and
af4c982a7cf4515f124935f99a329744035fc699slive# simply check in new versions to update them.
af4c982a7cf4515f124935f99a329744035fc699slive# When it's time to update, you can use these rules to download with
af4c982a7cf4515f124935f99a329744035fc699slive# 'gmake -B pci.ids usb.ids' After updating the data files, ensure
af4c982a7cf4515f124935f99a329744035fc699slive# that the header with version/date and license info is still being
10270f6f94b2069d0d357805c140a9897449b9ccianh# correctly extracted and copied into the generated license files,
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# and run 'gmake test' to verify there are no invalid or control chars
10270f6f94b2069d0d357805c140a9897449b9ccianh# in the files.
4e3b83f6caecb85d4c139a440254cfa2f98e8960ianh @echo 'No downloads for this component'
a908203473820d096b31fc0f349711d3092ae684larsCOMPONENT_ARCHIVE_URL_pci.ids = http://pciids.sourceforge.net/v2.2/pci.ids
cbd842f948c0ffda90ec0803f0fefc0d7630131cwroweCOMPONENT_ARCHIVE_URL_usb.ids = http://www.linux-usb.org/usb.ids
61ef82825ed37c2c4f02cdfd259f2bd7c80b2bdfbrianpCOMPONENT_ARCHIVE_URLS = $(foreach i,$(ID_FILES),$(COMPONENT_ARCHIVE_URL_$(i)))
10270f6f94b2069d0d357805c140a9897449b9ccianh# Retrieve version from ids file
10270f6f94b2069d0d357805c140a9897449b9ccianhID_VERSION_EXTRACT_COMMAND=$(GSED) -n -e '/Version:/ { s/^.*: //p' -e ' q }'
10270f6f94b2069d0d357805c140a9897449b9ccianhPKG_OPTIONS += -D COMPONENT_ARCHIVE_URLS='$(COMPONENT_ARCHIVE_URLS:%=value="%")'
10270f6f94b2069d0d357805c140a9897449b9ccianh COMPONENT_VERSION_$(i)='$(shell $(ID_VERSION_EXTRACT_COMMAND) $(i))')
10270f6f94b2069d0d357805c140a9897449b9ccianh# Since we have two separately licensed components we don't use the default
10270f6f94b2069d0d357805c140a9897449b9ccianh# license transform rules, but handle the license info metadata directly
ff42f83cbf31893bcde9712332a8e5ee970f6a74trawick# License files for packaging are generated during the build
5c99bd08a9f1f96f37da0239d3365a0025531711gregames# Extract the header up to the first blank line
77304e37d675303eef0355fc3bb9a12bb506547ajerenkrantz# Generate license files for each document by substituting in templates:
ff42f83cbf31893bcde9712332a8e5ee970f6a74trawick# __HEADER__ - read in contents of generated header file, then delete the
77304e37d675303eef0355fc3bb9a12bb506547ajerenkrantz# __HEADER__ line
41ce8eb0053365f3ce1a774ba4239fc9e4fae072wrowe $(GSED) -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
067e6fbc95594b0edea4ed21eab04b538e2da60cjerenkrantz# Ensure there are no control characters/escape sequences or invalid UTF-8
067e6fbc95594b0edea4ed21eab04b538e2da60cjerenkrantz# characters in the *.ids text files.
cbd842f948c0ffda90ec0803f0fefc0d7630131cwrowe tr -cd '[:print:][:space:]' < $$f > $(BUILD_DIR)/$$f.clean \
cbd842f948c0ffda90ec0803f0fefc0d7630131cwrowe print $$f PASSED ; \
cbd842f948c0ffda90ec0803f0fefc0d7630131cwrowe print $$f FAILED ; \