Makefile revision 2899
842ae4bd224140319ae7feec1872b93dfd491143fielding#
842ae4bd224140319ae7feec1872b93dfd491143fielding# CDDL HEADER START
842ae4bd224140319ae7feec1872b93dfd491143fielding#
842ae4bd224140319ae7feec1872b93dfd491143fielding# The contents of this file are subject to the terms of the
842ae4bd224140319ae7feec1872b93dfd491143fielding# Common Development and Distribution License (the "License").
842ae4bd224140319ae7feec1872b93dfd491143fielding# You may not use this file except in compliance with the License.
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere#
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# or http://www.opensolaris.org/os/licensing.
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# See the License for the specific language governing permissions
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# and limitations under the License.
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere#
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# When distributing Covered Code, include this CDDL HEADER in each
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# If applicable, add the following below this CDDL HEADER, with the
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# fields enclosed by brackets "[]" replaced with your own identifying
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh# information: Portions Copyright [yyyy] [name of copyright owner]
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh#
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh# CDDL HEADER END
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh#
948b5a49ace2d603b24ba8f106fa9077a54cdf62jorton# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
948b5a49ace2d603b24ba8f106fa9077a54cdf62jorton#
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianhinclude ../../make-rules/shared-macros.mk
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianhCOMPONENT_NAME= hwdata
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereCOMPONENT_VERSION= 0.5.11
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereTPNO_PCI= 7530
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereTPNO_USB= 7831
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereinclude ../../make-rules/ips.mk
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# Since upstream only offers the latest snapshot for download, without
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# any way to retrieve a specific version, we just keep the currently
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# shipped versions of these two text files directly in the gate and
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# simply check in new versions to update them.
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere#
347c9301068524042be654db3b2b055a9ec20633rpluem# When it's time to update, you can use these rules to download with
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# 'gmake -B pci.ids usb.ids' After updating the data files, ensure
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# that the header with version/date and license info is still being
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# correctly extracted and copied into the generated license files,
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# and run 'gmake test' to verify there are no invalid or control chars
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# in the files.
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfcleredownload::
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere @echo 'No downloads for this component'
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereID_FILES = pci.ids usb.ids
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereCOMPONENT_ARCHIVE_URL_pci.ids = http://pciids.sourceforge.net/v2.2/pci.ids
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereCOMPONENT_ARCHIVE_URL_usb.ids = http://www.linux-usb.org/usb.ids
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereCOMPONENT_ARCHIVE_URLS = $(foreach i,$(ID_FILES),$(COMPONENT_ARCHIVE_URL_$(i)))
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereCOMPONENT_BUGDB= utility/hwdata
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# Retrieve version from ids file
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereID_VERSION_EXTRACT_COMMAND=$(GSED) -n -e '/Version:/ { s/^.*: //p' -e ' q }'
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclerePKG_OPTIONS += -D COMPONENT_ARCHIVE_URLS='$(COMPONENT_ARCHIVE_URLS:%=value="%")'
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclerePKG_MACROS += $(foreach i,$(ID_FILES),\
f1553ab5b144409f25679ffcce2d51e7dc396160mturk COMPONENT_VERSION_$(i)='$(shell $(ID_VERSION_EXTRACT_COMMAND) $(i))')
f1553ab5b144409f25679ffcce2d51e7dc396160mturk
4029f384e87ac5d066944c01cc1d5273ab03f724rjung# This package delivers only data files and has no dependencies.
f1553ab5b144409f25679ffcce2d51e7dc396160mturkEXTDEPFILES = $(NULLDEPFILE)
f1553ab5b144409f25679ffcce2d51e7dc396160mturk
f1553ab5b144409f25679ffcce2d51e7dc396160mturk# Since we have two separately licensed components we don't use the default
f1553ab5b144409f25679ffcce2d51e7dc396160mturk# license transform rules, but handle the license info metadata directly
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereLICENSE_TRANSFORMS =
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere$(ID_FILES):
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere curl -s -o $@ $(COMPONENT_ARCHIVE_URL_$(@F))
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# License files for packaging are generated during the build
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereLICENSES = $(ID_FILES:%=%.license)
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereBUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereASLR_MODE = $(ASLR_NOT_APPLICABLE)
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# Extract the header up to the first blank line
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere$(BUILD_DIR)/%.header: %
870181b1a2eb47ba42f178a90a9ee1763e95b325striker $(MKDIR) $(@D)
4b0079bbadbc65d248523ccda763ace0a50195b3trawick $(GSED) -e '/^$$/ q' $< > $@
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# Generate license files for each document by substituting in templates:
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# __HEADER__ - read in contents of generated header file, then delete the
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# __HEADER__ line
742318b93e89c311f66b55f426c4d9cf2c14628bjim$(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere $(GSED) -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
742318b93e89c311f66b55f426c4d9cf2c14628bjim
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclereinstall build: $(BUILT_LICENSES)
742318b93e89c311f66b55f426c4d9cf2c14628bjim
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere# Ensure there are no control characters/escape sequences or invalid UTF-8
742318b93e89c311f66b55f426c4d9cf2c14628bjim# characters in the *.ids text files.
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfcleretest: $(BUILD_DIR)
742318b93e89c311f66b55f426c4d9cf2c14628bjim @ export LC_ALL='en_US.UTF-8' ; \
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere for f in $(ID_FILES) ; do \
742318b93e89c311f66b55f426c4d9cf2c14628bjim tr -cd '[:print:][:space:]' < $$f > $(BUILD_DIR)/$$f.clean \
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere && diff -u $$f $(BUILD_DIR)/$$f.clean ; \
742318b93e89c311f66b55f426c4d9cf2c14628bjim if (( $$? == 0 )) ; then \
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere print $$f PASSED ; \
742318b93e89c311f66b55f426c4d9cf2c14628bjim else \
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere print $$f FAILED ; \
742318b93e89c311f66b55f426c4d9cf2c14628bjim fi \
6a6dc5dca25dbcfa4c02f232834f3396b976c8bfmturk done
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
742318b93e89c311f66b55f426c4d9cf2c14628bjimclobber clean::
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere $(RM) -r $(BUILD_DIR)
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere
742318b93e89c311f66b55f426c4d9cf2c14628bjiminclude ../../make-rules/depend.mk
aadf50900dfe0e5da15c24f69650e3b3d72601b4jfclere