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