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