# Makefile - for downloading unpacking and building the OpenJDK # Written by Arnd-Hendrik Mathias mailto:arnd-hendrik.mathias@nefkom.net # This file is written to ease the download, the unpacking and moving of # the trees in the OpenJDK forest and the build process. # Basic variables PROJECT := jdk7 REPOSITORY := http://hg.openjdk.java.net/jdk7/jdk7 CWD := $(shell pwd) # Configurable variables TAG := b24 ARCHIVE := bz2 DOWNLOAD := $(CWD)/archives PLUGS := $(CWD)/plugs/openjdk-binary-plugs BOOT_VER := 1.7.0 BOOT_DIR := $(CWD)/jdk$(BOOT_VER) INST_DIR := /opt/jdk/openjdk-1.7.0_$(TAG) ANT_HOME := /opt/ant/apache-ant-1.7.0 UPDATE := curl MOVE := mv TOUCH := touch BUILD_CFG += ALT_BINARY_PLUGS_PATH=$(PLUGS) BUILD_CFG += ALT_JDK_IMPORT_PATH=$(BOOT_DIR) BUILD_CFG += ALT_BOOTDIR=$(BOOT_DIR) BUILD_CFG += BOOT_VER=$(BOOT_VER) #BUILD_CFG += MAKE_VER=3.81 #BUILD_CFG += ZIP_VER=2.32 #BUILD_CFG += UNZIP_VER=5.52 #BUILD_CFG += ARCH_DATA_MODEL=64 BUILD_CFG += ALT_OUTPUTDIR=$(INST_DIR) BUILD_CFG += ANT_HOME=$(ANT_HOME) BUILD_CFG += BUILD_NUMBER=$(TAG) # Internal temporary variables AR_PACK_zip := unzip AR_OPTS_zip := -q AR_SFX_zip := zip AR_PACK_tar := tar AR_OPTS_tar := xf AR_SFX_tar := tar AR_PACK_gz := tar AR_OPTS_gz := xzf AR_SFX_gz := tar.gz AR_PACK_bz2 := tar AR_OPTS_bz2 := xjf AR_SFX_bz2 := tar.bz2 # Internal final variables AR_PACK := $(AR_PACK_$(ARCHIVE)) AR_OPTS := $(AR_OPTS_$(ARCHIVE)) AR_SFX := $(AR_SFX_$(ARCHIVE)) SUFFIX := $(PROJECT)-$(TAG) TOP_DIR := $(PROJECT)-$(SUFFIX) TOP_ARCH := $(DOWNLOAD)/$(TOP_DIR).$(AR_SFX) COMPONENTS := corba COMPONENTS += hotspot COMPONENTS += jaxp COMPONENTS += jaxws COMPONENTS += jdk COMPONENTS += langtools COMP_DIRS := $(addprefix $(TOP_DIR)/,$(COMPONENTS)) COMP_ARCHS := $(addsuffix -$(SUFFIX).$(AR_SFX),$(COMPONENTS)) COMP_ARCHS := $(addprefix $(DOWNLOAD)/,$(COMP_ARCHS)) ARCHIVES := $(TOP_ARCH) ARCHIVES += $(COMP_ARCHS) .PHONY: download unpack build clean cleanall download: $(ARCHIVES) build unpack: $(TOP_DIR) $(COMP_DIRS) build: $(BOOT_DIR) $(PLUGS) $(ANT_HOME) $(MAKE) -C $(TOP_DIR) $(BUILD_CFG) sanity all clean: $(RM) -Rf $(TOP_DIR) cleanall: clean $(RM) -Rf $(DOWNLOAD) $(DOWNLOAD): mkdir $@ $(TOP_ARCH): $(DOWNLOAD) $(UPDATE) $(REPOSITORY)/archive/$(SUFFIX).$(AR_SFX) > $@ $(COMP_ARCHS): $(DOWNLOAD)/%-$(SUFFIX).$(AR_SFX): $(DOWNLOAD) $(UPDATE) $(REPOSITORY)/$*/archive/$(SUFFIX).$(AR_SFX) > $@ $(TOP_DIR): $(TOP_ARCH) $(AR_PACK) $(AR_OPTS) $< $(COMP_DIRS): $(TOP_DIR)/%: $(DOWNLOAD)/%-$(SUFFIX).$(AR_SFX) $(TOP_DIR) $(AR_PACK) $(AR_OPTS) $< $(MOVE) $*-$(SUFFIX) $@ $(TOUCH) $(TOP_DIR)/*