Makefile revision 1938
98N/A#
98N/A# CDDL HEADER START
98N/A#
98N/A# The contents of this file are subject to the terms of the
1265N/A# Common Development and Distribution License (the "License").
98N/A# You may not use this file except in compliance with the License.
98N/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, 2013, Oracle and/or its affiliates. All rights reserved.
919N/A#
919N/Ainclude ../../make-rules/shared-macros.mk
919N/A
98N/ACOMPONENT_NAME= hwdata
98N/ACOMPONENT_VERSION= 0.5.11
98N/A
98N/Ainclude ../../make-rules/ips.mk
493N/A
98N/A# Since upstream only offers the latest snapshot for download, without
98N/A# any way to retrieve a specific version, we just keep the currently
1265N/A# shipped versions of these two text files directly in the gate and
98N/A# simply check in new versions to update them.
911N/A#
1265N/A# When it's time to update, you can use these rules to download with
1265N/A# 'gmake -B pci.ids usb.ids' After updating the data files, ensure
1265N/A# that the header with version/date and license info is still being
911N/A# correctly extracted and copied into the generated license files.
98N/A
1265N/Adownload::
691N/A @echo 'No downloads for this component'
691N/A
691N/AID_FILES = pci.ids usb.ids
691N/A
691N/ACOMPONENT_ARCHIVE_URL_pci.ids = http://pciids.sourceforge.net/v2.2/pci.ids
691N/ACOMPONENT_ARCHIVE_URL_usb.ids = http://www.linux-usb.org/usb.ids
98N/ACOMPONENT_ARCHIVE_URLS = $(foreach i,$(ID_FILES),$(COMPONENT_ARCHIVE_URL_$(i)))
98N/A
98N/ACOMPONENT_BUGDB= utility/hwdata
493N/A
98N/A# Retrieve version from ids file
98N/AID_VERSION_EXTRACT_COMMAND=$(GSED) -n -e '/Version:/ { s/^.*: //p' -e ' q }'
965N/A
965N/APKG_OPTIONS += -D COMPONENT_ARCHIVE_URLS='$(COMPONENT_ARCHIVE_URLS:%=value="%")'
965N/APKG_MACROS += $(foreach i,$(ID_FILES),\
493N/A COMPONENT_VERSION_$(i)='$(shell $(ID_VERSION_EXTRACT_COMMAND) $(i))')
1097N/A
1097N/A# This package delivers only data files and has no dependencies.
965N/AEXTDEPFILES = $(NULLDEPFILE)
98N/A
98N/A# Since we have two separately licensed components we don't use the default
# license transform rules, but handle the license info metadata directly
LICENSE_TRANSFORMS =
$(ID_FILES):
curl -s -o $@ $(COMPONENT_ARCHIVE_URL_$(@F))
# License files for packaging are generated during the build
LICENSES = $(ID_FILES:%=%.license)
BUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
ASLR_MODE = $(ASLR_NOT_APPLICABLE)
# Extract the header up to the first blank line
$(BUILD_DIR)/%.header: %
$(MKDIR) $(@D)
$(GSED) -e '/^$$/ q' $< > $@
# Generate license files for each document by substituting in templates:
# __HEADER__ - read in contents of generated header file, then delete the
# __HEADER__ line
$(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
$(GSED) -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