Makefile revision 984
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray# CDDL HEADER START
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco#
cd348e325366620fe047edcc849e3c9424828599Peter Bray# The contents of this file are subject to the terms of the
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Common Development and Distribution License (the "License").
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# You may not use this file except in compliance with the License.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# or http://www.opensolaris.org/os/licensing.
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# See the License for the specific language governing permissions
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# and limitations under the License.
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco#
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# When distributing Covered Code, include this CDDL HEADER in each
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# If applicable, add the following below this CDDL HEADER, with the
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# fields enclosed by brackets "[]" replaced with your own identifying
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# information: Portions Copyright [yyyy] [name of copyright owner]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# CDDL HEADER END
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray#
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Brayinclude ../../make-rules/shared-macros.mk
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayCOMPONENT_NAME= hwdata
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayCOMPONENT_VERSION= 0.5.11
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Brayinclude ../../make-rules/ips.mk
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Since upstream only offers the latest snapshot for download, without
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# any way to retrieve a specific version, we just keep the currently
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# shipped versions of these two text files directly in the gate and
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# simply check in new versions to update them.
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray#
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# When it's time to update, you can use these rules to download with
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# 'gmake -B pci.ids usb.ids' After updating the data files, ensure
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# that the header with version/date and license info is still being
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# correctly extracted and copied into the generated license files.
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Braydownload::
cd348e325366620fe047edcc849e3c9424828599Peter Bray @echo 'No downloads for this component'
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter BrayID_FILES = pci.ids usb.ids
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter BrayCOMPONENT_ARCHIVE_URL_pci.ids = http://pciids.sourceforge.net/v2.2/pci.ids
2b024356b830395446c55f50f9f724a63612e578Lubos KoscoCOMPONENT_ARCHIVE_URL_usb.ids = http://www.linux-usb.org/usb.ids
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter BrayCOMPONENT_ARCHIVE_URLS = $(foreach i,$(ID_FILES),$(COMPONENT_ARCHIVE_URL_$(i)))
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayPKG_OPTIONS += -D COMPONENT_ARCHIVE_URLS='$(COMPONENT_ARCHIVE_URLS:%=value="%")'
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray$(ID_FILES):
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray curl -s -o $@ $(COMPONENT_ARCHIVE_URL_$(@F))
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray# License files for packaging are generated during the build
cd348e325366620fe047edcc849e3c9424828599Peter BrayLICENSES = $(ID_FILES:%=%.license)
cd348e325366620fe047edcc849e3c9424828599Peter BrayBUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
cd348e325366620fe047edcc849e3c9424828599Peter BrayTPNO_pci.ids.license = 7530
cd348e325366620fe047edcc849e3c9424828599Peter BrayTPNO_usb.ids.license = 7831
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Extract the header up to the first blank line
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco$(BUILD_DIR)/%.header: %
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray $(MKDIR) $(@D)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray $(GSED) -e '/^$$/ q' $< > $@
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# Generate license files for each document by substituting in templates:
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# __FILE_NAME_VERS__ replace with name & version of ids file
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# __TPNO__ - Oracle tracking number
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# __HEADER__ - read in contents of generated header file, then delete the
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# __HEADER__ line
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray$(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FILENAME="$(basename $(@F))" ; \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray VERSION="$$(awk -F: '/Version:/ { print $$2 ; exit }' $<)" ; \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FILE_NAME_VERS="$${FILENAME}$${VERSION}" ; \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray $(GSED) -e "s/__FILE_NAME_VERS__/$${FILE_NAME_VERS}/" \
cd348e325366620fe047edcc849e3c9424828599Peter Bray -e 's/__TPNO__/$(TPNO_$(@F))/' \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Brayinstall build: $(BUILT_LICENSES)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Braytest: $(NO_TESTS)
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Brayclobber clean::
cd348e325366620fe047edcc849e3c9424828599Peter Bray $(RM) -r $(BUILD_DIR)
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Brayinclude ../../make-rules/depend.mk
cd348e325366620fe047edcc849e3c9424828599Peter Bray