annotate common/makefiles/IdlCompilation.gmk @ 16579:7e2a683462f9

8011372: Remove -p from cp in IdleCompilation.gmk Reviewed-by: pliden, tbell
author erikj
date Thu, 04 Apr 2013 09:25:58 +0200
parents 28d8aefeedd3
children 2792eab0d911
rev   line source
ohair@12258 1 #
ohair@12258 2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@12258 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@12258 4 #
ohair@12258 5 # This code is free software; you can redistribute it and/or modify it
ohair@12258 6 # under the terms of the GNU General Public License version 2 only, as
ohair@12258 7 # published by the Free Software Foundation. Oracle designates this
ohair@12258 8 # particular file as subject to the "Classpath" exception as provided
ohair@12258 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@12258 10 #
ohair@12258 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@12258 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@12258 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@12258 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@12258 15 # accompanied this code).
ohair@12258 16 #
ohair@12258 17 # You should have received a copy of the GNU General Public License version
ohair@12258 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@12258 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@12258 20 #
ohair@12258 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@12258 22 # or visit www.oracle.com if you need additional information or have any
ohair@12258 23 # questions.
ohair@12258 24 #
ohair@12258 25
ohair@12258 26 PREFIXES=-pkgPrefix CORBA org.omg \
ohair@12258 27 -pkgPrefix CosNaming org.omg \
ohair@12258 28 -pkgPrefix CosTransactions org.omg \
ohair@12258 29 -pkgPrefix CosTSInteroperation org.omg \
ohair@12258 30 -pkgPrefix DynamicAny org.omg \
ohair@12258 31 -pkgPrefix Dynamic org.omg \
ohair@12258 32 -pkgPrefix IOP org.omg \
ohair@12258 33 -pkgPrefix Messaging org.omg \
ohair@12258 34 -pkgPrefix PortableInterceptor org.omg \
ohair@12258 35 -pkgPrefix PortableServer org.omg \
ohair@12258 36 -pkgPrefix activation com.sun.corba.se.spi \
ohair@12258 37 -pkgPrefix GIOP com.sun.corba.se \
ohair@12258 38 -pkgPrefix PortableActivationIDL com.sun.corba.se \
ohair@12258 39 -pkgPrefix messages com.sun.corba.se
ohair@12258 40
ohair@12258 41 define add_idl_package
ohair@12258 42 # param 1 = MYPACKAGE
ohair@12258 43 # param 2 = src root
ohair@12258 44 # param 3 = gensrc root
ohair@12258 45 # param 4 = source idl to compile
ohair@12258 46 # param 5 = target idl package
ohair@12258 47 # param 6 = delete these files that were output from the idlj
ohair@12258 48 # param 7 = idls that match these patterns should be compiled with -oldImplBase
ohair@12258 49 # param 8 = the idlj command
ohair@12258 50 # Save the generated java files to a temporary directory so
ohair@12258 51 # that we can find them and create proper dependencies.
ohair@12258 52 # After that, we move them to the real gensrc target dir.
ohair@12258 53 $4_TMPDIR:=tmp___$(subst /,_,$(patsubst $2/%,%,$4))___
ohair@12258 54 ifneq ($$(filter $7,$4),)
ohair@12258 55 $4_OLDIMPLBASE:=-oldImplBase
ohair@12258 56 $4_OLDIMPLBASE_MSG:=with -oldImplBase
ohair@12258 57 endif
ohair@12258 58 $5 : $4
erikj@13133 59 $(MKDIR) -p $3/$$($4_TMPDIR)
erikj@13133 60 $(RM) -rf $3/$$($4_TMPDIR)
erikj@13133 61 $(MKDIR) -p $(dir $5)
ohair@14111 62 $(ECHO) $(LOG_INFO) Compiling IDL $(patsubst $2/%,%,$4)
ohair@12258 63 $8 -td $3/$$($4_TMPDIR) \
ohair@12258 64 -i $2/org/omg/CORBA \
ohair@12258 65 -i $2/org/omg/PortableInterceptor \
ohair@12258 66 -i $2/org/omg/PortableServer \
ohair@12258 67 -D CORBA3 -corba 3.0 \
ohair@12258 68 -fall \
ohair@12258 69 $$($4_OLDIMPLBASE) \
ohair@12258 70 $(PREFIXES) \
ohair@12258 71 $4
erikj@13133 72 $(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6)
erikj@16579 73 $(CP) -r $3/$$($4_TMPDIR)/* $3
tbell@15392 74 ($(CD) $3/$$($4_TMPDIR) && $(FIND) . -type f | $(SED) 's!\./!$3/!g' | $(NAWK) '{ print $$$$1 ": $4" }' > $5)
erikj@13133 75 $(RM) -rf $3/$$($4_TMPDIR)
ohair@12258 76 endef
ohair@12258 77
ohair@12258 78 define SetupIdlCompilation
ohair@12258 79 # param 1 is for example BUILD_IDLS
ohair@12258 80 # param 2,3,4,5,6,7,8 are named args.
ohair@12258 81 # IDLJ,SRC,BIN,INCLUDES,EXCLUDES,OLDIMPLBASES,DELETES
ohair@14111 82 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
ohair@14111 83 $(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
ohair@14111 84 $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
erikj@13132 85
ohair@12258 86 # Remove any relative addressing in the paths.
ohair@12258 87 $1_SRC := $$(abspath $$($1_SRC))
ohair@12258 88 $1_BIN := $$(abspath $$($1_BIN))
ohair@12258 89 # Find all existing java files and existing class files.
erikj@15051 90 $$(eval $$(call MakeDir,$$($1_BIN)))
ohair@12258 91 $1_SRCS := $$(shell find $$($1_SRC) -name "*.idl")
ohair@12258 92 $1_BINS := $$(shell find $$($1_BIN) -name "*.java")
ohair@12258 93 # Prepend the source/bin path to the filter expressions.
ohair@12258 94 $1_SRC_INCLUDES := $$(addprefix $$($1_SRC)/,$$($1_INCLUDES))
ohair@12258 95 $1_SRC_EXCLUDES := $$(addprefix $$($1_SRC)/,$$($1_EXCLUDES))
ohair@12258 96 $1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$($1_INCLUDES))
ohair@12258 97 $1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$($1_EXCLUDES))
ohair@12258 98 $1_OLDIMPLBASES := $$(addprefix $$($1_SRC)/,$$($1_OLDIMPLBASES))
ohair@12258 99 # Now remove unwanted java/class files.
ohair@12258 100 $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
ohair@12258 101 $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
ohair@12258 102 $1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS))
ohair@12258 103 $1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS))
ohair@12258 104 $1 := $$(sort $$(patsubst $$($1_SRC)/%.idl,$$($1_BIN)/%.idl.d,$$($1_SRCS)))
ohair@12258 105 # Now create the dependencies for each idl target.
ohair@12258 106 $$(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))))
ohair@12258 107 endef
ohair@12258 108
ohair@12258 109 .SUFFIXES: .java .class .package