71 $4 72 $(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6) 73 $(CP) -r $3/$$($4_TMPDIR)/* $3 74 ($(CD) $3/$$($4_TMPDIR) && $(FIND) . -type f | $(SED) 's!\./!$3/!g' | $(NAWK) '{ print $$$$1 ": $4" }' > $5) 75 $(RM) -rf $3/$$($4_TMPDIR) 76 endef 77 78 # Setup make rules for creating an IDL compilation. 79 # 80 # Parameter 1 is the name of the rule. This name is used as variable prefix, 81 # and the targets generated are listed in a variable by that name. 82 # 83 # Remaining parameters are named arguments. These include: 84 # IDLJ 85 # SRC 86 # BIN 87 # INCLUDES 88 # EXCLUDES 89 # OLDIMPLBASES 90 # DELETES 91 define SetupIdlCompilation 92 $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk)) 93 $(call EvalDebugWrapper,$(strip $1),$(call SetupIdlCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))) 94 endef 95 96 define SetupIdlCompilationInner 97 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE)) 98 $(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 99 $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk)) 100 101 # Find all existing java files and existing class files. 102 $$(call MakeDir,$$($1_BIN)) 103 $1_SRCS := $$(shell find $$($1_SRC) -name "*.idl") 104 $1_BINS := $$(shell find $$($1_BIN) -name "*.java") 105 # Prepend the source/bin path to the filter expressions. 106 $1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES)) 107 $1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES)) 108 $1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES)) 109 $1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES)) 110 $1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES)) 111 # Now remove unwanted java/class files. 112 $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) 113 $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) 114 $1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS)) 115 $1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS)) 116 $1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS))) 117 # Now create the dependencies for each idl target. 118 $$(foreach p,$$($1),$$(eval $$(call add_idl_package,$1,$$($1_SRC),$$($1_BIN),$$(patsubst $$($1_BIN)/%.idl.d,$$($1_SRC)/%.idl,$$p),$$p,$$($1_DELETES),$$($1_OLDIMPLBASES),$$($1_IDLJ)))) 119 endef | 71 $4 72 $(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6) 73 $(CP) -r $3/$$($4_TMPDIR)/* $3 74 ($(CD) $3/$$($4_TMPDIR) && $(FIND) . -type f | $(SED) 's!\./!$3/!g' | $(NAWK) '{ print $$$$1 ": $4" }' > $5) 75 $(RM) -rf $3/$$($4_TMPDIR) 76 endef 77 78 # Setup make rules for creating an IDL compilation. 79 # 80 # Parameter 1 is the name of the rule. This name is used as variable prefix, 81 # and the targets generated are listed in a variable by that name. 82 # 83 # Remaining parameters are named arguments. These include: 84 # IDLJ 85 # SRC 86 # BIN 87 # INCLUDES 88 # EXCLUDES 89 # OLDIMPLBASES 90 # DELETES 91 SetupIdlCompilation = $(NamedParamsMacroTemplate) 92 define SetupIdlCompilationBody 93 94 # Find all existing java files and existing class files. 95 $$(call MakeDir,$$($1_BIN)) 96 $1_SRCS := $$(shell find $$($1_SRC) -name "*.idl") 97 $1_BINS := $$(shell find $$($1_BIN) -name "*.java") 98 # Prepend the source/bin path to the filter expressions. 99 $1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES)) 100 $1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES)) 101 $1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES)) 102 $1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES)) 103 $1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES)) 104 # Now remove unwanted java/class files. 105 $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) 106 $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) 107 $1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS)) 108 $1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS)) 109 $1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS))) 110 # Now create the dependencies for each idl target. 111 $$(foreach p,$$($1),$$(eval $$(call add_idl_package,$1,$$($1_SRC),$$($1_BIN),$$(patsubst $$($1_BIN)/%.idl.d,$$($1_SRC)/%.idl,$$p),$$p,$$($1_DELETES),$$($1_OLDIMPLBASES),$$($1_IDLJ)))) 112 endef |