1 #
   2 # Copyright (c) 1999, 2011, 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 BUILDDIR = ../..
  27 PACKAGE = sun.awt
  28 LIBRARY = jawt
  29 PRODUCT = sun
  30 
  31 include $(BUILDDIR)/common/Defs.gmk
  32 
  33 # default to PLATFORM_SRC to copy export headers from
  34 PLATFORM_EXPORT_BASE = $(PLATFORM_SRC)
  35 
  36 #
  37 # Files
  38 #
  39 ifeq ($(PLATFORM), windows)
  40 FILES_cpp = jawt.cpp
  41 else ifeq ($(PLATFORM), macosx) # PLATFORM
  42 FILES_objc = jawt.m
  43 # pick up the correct export headers for Mac OS X
  44 PLATFORM_EXPORT_BASE = $(PLATFORM_SRC_MACOS)
  45 else # PLATFORM
  46 FILES_c = jawt.c
  47 endif # PLATFORM
  48 
  49 FILES_h = $(INCLUDEDIR)/jawt.h \
  50     $(PLATFORM_INCLUDE)/jawt_md.h
  51 
  52 #
  53 # Use mapfile
  54 #
  55 FILES_m = mapfile-vers
  56 include $(BUILDDIR)/common/Mapfile-vers.gmk
  57 
  58 
  59 ifeq ($(PLATFORM), windows)
  60 #
  61 # Extra C flags.
  62 #
  63 
  64 OTHER_CXXFLAGS += $(GX_OPTION) -DUNICODE -D_UNICODE
  65 
  66 #
  67 # Other extra flags needed for compiling.
  68 #
  69 CPPFLAGS += -I$(SHARE_SRC)/native/common \
  70         -I$(DXSDK_INCLUDE_PATH) \
  71         -I$(PLATFORM_SRC)/native/sun/windows \
  72         -I$(CLASSHDRDIR)/../../awt/CClassHeaders \
  73         -I$(SHARE_SRC)/native/sun/awt/debug \
  74         -I$(SHARE_SRC)/native/sun/font \
  75         -I$(SHARE_SRC)/native/sun/java2d \
  76         -I$(SHARE_SRC)/native/sun/java2d/loops \
  77         -I$(SHARE_SRC)/native/sun/java2d/pipe \
  78         -I$(PLATFORM_SRC)/native/sun/java2d \
  79         -I$(PLATFORM_SRC)/native/sun/java2d/windows \
  80         -I$(PLATFORM_SRC)/native/sun/java2d/d3d \
  81         -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \
  82         -I$(SHARE_SRC)/javavm/export \
  83         -I$(PLATFORM_SRC)/javavm/export
  84 INSTALL_DOT_LIB = true
  85 
  86 vpath %.cpp   $(PLATFORM_SRC)/native/sun/windows
  87 
  88 #
  89 # Libraries to link in.
  90 #
  91 ifeq ($(ARCH_DATA_MODEL), 64)
  92 OTHER_LDLIBS = $(OBJDIR)/../../awt/$(OBJDIRNAME)/awt.lib 
  93 else
  94 OTHER_LDLIBS = kernel32.lib \
  95                $(OBJDIR)/../../awt/$(OBJDIRNAME)/awt.lib 
  96 endif
  97 else # PLATFORM
  98 
  99 #
 100 # Other extra flags needed for compiling.
 101 #
 102 CPPFLAGS += -I$(OPENWIN_HOME)/include \
 103             -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
 104             -I$(SHARE_SRC)/native/$(PKGDIR)/image \
 105             -I$(SHARE_SRC)/native/$(PKGDIR)/image/cvutils \
 106             -I$(SHARE_SRC)/native/$(PKGDIR)/alphacomposite \
 107             -I$(SHARE_SRC)/native/$(PKGDIR)/medialib \
 108             -I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib \
 109             -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops \
 110             -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe \
 111             -I$(SHARE_SRC)/native/$(PKGDIR)/../java2d/opengl \
 112             -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/opengl \
 113             -I$(PLATFORM_SRC)/native/$(PKGDIR)/../java2d/x11 \
 114             -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/doe \
 115             -I$(SHARE_SRC)/native/$(PKGDIR)/../dc/path \
 116             -I$(PLATFORM_SRC)/native/$(PKGDIR)/../jdga \
 117             $(EVENT_MODEL)
 118 
 119 #
 120 # Libraries to link in.
 121 #
 122 ifeq ($(PLATFORM), solaris)
 123   ifndef BUILD_HEADLESS_ONLY
 124     OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -L/usr/openwin/sfw/lib$(ISA_DIR) -lXrender
 125   else
 126     OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/headless -lmawt -L/usr/openwin/sfw/lib$(ISA_DIR) -lXrender
 127   endif
 128 endif # PLATFORM
 129 
 130 ifeq ($(PLATFORM), linux)
 131   ifndef BUILD_HEADLESS_ONLY
 132     OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt
 133   else
 134     OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -lawt -L$(LIBDIR)/$(LIBARCH)/headless -lmawt
 135     CFLAGS += -DHEADLESS
 136   endif
 137 endif # PLATFORM
 138 
 139 ifeq ($(PLATFORM), macosx)
 140 vpath %.m   $(call NativeSrcDirList,,native/sun/awt)
 141 OTHER_LDLIBS = -llwawt -L$(LIBDIR)/lwawt -Xlinker -rpath -Xlinker @loader_path/lwawt \
 142                -framework Cocoa
 143 endif # PLATFORM
 144 
 145 endif # PLATFORM
 146 
 147 #
 148 # Lets not remove any class files.
 149 #
 150 DONT_CLOBBER_CLASSES = true
 151 
 152 #
 153 # Rules
 154 #
 155 include $(BUILDDIR)/common/Library.gmk
 156 
 157 build: $(FILES_h)
 158 
 159 ifeq ($(PLATFORM), windows)
 160 include make.depend
 161 endif
 162 
 163 #
 164 # Install header files.
 165 #
 166 $(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
 167         $(install-file)
 168 $(PLATFORM_INCLUDE)/%.h: $(PLATFORM_EXPORT_BASE)/javavm/export/%.h
 169         $(install-file)
 170 
 171 
 172 #
 173 # Extra clean rule.
 174 #
 175 clean clobber::
 176         $(RM) $(FILES_h)
 177