make-rules/ips.mk
changeset 2054 5f403d9bcaad
parent 1948 2d1537e7942d
child 2060 a9ad5cd0ec29
equal deleted inserted replaced
2053:05887df74b3a 2054:5f403d9bcaad
   134 PERLNV_MANIFESTS = $(shell echo $(PERL_MANIFESTS) | sed -e 's/-PERLVER//')
   134 PERLNV_MANIFESTS = $(shell echo $(PERL_MANIFESTS) | sed -e 's/-PERLVER//')
   135 else
   135 else
   136 NOPERL_MANIFESTS = $(UNVERSIONED_MANIFESTS)
   136 NOPERL_MANIFESTS = $(UNVERSIONED_MANIFESTS)
   137 endif
   137 endif
   138 
   138 
       
   139 # Look for manifests which need to be duplicated for each version of ruby.
       
   140 # NOPERL_MANIFESTS represents the manifests that are not Python or
       
   141 # Perl manifests.  Extract the Ruby Manifests from NOPERL_MANIFESTS.
       
   142 # Any remaining manifests are stored in NONRUBY_MANIFESTS
       
   143 ifeq ($(findstring -RUBYVER,$(NOPERL_MANIFESTS)),-RUBYVER)
       
   144 NORUBY_MANIFESTS = $(filter-out %GENFRAG.p5m,\
       
   145 		   $(filter-out %-RUBYVER.p5m,$(NOPERL_MANIFESTS)))
       
   146 RUBY_MANIFESTS = $(filter %-RUBYVER.p5m,$(NOPERL_MANIFESTS))
       
   147 RUBYV_MANIFESTS = $(foreach v,$(shell echo $(RUBY_VERSIONS)),\
       
   148                       $(shell echo $(RUBY_MANIFESTS) |\
       
   149                       sed -e 's/-RUBYVER.p5m/-$(shell echo $(v) |\
       
   150                       cut -d. -f1,2 | tr -d .).p5m/g'))
       
   151 RUBYNV_MANIFESTS = $(shell echo $(RUBY_MANIFESTS) | sed -e 's/-RUBYVER//')
       
   152 else
       
   153 NORUBY_MANIFESTS = $(NOPERL_MANIFESTS)
       
   154 endif
       
   155 
   139 VERSIONED_MANIFESTS = \
   156 VERSIONED_MANIFESTS = \
   140 	$(PYV_MANIFESTS) $(PYNV_MANIFESTS) \
   157 	$(PYV_MANIFESTS) $(PYNV_MANIFESTS) \
   141 	$(PERLV_MANIFESTS) $(PERLNV_MANIFESTS) \
   158 	$(PERLV_MANIFESTS) $(PERLNV_MANIFESTS) \
   142 	$(NOPERL_MANIFESTS)
   159 	$(RUBYV_MANIFESTS) $(RUBYNV_MANIFESTS) \
       
   160 	$(NORUBY_MANIFESTS)
   143 
   161 
   144 GENERATED =		$(MANIFEST_BASE)-generated
   162 GENERATED =		$(MANIFEST_BASE)-generated
   145 COMBINED =		$(MANIFEST_BASE)-combined
   163 COMBINED =		$(MANIFEST_BASE)-combined
   146 MANIFESTS =		$(VERSIONED_MANIFESTS:%=$(MANIFEST_BASE)-%)
   164 MANIFESTS =		$(VERSIONED_MANIFESTS:%=$(MANIFEST_BASE)-%)
   147 
   165 
   232 		$(call mkgeneric,runtime/perl,$(ver)))
   250 		$(call mkgeneric,runtime/perl,$(ver)))
   233 
   251 
   234 # Build Perl version-wrapping manifests from the generic version.
   252 # Build Perl version-wrapping manifests from the generic version.
   235 $(MANIFEST_BASE)-%.p5m: %-PERLVER.p5m $(BUILD_DIR)/mkgeneric-perl
   253 $(MANIFEST_BASE)-%.p5m: %-PERLVER.p5m $(BUILD_DIR)/mkgeneric-perl
   236 	$(PKGMOGRIFY) -D PLV=### $(BUILD_DIR)/mkgeneric-perl \
   254 	$(PKGMOGRIFY) -D PLV=### $(BUILD_DIR)/mkgeneric-perl \
       
   255 		$(WS_TOP)/transforms/mkgeneric $< > [email protected]
       
   256 	if [ -f $*-GENFRAG.p5m ]; then cat $*-GENFRAG.p5m >> [email protected]; fi
       
   257 
       
   258 # Define and execute a macro that generates a rule to create a manifest for a
       
   259 # ruby module specific to a particular version of the ruby runtime.
       
   260 # Creates build/manifest-*-modulename-##.p5m file where ## is replaced with
       
   261 # the version number.
       
   262 define ruby-manifest-rule
       
   263 $(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).mogrified: \
       
   264 	PKG_MACROS += RUBY_VERSION=$(1) RUBY_LIB_VERSION=$(2) \
       
   265 	    RUBYV=$(subst .,,$(1))
       
   266 
       
   267 $(MANIFEST_BASE)-%-$(shell echo $(1) | tr -d .).p5m: %-RUBYVER.p5m
       
   268 	if [ -f $$*-$(shell echo $(1) | tr -d .)GENFRAG.p5m ]; then \
       
   269 		cat $$*-$(shell echo $(1) | tr -d .)GENFRAG.p5m >> [email protected]; \
       
   270 	fi
       
   271 	$(PKGMOGRIFY) -D RUBY_VERSION=$(1) -D RUBY_LIB_VERSION=$(2) \
       
   272 	    -D RUBYV=$(shell echo $(1) | tr -d .) $$< > [email protected]
       
   273 endef
       
   274 $(foreach ver,$(RUBY_VERSIONS),\
       
   275 	$(eval $(call ruby-manifest-rule,$(shell echo $(ver) | \
       
   276 	    cut -d. -f1,2),$(ver))))
       
   277 
       
   278 # A rule to create a helper transform package for ruby, that will insert the
       
   279 # appropriate conditional dependencies into a ruby library's
       
   280 # runtime-version-generic package to pull in the version-specific bits when the
       
   281 # corresponding version of ruby is on the system.
       
   282 $(BUILD_DIR)/mkgeneric-ruby: $(WS_TOP)/make-rules/shared-macros.mk
       
   283 	$(RM) [email protected]
       
   284 	$(foreach ver,$(RUBY_VERSIONS),\
       
   285 		$(call mkgeneric,runtime/ruby,$(shell echo $(ver) | \
       
   286 		    cut -d. -f1,2 | tr -d .)))
       
   287 
       
   288 # Build Ruby version-wrapping manifests from the generic version.
       
   289 # Creates build/manifest-*-modulename.p5m file.
       
   290 #
       
   291 # ###PYV### is used here as the mkgeneric() call used to create 
       
   292 # mkgeneric-ruby uses this value version subsitute key.  We also
       
   293 # use the same key, ###PYV###, to pick up the required entry
       
   294 # in mkgeneric when pkgmogrify is invoked
       
   295 $(MANIFEST_BASE)-%.p5m: %-RUBYVER.p5m $(BUILD_DIR)/mkgeneric-ruby
       
   296 	$(PKGMOGRIFY) -D RUBYV=###PYV### $(BUILD_DIR)/mkgeneric-ruby \
   237 		$(WS_TOP)/transforms/mkgeneric $< > [email protected]
   297 		$(WS_TOP)/transforms/mkgeneric $< > [email protected]
   238 	if [ -f $*-GENFRAG.p5m ]; then cat $*-GENFRAG.p5m >> [email protected]; fi
   298 	if [ -f $*-GENFRAG.p5m ]; then cat $*-GENFRAG.p5m >> [email protected]; fi
   239 
   299 
   240 # mogrify non-parameterized manifests
   300 # mogrify non-parameterized manifests
   241 $(MANIFEST_BASE)-%.mogrified:	%.p5m $(BUILD_DIR)
   301 $(MANIFEST_BASE)-%.mogrified:	%.p5m $(BUILD_DIR)