comparison make/jvmci.make @ 21978:f0a982a28944

relax verify_defs_make in jvmci.make for conditional exports
author Doug Simon <doug.simon@oracle.com>
date Tue, 16 Jun 2015 11:25:50 +0200
parents 3ce35131bff2
children ba769b2ee8fa
comparison
equal deleted inserted replaced
21977:a6425aa8f70c 21978:f0a982a28944
89 89
90 # Verifies that make/defs.make contains an appropriate line for each JVMCI service or option 90 # Verifies that make/defs.make contains an appropriate line for each JVMCI service or option
91 # and that only existing JVMCI services and options are exported. 91 # and that only existing JVMCI services and options are exported.
92 # Arguments: 92 # Arguments:
93 # 1: list of service or option files 93 # 1: list of service or option files
94 # 2: prefix to apply to each file to create match pattern 94 # 2: variable name for directory of service or option files
95 define verify_defs_make 95 define verify_defs_make
96 $(eval defs := make/defs.make) 96 $(eval defs := make/defs.make)
97 $(eval exports := $(shell grep '$(2)' make/defs.make | sed 's:.*$(2)::g')) 97 $(eval uncondPattern := EXPORT_LIST += $$$$($(2))/)
98 $(foreach file,$(1),$(if $(findstring $(file),$(exports)), ,$(error "Pattern '$(2)$(file)' not found in $(defs)"))) 98 $(eval condPattern := CONDITIONAL_EXPORT_LIST += $$$$($(2))/)
99 $(foreach export,$(exports),$(if $(findstring $(export),$(1)), ,$(error "The line '$(2)$(export)' should not be in $(defs)"))) 99 $(eval unconditionalExports := $(shell grep '^EXPORT_LIST += $$($2)' make/defs.make | sed 's:.*($(2))/::g'))
100 $(eval conditionalExports := $(shell grep '^CONDITIONAL_EXPORT_LIST += $$($2)' make/defs.make | sed 's:.*($(2))/::g'))
101 $(eval allExports := $(unconditionalExports) $(conditionalExports))
102 $(foreach file,$(1),$(if $(findstring $(file),$(allExports)), ,$(error "Line matching '$(uncondPattern)$(file)' or '$(condPattern)$(file)' not found in $(defs)")))
103 $(foreach export,$(unconditionalExports),$(if $(findstring $(export),$(1)), ,$(error "The line '$(uncondPattern)$(export)' should not be in $(defs)")))
100 endef 104 endef
101 105
102 all: default 106 all: default
103 $(info Put $(EXPORTED_FILES) into SHARED_DIR $(SHARED_DIR)) 107 $(info Put $(EXPORTED_FILES) into SHARED_DIR $(SHARED_DIR))
104 $(QUIETLY) $(shell mkdir -p $(SHARED_DIR)) 108 $(QUIETLY) $(shell mkdir -p $(SHARED_DIR))
105 $(foreach export,$(EXPORTED_FILES),$(call extract,$(export),$(SHARED_DIR))) 109 $(foreach export,$(EXPORTED_FILES),$(call extract,$(export),$(SHARED_DIR)))
106 110
107 export: all 111 export: all
108 $(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.services/*)),EXPORT_LIST += $$(EXPORT_JRE_LIB_JVMCI_SERVICES_DIR)/) 112 $(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.services/*)),EXPORT_JRE_LIB_JVMCI_SERVICES_DIR)
109 $(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.options/*)),EXPORT_LIST += $$(EXPORT_JRE_LIB_JVMCI_OPTIONS_DIR)/) 113 $(call verify_defs_make,$(notdir $(wildcard $(SHARED_DIR)/jvmci.options/*)),EXPORT_JRE_LIB_JVMCI_OPTIONS_DIR)
110 .PHONY: export 114 .PHONY: export
111 115
112 clean: 116 clean:
113 $(QUIETLY) rm $(JARS) 2> /dev/null || true 117 $(QUIETLY) rm $(JARS) 2> /dev/null || true
114 $(QUIETLY) rmdir -p $(dir $(JARS)) 2> /dev/null || true 118 $(QUIETLY) rmdir -p $(dir $(JARS)) 2> /dev/null || true