components/hwdata/Makefile
branchs11u2-sru
changeset 4160 79f95089d021
parent 2855 576d5a7857b7
equal deleted inserted replaced
4157:92532a6159e7 4160:79f95089d021
    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, 2013, Oracle and/or its affiliates. All rights reserved.
    21 # Copyright (c) 2011, 2015, 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
    33 # simply check in new versions to update them.
    33 # simply check in new versions to update them.
    34 #
    34 #
    35 # When it's time to update, you can use these rules to download with
    35 # When it's time to update, you can use these rules to download with
    36 # 'gmake -B pci.ids usb.ids'   After updating the data files, ensure
    36 # 'gmake -B pci.ids usb.ids'   After updating the data files, ensure
    37 # that the header with version/date and license info is still being 
    37 # that the header with version/date and license info is still being 
    38 # correctly extracted and copied into the generated license files.
    38 # correctly extracted and copied into the generated license files,
       
    39 # and run 'gmake test' to verify there are no invalid or control chars
       
    40 # in the files.
    39 
    41 
    40 download::
    42 download::
    41 	@echo 'No downloads for this component'
    43 	@echo 'No downloads for this component'
    42 
    44 
    43 ID_FILES = pci.ids usb.ids
    45 ID_FILES = pci.ids usb.ids
    80 $(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
    82 $(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
    81 	$(GSED) -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
    83 	$(GSED) -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
    82 
    84 
    83 install build: $(BUILT_LICENSES)
    85 install build: $(BUILT_LICENSES)
    84 
    86 
    85 test:	$(NO_TESTS)
    87 # Ensure there are no control characters/escape sequences or invalid UTF-8
       
    88 # characters in the *.ids text files.
       
    89 test: $(BUILD_DIR)
       
    90 	@ export LC_ALL='en_US.UTF-8' ; \
       
    91 	for f in $(ID_FILES) ; do \
       
    92 		tr -cd '[:print:][:space:]' < $$f > $(BUILD_DIR)/$$f.clean \
       
    93 		&& diff -u $$f $(BUILD_DIR)/$$f.clean ; \
       
    94 		if (( $$? == 0 )) ; then \
       
    95 			print $$f PASSED ; \
       
    96 		else \
       
    97 			print $$f FAILED ; \
       
    98 		fi \
       
    99 	done
    86 
   100 
    87 clobber clean::
   101 clobber clean::
    88 	$(RM) -r $(BUILD_DIR)
   102 	$(RM) -r $(BUILD_DIR)
    89 
   103 
    90 include ../../make-rules/depend.mk
   104 include ../../make-rules/depend.mk