Makefile revision 1498
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass#
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# CDDL HEADER START
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass#
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# The contents of this file are subject to the terms of the
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# Common Development and Distribution License (the "License").
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# You may not use this file except in compliance with the License.
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass#
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# or http://www.opensolaris.org/os/licensing.
046ea4d1ee0f22d956cd360e1e0c0b275aa4bbd0Dav Glass# See the License for the specific language governing permissions
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# and limitations under the License.
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass#
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# When distributing Covered Code, include this CDDL HEADER in each
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# If applicable, add the following below this CDDL HEADER, with the
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# fields enclosed by brackets "[]" replaced with your own identifying
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# information: Portions Copyright [yyyy] [name of copyright owner]
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass#
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# CDDL HEADER END
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass#
046ea4d1ee0f22d956cd360e1e0c0b275aa4bbd0Dav Glass# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass#
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glassinclude ../../make-rules/shared-macros.mk
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassCOMPONENT_NAME= hwdata
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassCOMPONENT_VERSION= 0.5.11
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glassinclude ../../make-rules/ips.mk
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# Since upstream only offers the latest snapshot for download, without
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# any way to retrieve a specific version, we just keep the currently
046ea4d1ee0f22d956cd360e1e0c0b275aa4bbd0Dav Glass# shipped versions of these two text files directly in the gate and
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# simply check in new versions to update them.
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass#
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# When it's time to update, you can use these rules to download with
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# 'gmake -B pci.ids usb.ids' After updating the data files, ensure
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# that the header with version/date and license info is still being
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# correctly extracted and copied into the generated license files.
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glassdownload::
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass @echo 'No downloads for this component'
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
046ea4d1ee0f22d956cd360e1e0c0b275aa4bbd0Dav GlassID_FILES = pci.ids usb.ids
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassCOMPONENT_ARCHIVE_URL_pci.ids = http://pciids.sourceforge.net/v2.2/pci.ids
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassCOMPONENT_ARCHIVE_URL_usb.ids = http://www.linux-usb.org/usb.ids
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassCOMPONENT_ARCHIVE_URLS = $(foreach i,$(ID_FILES),$(COMPONENT_ARCHIVE_URL_$(i)))
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassCOMPONENT_BUGDB= utility/hwdata
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# Retrieve version from ids file
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassID_VERSION_EXTRACT_COMMAND=$(GSED) -n -e '/Version:/ { s/^.*: //p' -e ' q }'
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassPKG_OPTIONS += -D COMPONENT_ARCHIVE_URLS='$(COMPONENT_ARCHIVE_URLS:%=value="%")'
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassPKG_MACROS += $(foreach i,$(ID_FILES),\
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass COMPONENT_VERSION_$(i)='$(shell $(ID_VERSION_EXTRACT_COMMAND) $(i))')
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# Since we have two separately licensed components we don't use the default
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# license transform rules, but handle the license info metadata directly
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassLICENSE_TRANSFORMS =
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass$(ID_FILES):
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass curl -s -o $@ $(COMPONENT_ARCHIVE_URL_$(@F))
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# License files for packaging are generated during the build
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassLICENSES = $(ID_FILES:%=%.license)
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav GlassBUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# Extract the header up to the first blank line
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass$(BUILD_DIR)/%.header: %
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass $(MKDIR) $(@D)
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass $(GSED) -e '/^$$/ q' $< > $@
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# Generate license files for each document by substituting in templates:
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# __HEADER__ - read in contents of generated header file, then delete the
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass# __HEADER__ line
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass$(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass $(GSED) -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glassinstall build: $(BUILT_LICENSES)
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glasstest: $(NO_TESTS)
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glassclobber clean::
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass $(RM) -r $(BUILD_DIR)
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glassinclude ../../make-rules/depend.mk
5b139d58acfcae4b1bcab5a895706abafc2a87a0Dav Glass