comparison common/makefiles/IdlCompilation.gmk @ 837:174a54ce39c4

8001931: The new build system whitespace cleanup Reviewed-by: tbell, simonis, erikj
author ihse
date Thu, 10 Oct 2013 14:58:19 +0200
parents dadf49495ab4
children
comparison
equal deleted inserted replaced
836:ec48d637778a 837:174a54ce39c4
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any 22 # or visit www.oracle.com if you need additional information or have any
23 # questions. 23 # questions.
24 # 24 #
25 25
26 PREFIXES=-pkgPrefix CORBA org.omg \ 26 PREFIXES=-pkgPrefix CORBA org.omg \
27 -pkgPrefix CosNaming org.omg \ 27 -pkgPrefix CosNaming org.omg \
28 -pkgPrefix CosTransactions org.omg \ 28 -pkgPrefix CosTransactions org.omg \
29 -pkgPrefix CosTSInteroperation org.omg \ 29 -pkgPrefix CosTSInteroperation org.omg \
30 -pkgPrefix DynamicAny org.omg \ 30 -pkgPrefix DynamicAny org.omg \
31 -pkgPrefix Dynamic org.omg \ 31 -pkgPrefix Dynamic org.omg \
32 -pkgPrefix IOP org.omg \ 32 -pkgPrefix IOP org.omg \
33 -pkgPrefix Messaging org.omg \ 33 -pkgPrefix Messaging org.omg \
34 -pkgPrefix PortableInterceptor org.omg \ 34 -pkgPrefix PortableInterceptor org.omg \
35 -pkgPrefix PortableServer org.omg \ 35 -pkgPrefix PortableServer org.omg \
36 -pkgPrefix activation com.sun.corba.se.spi \ 36 -pkgPrefix activation com.sun.corba.se.spi \
37 -pkgPrefix GIOP com.sun.corba.se \ 37 -pkgPrefix GIOP com.sun.corba.se \
38 -pkgPrefix PortableActivationIDL com.sun.corba.se \ 38 -pkgPrefix PortableActivationIDL com.sun.corba.se \
39 -pkgPrefix messages com.sun.corba.se 39 -pkgPrefix messages com.sun.corba.se
40 40
41 define add_idl_package 41 define add_idl_package
42 # param 1 = MYPACKAGE 42 # param 1 = MYPACKAGE
43 # param 2 = src root 43 # param 2 = src root
44 # param 3 = gensrc root 44 # param 3 = gensrc root
45 # param 4 = source idl to compile 45 # param 4 = source idl to compile
46 # param 5 = target idl package 46 # param 5 = target idl package
47 # param 6 = delete these files that were output from the idlj 47 # param 6 = delete these files that were output from the idlj
48 # param 7 = idls that match these patterns should be compiled with -oldImplBase 48 # param 7 = idls that match these patterns should be compiled with -oldImplBase
49 # param 8 = the idlj command 49 # param 8 = the idlj command
50 # Save the generated java files to a temporary directory so 50 # Save the generated java files to a temporary directory so
51 # that we can find them and create proper dependencies. 51 # that we can find them and create proper dependencies.
52 # After that, we move them to the real gensrc target dir. 52 # After that, we move them to the real gensrc target dir.
53 $4_TMPDIR:=tmp___$(subst /,_,$(patsubst $2/%,%,$4))___ 53 $4_TMPDIR:=tmp___$(subst /,_,$(patsubst $2/%,%,$4))___
54 ifneq ($$(filter $7,$4),) 54 ifneq ($$(filter $7,$4),)
55 $4_OLDIMPLBASE:=-oldImplBase 55 $4_OLDIMPLBASE:=-oldImplBase
56 $4_OLDIMPLBASE_MSG:=with -oldImplBase 56 $4_OLDIMPLBASE_MSG:=with -oldImplBase
57 endif 57 endif
58 $5 : $4 58 $5 : $4
59 $(MKDIR) -p $3/$$($4_TMPDIR) 59 $(MKDIR) -p $3/$$($4_TMPDIR)
60 $(RM) -rf $3/$$($4_TMPDIR) 60 $(RM) -rf $3/$$($4_TMPDIR)
61 $(MKDIR) -p $(dir $5) 61 $(MKDIR) -p $(dir $5)
62 $(ECHO) $(LOG_INFO) Compiling IDL $(patsubst $2/%,%,$4) 62 $(ECHO) $(LOG_INFO) Compiling IDL $(patsubst $2/%,%,$4)
63 $8 -td $3/$$($4_TMPDIR) \ 63 $8 -td $3/$$($4_TMPDIR) \
64 -i $2/org/omg/CORBA \ 64 -i $2/org/omg/CORBA \
65 -i $2/org/omg/PortableInterceptor \ 65 -i $2/org/omg/PortableInterceptor \
66 -i $2/org/omg/PortableServer \ 66 -i $2/org/omg/PortableServer \
67 -D CORBA3 -corba 3.0 \ 67 -D CORBA3 -corba 3.0 \
68 -fall \ 68 -fall \
69 $$($4_OLDIMPLBASE) \ 69 $$($4_OLDIMPLBASE) \
70 $(PREFIXES) \ 70 $(PREFIXES) \
71 $4 71 $4
72 $(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6) 72 $(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6)
73 $(CP) -r $3/$$($4_TMPDIR)/* $3 73 $(CP) -r $3/$$($4_TMPDIR)/* $3
74 ($(CD) $3/$$($4_TMPDIR) && $(FIND) . -type f | $(SED) 's!\./!$3/!g' | $(NAWK) '{ print $$$$1 ": $4" }' > $5) 74 ($(CD) $3/$$($4_TMPDIR) && $(FIND) . -type f | $(SED) 's!\./!$3/!g' | $(NAWK) '{ print $$$$1 ": $4" }' > $5)
75 $(RM) -rf $3/$$($4_TMPDIR) 75 $(RM) -rf $3/$$($4_TMPDIR)
76 endef 76 endef
77 77
78 define SetupIdlCompilation 78 define SetupIdlCompilation
79 # param 1 is for example BUILD_IDLS 79 # param 1 is for example BUILD_IDLS
80 # param 2,3,4,5,6,7,8 are named args. 80 # param 2,3,4,5,6,7,8 are named args.
81 # IDLJ,SRC,BIN,INCLUDES,EXCLUDES,OLDIMPLBASES,DELETES 81 # IDLJ,SRC,BIN,INCLUDES,EXCLUDES,OLDIMPLBASES,DELETES
82 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 82 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
83 $(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) 83 $(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
84 $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk)) 84 $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
85 85
86 # Find all existing java files and existing class files. 86 # Find all existing java files and existing class files.
87 $$(eval $$(call MakeDir,$$($1_BIN))) 87 $$(eval $$(call MakeDir,$$($1_BIN)))
88 $1_SRCS := $$(shell find $$($1_SRC) -name "*.idl") 88 $1_SRCS := $$(shell find $$($1_SRC) -name "*.idl")
89 $1_BINS := $$(shell find $$($1_BIN) -name "*.java") 89 $1_BINS := $$(shell find $$($1_BIN) -name "*.java")
90 # Prepend the source/bin path to the filter expressions. 90 # Prepend the source/bin path to the filter expressions.
91 $1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES)) 91 $1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES))
92 $1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES)) 92 $1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES))
93 $1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES)) 93 $1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES))
94 $1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES)) 94 $1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES))
95 $1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES)) 95 $1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES))
96 # Now remove unwanted java/class files. 96 # Now remove unwanted java/class files.
97 $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS)) 97 $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
98 $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) 98 $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
99 $1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS)) 99 $1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS))
100 $1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS)) 100 $1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS))
101 $1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS))) 101 $1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS)))
102 # Now create the dependencies for each idl target. 102 # Now create the dependencies for each idl target.
103 $$(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)))) 103 $$(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))))
104 endef 104 endef
105 105
106 .SUFFIXES: .java .class .package 106 .SUFFIXES: .java .class .package