components/hwdata/Makefile
changeset 906 64a7c8b456a0
parent 338 e22e8717ebfa
child 1058 34d7aaa03423
equal deleted inserted replaced
905:b2033895be35 906:64a7c8b456a0
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    18 #
    18 #
    19 # CDDL HEADER END
    19 # CDDL HEADER END
    20 #
    20 #
    21 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    21 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    22 #
    22 #
    23 include ../../make-rules/shared-macros.mk
    23 include ../../make-rules/shared-macros.mk
    24 
    24 
    25 COMPONENT_NAME=         hwdata
    25 COMPONENT_NAME=         hwdata
    26 COMPONENT_VERSION=      0.5.11
    26 COMPONENT_VERSION=      0.5.11
    52 	curl -s -o $@ $(COMPONENT_ARCHIVE_URL_$(@F))
    52 	curl -s -o $@ $(COMPONENT_ARCHIVE_URL_$(@F))
    53 
    53 
    54 # License files for packaging are generated during the build
    54 # License files for packaging are generated during the build
    55 LICENSES = $(ID_FILES:%=%.license)
    55 LICENSES = $(ID_FILES:%=%.license)
    56 BUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
    56 BUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
       
    57 TPNO_pci.ids.license = 7530
       
    58 TPNO_usb.ids.license = 7831
    57 
    59 
    58 # Extract the header up to the first blank line
    60 # Extract the header up to the first blank line
    59 $(BUILD_DIR)/%.header: % $(BUILD_DIR)
    61 $(BUILD_DIR)/%.header: %
       
    62 	$(MKDIR) $(@D)
    60 	$(GSED) -e '/^$$/ q' $< > $@
    63 	$(GSED) -e '/^$$/ q' $< > $@
    61 
    64 
    62 # Generate license files for each document by substituting in templates:
    65 # Generate license files for each document by substituting in templates:
    63 # __FILENAME__ replace with name of ids file (uses basename to strip
    66 # __FILE_NAME_VERS__ replace with name & version of ids file
    64 #		.license suffix, @F to strip the directories from file path)
    67 # __TPNO__ - Oracle tracking number
    65 # __HEADER__ - read in contents of generated header file, then delete the 
    68 # __HEADER__ - read in contents of generated header file, then delete the 
    66 #		__HEADER__ line
    69 #		__HEADER__ line
    67 $(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
    70 $(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
    68 	$(GSED) -e 's/__FILENAME__/$(basename $(@F))/' \
    71 	FILENAME="$(basename $(@F))" ; \
       
    72 	VERSION="$$(awk -F: '/Version:/ { print $$2 ; exit }' $<)" ; \
       
    73 	FILE_NAME_VERS="$${FILENAME}$${VERSION}" ; \
       
    74 	$(GSED) -e "s/__FILE_NAME_VERS__/$${FILE_NAME_VERS}/" \
       
    75 	    -e 's/__TPNO__/$(TPNO_$(@F))/' \
    69 	    -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
    76 	    -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
    70 
    77 
    71 $(BUILD_DIR):
    78 install build: $(BUILT_LICENSES)
    72 	$(MKDIR) $@
       
    73 
       
    74 install build:	$(BUILD_DIR) $(BUILT_LICENSES)
       
    75 
    79 
    76 test:	$(NO_TESTS)
    80 test:	$(NO_TESTS)
    77 
    81 
    78 clobber clean::
    82 clobber clean::
    79 	$(RM) -r $(BUILD_DIR)
    83 	$(RM) -r $(BUILD_DIR)