1 #
   2 # Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  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
  23 # questions.
  24 #
  25 
  26 # This must be the first rule
  27 default: all
  28 
  29 include $(SPEC)
  30 include MakeBase.gmk
  31 include JavaCompilation.gmk
  32 include NativeCompilation.gmk
  33 
  34 # Setup the java compilers for the JDK build.
  35 include Setup.gmk
  36 
  37 # Setup the build tools.
  38 include Tools.gmk
  39 
  40 all: $(BUILD_TOOLS)
  41         +$(MAKE) -f GenerateJavaSources.gmk
  42 #       Drop back to the old makefiles for
  43 #       packages/libs that have not yet been converted.
  44         +$(MAKE) -f LegacyMakefiles.gmk
  45 #       Ok, now gensrc is fully populated.
  46         +$(MAKE) -f GenerateData.gmk
  47         +$(MAKE) -f CompileJavaClasses.gmk
  48 #       The classes have been built, now generate
  49 #       classes that have other sources.
  50         +$(MAKE) -f GenerateClasses.gmk
  51 #       The classes are now built and
  52 #       any javah files have now been generated.
  53         +$(MAKE) -f CompileNativeLibraries.gmk
  54 #       Finally compile the launchers.
  55         +$(MAKE) -f CompileLaunchers.gmk
  56 #       Now we have a complete jdk, which you can run.
  57 #       It is not yet wrapped up as an installed image.
  58 #       The demos are compiled against this jdk.
  59 ifndef NO_DEMOS
  60         +$(MAKE) -f CompileDemos.gmk
  61 endif
  62 #       Now copy the sample sources into the jdk.
  63 ifndef NO_SAMPLES
  64         +$(MAKE) -f CopySamples.gmk
  65 endif
  66 
  67 # Create the final jdk and jre images in the old way. Kept for reference
  68 # until conversion is fully done.
  69 old-images:
  70         +$(MAKE) $(IMAGES_MAKE_ARGS) -f OldImages.gmk 
  71 
  72 # Create the final jdk and jre images, to be wrapped up
  73 # into packages, or installed.
  74 images:
  75         +$(MAKE) -f CreateJars.gmk
  76         +$(MAKE) $(IMAGES_MAKE_ARGS) -f Images.gmk 
  77 
  78 
  79 BINARIES:=$(shell if test -d $(IMAGES_OUTPUTDIR)/j2sdk-image/bin; then cd $(IMAGES_OUTPUTDIR)/j2sdk-image/bin && $(LS) ; fi)
  80 INSTALLDIR:=openjdk-$(RELEASE)
  81 
  82 # Install the jdk image, in a very crude way. Not taking into
  83 # account, how to install properly on macosx or windows etc.
  84 install: images
  85         echo Installing jdk image into $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)
  86         echo and creating $(words $(BINARIES)) links from $(INSTALL_PREFIX)/bin into the jdk.
  87         $(MKDIR) -p $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)
  88         $(RM) -r $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/*
  89         $(CP) -rp $(IMAGES_OUTPUTDIR)/j2sdk-image/* $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)
  90         $(RM) $(addprefix $(INSTALL_PREFIX)/bin/,$(BINARIES))
  91         $(foreach b,$(BINARIES),$(LN) -s $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/bin/$b $(INSTALL_PREFIX)/bin/$b &&) true
  92 
  93 # Create the deb,rpm,tgz,zip, packages.
  94 packages: images
  95         echo Creating packages...well, in the future.
  96         $(MKDIR) -p $(OUTPUT_ROOT)/packages
  97 
  98 .PHONY: all install images