Makefile revision 1574
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt#
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# CDDL HEADER START
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt#
55e5c51e661e23e24573db84114a3837817745c9Evan Hunt# The contents of this file are subject to the terms of the
62d63e5f02a5e7fcda59cf361149e3d7c78477beEvan Hunt# Common Development and Distribution License (the "License").
62d63e5f02a5e7fcda59cf361149e3d7c78477beEvan Hunt# You may not use this file except in compliance with the License.
62d63e5f02a5e7fcda59cf361149e3d7c78477beEvan Hunt#
df925e6c66d45d960fbac0383169763967d2111cEvan Hunt# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
df925e6c66d45d960fbac0383169763967d2111cEvan Hunt# or http://www.opensolaris.org/os/licensing.
df925e6c66d45d960fbac0383169763967d2111cEvan Hunt# See the License for the specific language governing permissions
a81ae06ed3081753a73e7638919673be57eaf47fEvan Hunt# and limitations under the License.
a81ae06ed3081753a73e7638919673be57eaf47fEvan Hunt#
a81ae06ed3081753a73e7638919673be57eaf47fEvan Hunt# When distributing Covered Code, include this CDDL HEADER in each
2425d8bb7ccf5dc956ad12d64d97b5a42e022930Evan Hunt# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2425d8bb7ccf5dc956ad12d64d97b5a42e022930Evan Hunt# If applicable, add the following below this CDDL HEADER, with the
2425d8bb7ccf5dc956ad12d64d97b5a42e022930Evan Hunt# fields enclosed by brackets "[]" replaced with your own identifying
740e7340c55e9f0cf80c6fbbf7e8d3c1bdeaa255Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
740e7340c55e9f0cf80c6fbbf7e8d3c1bdeaa255Mark Andrews#
740e7340c55e9f0cf80c6fbbf7e8d3c1bdeaa255Mark Andrews# CDDL HEADER END
740e7340c55e9f0cf80c6fbbf7e8d3c1bdeaa255Mark Andrews#
740e7340c55e9f0cf80c6fbbf7e8d3c1bdeaa255Mark Andrews# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
3c7df84b2019e454f6333ca354ef709f6451a2abMark Andrews#
3c7df84b2019e454f6333ca354ef709f6451a2abMark Andrewsinclude ../../make-rules/shared-macros.mk
c9297d37593b36de9978c122dbeaf1bb7ae8d19dMark Andrews
c9297d37593b36de9978c122dbeaf1bb7ae8d19dMark AndrewsCOMPONENT_NAME= hwdata
c9297d37593b36de9978c122dbeaf1bb7ae8d19dMark AndrewsCOMPONENT_VERSION= 0.5.11
c9297d37593b36de9978c122dbeaf1bb7ae8d19dMark Andrews
0b8bd3a4ae3efd91f88e8901323faf99b5b06136Evan Huntinclude ../../make-rules/ips.mk
0b8bd3a4ae3efd91f88e8901323faf99b5b06136Evan Hunt
0b8bd3a4ae3efd91f88e8901323faf99b5b06136Evan Hunt# Since upstream only offers the latest snapshot for download, without
7e9ccec63889f2aabee59b94307be492a77fa93bMark Andrews# any way to retrieve a specific version, we just keep the currently
7e9ccec63889f2aabee59b94307be492a77fa93bMark Andrews# shipped versions of these two text files directly in the gate and
b748b5e2c2fa40f758e3b35ad4f1fde99ab5e11fEvan Hunt# simply check in new versions to update them.
b748b5e2c2fa40f758e3b35ad4f1fde99ab5e11fEvan Hunt#
b748b5e2c2fa40f758e3b35ad4f1fde99ab5e11fEvan Hunt# When it's time to update, you can use these rules to download with
8d21efc150998f9643f98ce5a4f0b17460e12043Evan Hunt# 'gmake -B pci.ids usb.ids' After updating the data files, ensure
8d21efc150998f9643f98ce5a4f0b17460e12043Evan Hunt# that the header with version/date and license info is still being
ab7a67829ffe2a7b3220a1cd366bc6255235923aJINMEI Tatuya# correctly extracted and copied into the generated license files.
ab7a67829ffe2a7b3220a1cd366bc6255235923aJINMEI Tatuya
ab7a67829ffe2a7b3220a1cd366bc6255235923aJINMEI Tatuyadownload::
ab7a67829ffe2a7b3220a1cd366bc6255235923aJINMEI Tatuya @echo 'No downloads for this component'
0da7c95546ec1c76ca52f334a68dd69e4fa4dcdeCurtis Blackburn
0da7c95546ec1c76ca52f334a68dd69e4fa4dcdeCurtis BlackburnID_FILES = pci.ids usb.ids
9dac1de625301aeb520cb1e83723d98cd65999eeEvan Hunt
9dac1de625301aeb520cb1e83723d98cd65999eeEvan HuntCOMPONENT_ARCHIVE_URL_pci.ids = http://pciids.sourceforge.net/v2.2/pci.ids
9dac1de625301aeb520cb1e83723d98cd65999eeEvan HuntCOMPONENT_ARCHIVE_URL_usb.ids = http://www.linux-usb.org/usb.ids
9c9b75c43566058727cb89204d36977559cb99afMark AndrewsCOMPONENT_ARCHIVE_URLS = $(foreach i,$(ID_FILES),$(COMPONENT_ARCHIVE_URL_$(i)))
9c9b75c43566058727cb89204d36977559cb99afMark Andrews
9c9b75c43566058727cb89204d36977559cb99afMark AndrewsCOMPONENT_BUGDB= utility/hwdata
cd63e943104ab4f7f8b37da8d49738e91a8db1ddEvan Hunt
cd63e943104ab4f7f8b37da8d49738e91a8db1ddEvan Hunt# Retrieve version from ids file
cd63e943104ab4f7f8b37da8d49738e91a8db1ddEvan HuntID_VERSION_EXTRACT_COMMAND=$(GSED) -n -e '/Version:/ { s/^.*: //p' -e ' q }'
cd63e943104ab4f7f8b37da8d49738e91a8db1ddEvan Hunt
c91c439f80c555f016cce8e9fd910630f81bb5c9Curtis BlackburnPKG_OPTIONS += -D COMPONENT_ARCHIVE_URLS='$(COMPONENT_ARCHIVE_URLS:%=value="%")'
ca385a75a80ad6f5659c3f42b5f852ae498cb79aCurtis BlackburnPKG_MACROS += $(foreach i,$(ID_FILES),\
6225380ca6dd045302fd5cb22d1dbbe6a88a7509Evan Hunt COMPONENT_VERSION_$(i)='$(shell $(ID_VERSION_EXTRACT_COMMAND) $(i))')
6225380ca6dd045302fd5cb22d1dbbe6a88a7509Evan Hunt
6225380ca6dd045302fd5cb22d1dbbe6a88a7509Evan Hunt# Since we have two separately licensed components we don't use the default
c9611b45736af157e2993c6ef852e55e8e24ca83Evan Hunt# license transform rules, but handle the license info metadata directly
c9611b45736af157e2993c6ef852e55e8e24ca83Evan HuntLICENSE_TRANSFORMS =
c91c439f80c555f016cce8e9fd910630f81bb5c9Curtis Blackburn
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan Hunt$(ID_FILES):
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan Hunt curl -s -o $@ $(COMPONENT_ARCHIVE_URL_$(@F))
ffff5d67926821d3db8df63bdd84a9cb1ce56739Evan Hunt
9a0dd99a757c469d9530acd5cb11789b3b0af5ceEvan Hunt# License files for packaging are generated during the build
9a0dd99a757c469d9530acd5cb11789b3b0af5ceEvan HuntLICENSES = $(ID_FILES:%=%.license)
9a0dd99a757c469d9530acd5cb11789b3b0af5ceEvan HuntBUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
9a0dd99a757c469d9530acd5cb11789b3b0af5ceEvan Hunt
641e87a1a0ee716f46b4d0f529e73b58f19aee4eEvan Hunt# Extract the header up to the first blank line
641e87a1a0ee716f46b4d0f529e73b58f19aee4eEvan Hunt$(BUILD_DIR)/%.header: %
641e87a1a0ee716f46b4d0f529e73b58f19aee4eEvan Hunt $(MKDIR) $(@D)
2154c019124246199c7fe494b86860461c8a5f40Evan Hunt $(GSED) -e '/^$$/ q' $< > $@
2154c019124246199c7fe494b86860461c8a5f40Evan Hunt
2154c019124246199c7fe494b86860461c8a5f40Evan Hunt# Generate license files for each document by substituting in templates:
2154c019124246199c7fe494b86860461c8a5f40Evan Hunt# __HEADER__ - read in contents of generated header file, then delete the
214836c18496e0d2630df1cda5eeee13c38b9068Evan Hunt# __HEADER__ line
214836c18496e0d2630df1cda5eeee13c38b9068Evan Hunt$(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
214836c18496e0d2630df1cda5eeee13c38b9068Evan Hunt $(GSED) -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
43d84798fac5cfeeecf9431ef848a9ffdcf0d86fEvan Hunt
43d84798fac5cfeeecf9431ef848a9ffdcf0d86fEvan Huntinstall build: $(BUILT_LICENSES)
43d84798fac5cfeeecf9431ef848a9ffdcf0d86fEvan Hunt
43d84798fac5cfeeecf9431ef848a9ffdcf0d86fEvan Hunttest: $(NO_TESTS)
71f8edccba553c4ed4988dd12ac877564e4987d1Evan Hunt
71f8edccba553c4ed4988dd12ac877564e4987d1Evan Huntclobber clean::
3806133da574f4570db3005473e0d56b746cc6eaEvan Hunt $(RM) -r $(BUILD_DIR)
71f8edccba553c4ed4988dd12ac877564e4987d1Evan Hunt
71f8edccba553c4ed4988dd12ac877564e4987d1Evan Huntinclude ../../make-rules/depend.mk
71f8edccba553c4ed4988dd12ac877564e4987d1Evan Hunt