190 endif 191 192 # 193 # Create a module library for the specified image location 194 define create-module-library 195 image=$(strip $1); \ 196 mlib=$(MODULE_IMAGES_DIR)/$$image/lib/modules; \ 197 $(ECHO) "Creating module library $$mlib" ; \ 198 $(HOST_JMOD_CMD) create -N -L $$mlib 199 endef 200 201 # Copy module content to the module image 202 # $1 - image location 203 # $2 - module name 204 # 205 define copy-module-content 206 image=$(strip $1); m=$(strip $2); \ 207 javahome=$(MODULE_IMAGES_DIR)/$$image; \ 208 for d in bin lib ; do \ 209 if [ -d $$m/$$d ] ; then \ 210 $(CP) -rf $(ABS_MODULES_DIR)/$$m/$$d $$javahome; \ 211 fi ; \ 212 done 213 endef 214 215 # 216 # Copy JRE image to the dest 217 # $1 - jre image location 218 # $2 - dest location 219 # 220 # Shall investigate if we can eliminate the dependency on this special 221 # copy of the lib/dll files. 222 # Probably better to copy these files to part of the jdk.base.tools module 223 # Also, need to copy jawt.lib. 224 # 225 # Should *_SUFFIX variable either have "." or not dot? 226 # 227 define copy-jre-image 228 from=$(strip $1); dest=$(strip $2); \ 229 ($(CD) $(MODULE_IMAGES_DIR)/$$from && $(FIND) . -depth -print \ 230 | $(CPIO) -pdum $(MODULE_IMAGES_DIR)/$$dest) ; \ 231 if [ -d "$(ABS_MODULES_DIR)/jdk.boot/include" ] ; then \ 232 $(CP) -rf $(ABS_MODULES_DIR)/jdk.boot/include $(MODULE_IMAGES_DIR)/$$dest; \ 233 fi 234 endef 235 236 # 237 # Install jigsaw module 238 # $1 - image location 239 # $2 - module name 240 define install-jigsaw-module 241 image=$(strip $1); m=$(strip $2); \ 242 mlib=$(MODULE_IMAGES_DIR)/$$image/lib/modules; \ 243 mid=`$(HOST_JMOD_CMD) ls -L $$mlib $$m | $(GREP) -v '#'` ; \ 244 if [ "x$$mid" = "x" ] ; then \ 245 $(ECHO) "Installing module $$m in $$image" ; \ 246 $(CD) $(ABS_MODULES_DIR) && \ 247 if [ -d $$m/resources ] ; then \ 248 $(HOST_JMOD_CMD) install $$m/classes -r $$m/resources -L $$mlib $$m || exit 1; \ 249 else \ 250 $(HOST_JMOD_CMD) install $$m/classes -L $$mlib $$m || exit 1; \ 251 fi ; \ 252 $(call copy-module-content,$1,$2) ; \ 253 else \ 254 $(ECHO) "Module $$m already installed in $$image" ; \ 255 fi 256 endef 257 258 259 # Rules for building packages 260 include $(BUILDDIR)/common/BuildPackages.gmk 261 262 PKG_TYPES = jmod-pkgs 263 DEBIAN := $(shell \ 264 if [ -f /etc/debian_version ] ; then \ 265 $(ECHO) true; \ 266 else \ 267 $(ECHO) false; \ 268 fi) 269 270 271 # set BUILD_PACKAGES=false to skip building jmod and native packages 272 # 273 ifeq ($(BUILD_PACKAGES), false) 274 PKG_TYPES = 275 DEBIAN = false 276 endif 277 278 ifeq ($(DEBIAN), true) 279 PKG_TYPES += deb-pkgs 280 endif | 190 endif 191 192 # 193 # Create a module library for the specified image location 194 define create-module-library 195 image=$(strip $1); \ 196 mlib=$(MODULE_IMAGES_DIR)/$$image/lib/modules; \ 197 $(ECHO) "Creating module library $$mlib" ; \ 198 $(HOST_JMOD_CMD) create -N -L $$mlib 199 endef 200 201 # Copy module content to the module image 202 # $1 - image location 203 # $2 - module name 204 # 205 define copy-module-content 206 image=$(strip $1); m=$(strip $2); \ 207 javahome=$(MODULE_IMAGES_DIR)/$$image; \ 208 for d in bin lib ; do \ 209 if [ -d $$m/$$d ] ; then \ 210 $(CP) -rf $(ABS_MODULEPATH_DIR)/$$m/$$d $$javahome; \ 211 fi ; \ 212 done 213 endef 214 215 # 216 # Copy JRE image to the dest 217 # $1 - jre image location 218 # $2 - dest location 219 # 220 # Shall investigate if we can eliminate the dependency on this special 221 # copy of the lib/dll files. 222 # Probably better to copy these files to part of the jdk.base.tools module 223 # Also, need to copy jawt.lib. 224 # 225 # Should *_SUFFIX variable either have "." or not dot? 226 # 227 define copy-jre-image 228 from=$(strip $1); dest=$(strip $2); \ 229 ($(CD) $(MODULE_IMAGES_DIR)/$$from && $(FIND) . -depth -print \ 230 | $(CPIO) -pdum $(MODULE_IMAGES_DIR)/$$dest) ; \ 231 if [ -d "$(ABS_MODULEPATH_DIR)/jdk.boot/include" ] ; then \ 232 $(CP) -rf $(ABS_MODULEPATH_DIR)/jdk.boot/include $(MODULE_IMAGES_DIR)/$$dest; \ 233 fi 234 endef 235 236 # 237 # Install jigsaw module 238 # $1 - image location 239 # $2 - module name 240 define install-jigsaw-module 241 image=$(strip $1); m=$(strip $2); \ 242 mlib=$(MODULE_IMAGES_DIR)/$$image/lib/modules; \ 243 mid=`$(HOST_JMOD_CMD) ls -L $$mlib $$m | $(GREP) -v '#'` ; \ 244 if [ "x$$mid" = "x" ] ; then \ 245 $(ECHO) "Installing module $$m in $$image" ; \ 246 $(CD) $(ABS_MODULEPATH_DIR) && \ 247 if [ -d $$m/resources ] ; then \ 248 $(HOST_JMOD_CMD) install $$m/classes -r $$m/resources -L $$mlib $$m || exit 1; \ 249 else \ 250 $(HOST_JMOD_CMD) install $$m/classes -L $$mlib $$m || exit 1; \ 251 fi ; \ 252 $(call copy-module-content,$1,$2) ; \ 253 else \ 254 $(ECHO) "Module $$m already installed in $$image" ; \ 255 fi 256 endef 257 258 259 # Rules for building packages 260 include $(BUILDDIR)/common/BuildNativePackages.gmk 261 262 PKG_TYPES = jmod-pkgs 263 DEBIAN := $(shell \ 264 if [ -f /etc/debian_version ] ; then \ 265 $(ECHO) true; \ 266 else \ 267 $(ECHO) false; \ 268 fi) 269 270 271 # set BUILD_PACKAGES=false to skip building jmod and native packages 272 # 273 ifeq ($(BUILD_PACKAGES), false) 274 PKG_TYPES = 275 DEBIAN = false 276 endif 277 278 ifeq ($(DEBIAN), true) 279 PKG_TYPES += deb-pkgs 280 endif |