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