Makefile revision 1258
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# CDDL HEADER START
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#
2312a9d8e5342846988edcd629e1ac56a8b5d4a9Brendan Mmiller# The contents of this file are subject to the terms of the
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# Common Development and Distribution License (the "License").
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# You may not use this file except in compliance with the License.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# or http://www.opensolaris.org/os/licensing.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# See the License for the specific language governing permissions
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# and limitations under the License.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# When distributing Covered Code, include this CDDL HEADER in each
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# If applicable, add the following below this CDDL HEADER, with the
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# fields enclosed by brackets "[]" replaced with your own identifying
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# information: Portions Copyright [yyyy] [name of copyright owner]
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# CDDL HEADER END
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle#
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienleinclude ../../make-rules/shared-macros.mk
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienleCOMPONENT_NAME= hwdata
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienleCOMPONENT_VERSION= 0.5.11
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincentinclude ../../make-rules/ips.mk
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent# Since upstream only offers the latest snapshot for download, without
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle# any way to retrieve a specific version, we just keep the currently
33c021457bc11072601be0484041e2f46c2616a5Brendan Miller# shipped versions of these two text files directly in the gate and
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle# simply check in new versions to update them.
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle#
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# When it's time to update, you can use these rules to download with
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# 'gmake -B pci.ids usb.ids' After updating the data files, ensure
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# that the header with version/date and license info is still being
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# correctly extracted and copied into the generated license files.
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienledownload::
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle @echo 'No downloads for this component'
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienleID_FILES = pci.ids usb.ids
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienleCOMPONENT_ARCHIVE_URL_pci.ids = http://pciids.sourceforge.net/v2.2/pci.ids
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienleCOMPONENT_ARCHIVE_URL_usb.ids = http://www.linux-usb.org/usb.ids
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienleCOMPONENT_ARCHIVE_URLS = $(foreach i,$(ID_FILES),$(COMPONENT_ARCHIVE_URL_$(i)))
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienleCOMPONENT_BUGDB= utility/hwdata
ad0b283113c3f11ac1877df97d5d0fae899b56caBrendan Mmiller
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienlePKG_OPTIONS += -D COMPONENT_ARCHIVE_URLS='$(COMPONENT_ARCHIVE_URLS:%=value="%")'
21dcdac963f79c098a5ea1a2c5c5e109429c9786Brendan Miller
27d847b55dc37eb425475d2c53b1cf9dfb0b9f61Brendan Miller$(ID_FILES):
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle curl -s -o $@ $(COMPONENT_ARCHIVE_URL_$(@F))
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle# License files for packaging are generated during the build
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienleLICENSES = $(ID_FILES:%=%.license)
331c327f500d45223e8ad933fd4472740a75aeeachad.kienleBUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad KienleTPNO_pci.ids.license = 7530
ad0b283113c3f11ac1877df97d5d0fae899b56caBrendan MmillerTPNO_usb.ids.license = 7831
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# Extract the header up to the first blank line
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle$(BUILD_DIR)/%.header: %
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle $(MKDIR) $(@D)
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle $(GSED) -e '/^$$/ q' $< > $@
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent# Generate license files for each document by substituting in templates:
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle# __FILE_NAME_VERS__ replace with name & version of ids file
331c327f500d45223e8ad933fd4472740a75aeeachad.kienle# __TPNO__ - Oracle tracking number
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# __HEADER__ - read in contents of generated header file, then delete the
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle# __HEADER__ line
b1c33bb0456be2f3b9e866871ff404ae012978b9Chad Kienle$(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle FILENAME="$(basename $(@F))" ; \
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent VERSION="$$(awk -F: '/Version:/ { print $$2 ; exit }' $<)" ; \
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle FILE_NAME_VERS="$${FILENAME}$${VERSION}" ; \
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle $(GSED) -e "s/__FILE_NAME_VERS__/$${FILE_NAME_VERS}/" \
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle -e 's/__TPNO__/$(TPNO_$(@F))/' \
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
49ca89f51e0242b83f998f16a269dc1982460f02Chad Kienle
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienleinstall build: $(BUILT_LICENSES)
2312a9d8e5342846988edcd629e1ac56a8b5d4a9Brendan Mmiller
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienletest: $(NO_TESTS)
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienleclobber clean::
bdcef189d83ab13d06dde11499a03b16cdb5b432Chad Kienle $(RM) -r $(BUILD_DIR)
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincentinclude ../../make-rules/depend.mk
bf6542c5aa722eb97a0df17e6db46cc884f203bfJason Vincent