components/hwdata/Makefile
branchs11-update
changeset 4136 e1ea793cf007
parent 3996 20c0f21bbe1e
equal deleted inserted replaced
4134:b1148b9ffd9b 4136:e1ea793cf007
    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
    27 
    27 
    28 TPNO_PCI=	7530
    28 TPNO_PCI=	21782
    29 TPNO_USB=	7831
    29 TPNO_USB=	21783
    30 
    30 
    31 include $(WS_MAKE_RULES)/ips.mk
    31 include $(WS_MAKE_RULES)/ips.mk
    32 
    32 
    33 # Since upstream only offers the latest snapshot for download, without
    33 # Since upstream only offers the latest snapshot for download, without
    34 # any way to retrieve a specific version, we just keep the currently
    34 # any way to retrieve a specific version, we just keep the currently
    36 # simply check in new versions to update them.
    36 # simply check in new versions to update them.
    37 #
    37 #
    38 # When it's time to update, you can use these rules to download with
    38 # When it's time to update, you can use these rules to download with
    39 # 'gmake -B pci.ids usb.ids'   After updating the data files, ensure
    39 # 'gmake -B pci.ids usb.ids'   After updating the data files, ensure
    40 # that the header with version/date and license info is still being 
    40 # that the header with version/date and license info is still being 
    41 # correctly extracted and copied into the generated license files.
    41 # correctly extracted and copied into the generated license files,
       
    42 # and run 'gmake test' to verify there are no invalid or control chars
       
    43 # in the files.
    42 
    44 
    43 download::
    45 download::
    44 	@echo 'No downloads for this component'
    46 	@echo 'No downloads for this component'
    45 
    47 
    46 ID_FILES = pci.ids usb.ids
    48 ID_FILES = pci.ids usb.ids
    69 
    71 
    70 # License files for packaging are generated during the build
    72 # License files for packaging are generated during the build
    71 LICENSES = $(ID_FILES:%=%.license)
    73 LICENSES = $(ID_FILES:%=%.license)
    72 BUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
    74 BUILT_LICENSES = $(LICENSES:%=$(BUILD_DIR)/%)
    73 
    75 
       
    76 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
       
    77 
    74 # Extract the header up to the first blank line
    78 # Extract the header up to the first blank line
    75 $(BUILD_DIR)/%.header: %
    79 $(BUILD_DIR)/%.header: %
    76 	$(MKDIR) $(@D)
    80 	$(MKDIR) $(@D)
    77 	$(GSED) -e '/^$$/ q' $< > $@
    81 	$(GSED) -e '/^$$/ q' $< > $@
    78 
    82 
    82 $(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
    86 $(BUILD_DIR)/%.license: $(BUILD_DIR)/%.header
    83 	$(GSED) -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
    87 	$(GSED) -e '/__HEADER__/ r $<' -e '/__HEADER__/ d' ids.license.tmpl > $@
    84 
    88 
    85 install build: $(BUILT_LICENSES)
    89 install build: $(BUILT_LICENSES)
    86 
    90 
    87 test:	$(NO_TESTS)
    91 # Ensure there are no control characters/escape sequences or invalid UTF-8
       
    92 # characters in the *.ids text files.
       
    93 test: $(BUILD_DIR)
       
    94 	@ export LC_ALL='en_US.UTF-8' ; \
       
    95 	for f in $(ID_FILES) ; do \
       
    96 		tr -cd '[:print:][:space:]' < $$f > $(BUILD_DIR)/$$f.clean \
       
    97 		&& diff -u $$f $(BUILD_DIR)/$$f.clean ; \
       
    98 		if (( $$? == 0 )) ; then \
       
    99 			print $$f PASSED ; \
       
   100 		else \
       
   101 			print $$f FAILED ; \
       
   102 		fi \
       
   103 	done
    88 
   104 
    89 clobber clean::
   105 clobber clean::
    90 	$(RM) -r $(BUILD_DIR)
   106 	$(RM) -r $(BUILD_DIR)
    91 
   107