components/hwdata/Makefile
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 29 Aug 2012 11:05:56 -0700
changeset 957 255465c5756f
parent 906 64a7c8b456a0
child 1058 34d7aaa03423
permissions -rw-r--r--
Close of build 04.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
302
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     1
#
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     2
# CDDL HEADER START
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     3
#
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     7
#
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    11
# and limitations under the License.
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    12
#
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    18
#
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    19
# CDDL HEADER END
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    20
#
906
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    21
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
302
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    22
#
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    23
include ../../make-rules/shared-macros.mk
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    24
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    25
COMPONENT_NAME=         hwdata
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    26
COMPONENT_VERSION=      0.5.11
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    27
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    28
include ../../make-rules/ips.mk
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    29
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    30
# Since upstream only offers the latest snapshot for download, without
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    31
# any way to retrieve a specific version, we just keep the currently
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    32
# shipped versions of these two text files directly in the gate and 
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    33
# simply check in new versions to update them.
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    34
#
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    35
# When it's time to update, you can use these rules to download with
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    36
# 'gmake -B pci.ids usb.ids'   After updating the data files, ensure
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    37
# that the header with version/date and license info is still being 
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    38
# correctly extracted and copied into the generated license files.
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    39
304
cfebb7b36966 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation (fix downloads)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 302
diff changeset
    40
download::
cfebb7b36966 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation (fix downloads)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 302
diff changeset
    41
	@echo 'No downloads for this component'
cfebb7b36966 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation (fix downloads)
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 302
diff changeset
    42
302
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    43
ID_FILES = pci.ids usb.ids
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    44
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    45
COMPONENT_ARCHIVE_URL_pci.ids =	http://pciids.sourceforge.net/v2.2/pci.ids
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    46
COMPONENT_ARCHIVE_URL_usb.ids =	http://www.linux-usb.org/usb.ids
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    47
COMPONENT_ARCHIVE_URLS = $(foreach i,$(ID_FILES),$(COMPONENT_ARCHIVE_URL_$(i)))
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    48
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    49
PKG_OPTIONS += -D COMPONENT_ARCHIVE_URLS='$(COMPONENT_ARCHIVE_URLS:%=value="%")'
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    50
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    51
$(ID_FILES):
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    52
	curl -s -o [email protected] $(COMPONENT_ARCHIVE_URL_$(@F))
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    53
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    54
# License files for packaging are generated during the build
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    55
LICENSES = $(ID_FILES:%=%.license)
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    56
BUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
906
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    57
TPNO_pci.ids.license = 7530
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    58
TPNO_usb.ids.license = 7831
302
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    59
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    60
# Extract the header up to the first blank line
906
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    61
$(BUILD_DIR)/%.header: %
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    62
	$(MKDIR) $(@D)
302
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    63
	$(GSED) -e '/^$$/ q' $< > [email protected]
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    64
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    65
# Generate license files for each document by substituting in templates:
906
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    66
# __FILE_NAME_VERS__ replace with name & version of ids file
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    67
# __TPNO__ - Oracle tracking number
302
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    68
# __HEADER__ - read in contents of generated header file, then delete the 
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    69
#		__HEADER__ line
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    70
$(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
906
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    71
	FILENAME="$(basename $(@F))" ; \
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    72
	VERSION="$$(awk -F: '/Version:/ { print $$2 ; exit }' $<)" ; \
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    73
	FILE_NAME_VERS="$${FILENAME}$${VERSION}" ; \
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    74
	$(GSED) -e "s/__FILE_NAME_VERS__/$${FILE_NAME_VERS}/" \
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    75
	    -e 's/__TPNO__/$(TPNO_$(@F))/' \
302
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    76
	    -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > [email protected]
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    77
906
64a7c8b456a0 7180963 Update device ids data files to current versions as of 2012.06
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 338
diff changeset
    78
install build: $(BUILT_LICENSES)
302
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    79
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    80
test:	$(NO_TESTS)
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    81
338
e22e8717ebfa 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation (add clobber target)
ulhg@userland.us.oracle.com
parents: 337
diff changeset
    82
clobber clean::
302
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    83
	$(RM) -r $(BUILD_DIR)
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    84
0b738df97c00 7016849 pkg:/system/data/hardware-registry should move to Userland consolidation
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    85
include ../../make-rules/depend.mk