jdk/make/common/Program.gmk
author rfield
Tue, 20 Nov 2012 09:58:55 -0800
changeset 14554 4e29b285c723
parent 14091 e5c8662f325d
permissions -rw-r--r--
8003639: convert lambda testng tests to jtreg and add them Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
     2
# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Generic makefile for building executables.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# WARNING: This file is shared with other workspaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#          So when it includes other files, it must use JDK_TOPDIR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
# If building programs, use a normal compile approach
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
ifeq ($(COMPILE_APPROACH),batch)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
  override COMPILE_APPROACH = normal
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    41
# set the platform specific directory for macosx, also this platform shares
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    42
# substantial family ties with its siblings (solaris and linux), thus we add
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    43
# solaris src path to its compilation dependencies.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    44
ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    45
  LAUNCHER_PLATFORM_SRC = $(BUILDDIR)/../src/macosx
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    46
  LAUNCHER_SOLARIS_PLATFORM_SRC  = $(BUILDDIR)/../src/solaris
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    47
else
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    48
  LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
ifndef LAUNCHER_SHARE_SRC
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    52
  LAUNCHER_SHARE_SRC = $(SHARE_SRC)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
ACTUAL_PROGRAM_NAME = $(PROGRAM)$(EXE_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
ACTUAL_PROGRAM_DIR  = $(BINDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
ACTUAL_PROGRAM      = $(ACTUAL_PROGRAM_DIR)/$(ACTUAL_PROGRAM_NAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
# Make sure the default rule is all
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
program_default_rule: all
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
program: $(ACTUAL_PROGRAM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
9455
5675b83ad5eb 7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents: 9275
diff changeset
    64
# Work-around for missing processor specific mapfiles
5675b83ad5eb 7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents: 9275
diff changeset
    65
ifndef CROSS_COMPILE_ARCH
5675b83ad5eb 7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents: 9275
diff changeset
    66
  # reuse the mapfiles in the launcher's directory, the same should
5675b83ad5eb 7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents: 9275
diff changeset
    67
  # be applicable to the tool launchers as well.
5675b83ad5eb 7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents: 9275
diff changeset
    68
  FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH)
5675b83ad5eb 7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents: 9275
diff changeset
    69
  include $(BUILDDIR)/common/Mapfile-vers.gmk
5675b83ad5eb 7041284: arm/ppc Missing launcher mapfiles prevent build
dholmes
parents: 9275
diff changeset
    70
endif
9241
e77024585d01 7033954: (launcher) Launchers not built with mapfiles
ksrini
parents: 8796
diff changeset
    71
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
include $(JDK_TOPDIR)/make/common/Rules.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    75
  OTHER_CPPFLAGS += -DNEVER_ACT_AS_SERVER_CLASS_MACHINE
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
# Create a dependency on libjli (Java Launcher Infrastructure)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
# On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
# do this reliably on Linux takes a different syntax than Solaris.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
# On Windows, this is done by using the same directory as the executable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
# itself, as with all the Windows libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
#
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    87
ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    88
  ifneq ($(ARCH), universal)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    89
    LDFLAGS += -Wl,-all_load
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    90
  endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    91
  LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    92
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    93
  ifeq ($(SYSTEM_ZLIB),true)
13567
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 13411
diff changeset
    94
    OTHER_LDLIBS += $(ZLIB_LIBS)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    95
  endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    96
endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    97
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    98
ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
    99
  LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   100
  OTHER_LDLIBS += -ljli
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   101
  ifeq ($(PLATFORM), solaris)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   102
    ifeq ($(ARCH_DATA_MODEL), 32)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   103
      LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   104
      LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   105
    else
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   106
      LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)/jli
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   107
      LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)/jli
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    endif
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   109
  endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   110
  ifeq ($(PLATFORM), linux)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   111
    LDFLAGS += $(LDFLAG_Z_ORIGIN)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   112
    LDFLAGS += -Wl,--allow-shlib-undefined
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   113
    LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   114
    LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   115
  endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
endif
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   117
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
ifeq ($(PLATFORM), windows)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   119
  JLI_LCF = $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/jli.lcf
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   120
  ifdef STATIC_JLI
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   121
    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   122
  else
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   123
    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   124
  endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   125
  OTHER_LDLIBS += jli.lib
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#
13542
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   129
# Applications expect to be able to link against libjawt without invoking
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   130
# System.loadLibrary("jawt") first. This was the behaviour described in the
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   131
# devloper documentation of JAWT and what worked with OpenJDK6.
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   132
#
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   133
ifeq ($(PLATFORM), solaris)
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   134
  ifeq ($(ARCH_DATA_MODEL), 32)
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   135
    LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   136
    LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   137
  else # ! ARCH_DATA_MODEL 64-bit
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   138
    LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   139
    LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   140
  endif # ARCH_DATA_MODEL
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   141
endif # PLATFORM SOLARIS
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   142
ifeq ($(PLATFORM), linux)
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   143
  LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   144
  LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   145
endif # PLATFORM LINUX
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   146
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   147
93873f8b6528 7190813: (launcher) RPATH needs to have additional paths
omajid
parents: 13411
diff changeset
   148
#
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
# Launcher specific files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
#
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   151
FILES_o = $(OBJDIR)/main.$(OBJECT_SUFFIX)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   153
$(ACTUAL_PROGRAM):: classes $(INIT) 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
# Windows only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
ifeq ($(PLATFORM), windows)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   159
  # JDK name required here
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13679
diff changeset
   160
  RC_FLAGS += -D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13679
diff changeset
   161
              -D "JDK_INTERNAL_NAME=$(PROGRAM)" \
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13679
diff changeset
   162
              -D "JDK_FTYPE=0x1L"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   164
  $(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
	@$(prep-target)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   166
  ifndef LOCAL_RESOURCE_FILE
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   168
  endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   170
  $(OBJDIR)/$(PROGRAM).lcf: $(OBJDIR)/$(PROGRAM).res $(FILES_o)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
	@$(ECHO) $(FILES_o) > $@ 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
  ifndef LOCAL_RESOURCE_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
	@$(ECHO) $(OBJDIR)/$(PROGRAM).res >> $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
	@$(ECHO) Created $@ 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   178
  $(ACTUAL_PROGRAM):: $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
	@$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   181
  ifeq ($(ARCH_DATA_MODEL), 32)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   182
    STACK_SIZE=327680
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   183
  else
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   184
    # We need more Stack for Windows 64bit
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   185
    STACK_SIZE=1048576
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   186
  endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   188
  IMVERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   189
  $(OBJDIR)/$(PROGRAM).exe.manifest: $(JDK_TOPDIR)/src/windows/resource/java.manifest
7945
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   190
	@$(prep-target)
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   191
	$(SED) 's%IMVERSION%$(IMVERSION)%g;s%PROGRAM%$(PROGRAM)%g' $< > $@
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   192
12307
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   193
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   194
  MAP_OPTION="-map:$(OBJDIR)/$(PROGRAM).map"
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   195
endif
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   196
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   197
  # We used a hand-crafted manifest file for all executables.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   198
  # It is tweaked to embed the build number and executable name.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   199
  # Use ";#2" for .dll and ";#1" for .exe in the MT command below:
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   200
  $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) $(OBJDIR)/$(PROGRAM).exe.manifest
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
	@set -- $?; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13679
diff changeset
   204
	$(LINK) -out:$@ -STACK:$(STACK_SIZE) \
12307
b34445ac110f 7157296: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect OPT builds
dcubed
parents: 12047
diff changeset
   205
	    $(MAP_OPTION) $(LFLAGS) $(LDFLAGS) \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
	    @$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   207
  ifdef MT
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13679
diff changeset
   208
	$(MT) -manifest $(OBJDIR)/$(PROGRAM).exe.manifest /outputresource:$@;#1
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   209
  endif
8008
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7668
diff changeset
   210
	@$(call binary_file_verification,$@)
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   211
  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   212
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   213
	(set -e ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   214
	 $(CD) $(OBJDIR) ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   215
	 $(ZIPEXE) -q $(PROGRAM).diz $(PROGRAM).map $(PROGRAM).pdb ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   216
	 $(RM) $(PROGRAM).map $(PROGRAM).pdb ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   217
	)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   218
    endif
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   219
  endif
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   220
else
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   221
  #
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   222
  # Note that we have to link -lthread even when USE_PTHREADS is true.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   223
  # This is becuase checkForCorrectLibthread() croaks otherwise.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   224
  #
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   225
  LIBTHREAD = -lthread
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   226
  ifeq ($(USE_PTHREADS),true)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   227
    THREADLIBS = -lpthread $(LIBTHREAD)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   228
  else
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   229
    THREADLIBS = $(LIBTHREAD)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   230
  endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   232
  ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   233
    THREADLIBS = -pthread
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   234
    # Needed for linking the various launchers
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   235
    LDFLAGS += -framework Cocoa -framework Security \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   236
               -framework ApplicationServices
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   237
    OTHER_CPPFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   239
    # Default Info.plist file for the command line tools. This gets overridden by
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   240
    # some of the jvmstat tools so that they have task_for_pid() privileges
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   241
    ifndef INFO_PLIST_FILE
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   242
      INFO_PLIST_FILE = Info-cmdline.plist
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   243
    endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   244
    LDFLAGS += -sectcreate __TEXT __info_plist $(LAUNCHER_PLATFORM_SRC)/lib/$(INFO_PLIST_FILE)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   245
  else 
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   246
    INFO_PLIST_FILE=
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   247
  endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   248
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   249
  #
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   250
  # This rule only applies on unix.  It supports quantify and its ilk.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   251
  #
12853
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   252
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   253
  ifeq ($(PLATFORM), solaris)
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   254
    ifeq ($(PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   255
  $(ACTUAL_PROGRAM):: $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS)
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   256
    endif
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   257
  endif
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   258
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   259
  $(ACTUAL_PROGRAM):: $(FILES_o)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
	@set -- $?; \
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   262
	$(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
	@$(MKDIR) -p $(TEMPDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
	$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
13678
5c8001201f98 7197771: Adjust jdk sources to avoid use of implementation defined value of __FILE__
ohair
parents: 13411
diff changeset
   265
	$(sort $(FILES_o)) $(THREADLIBS) $(LDLIBS)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   266
  ifeq ($(findstring privileged, $(INFO_PLIST_FILE)), privileged)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   267
	-codesign -s openjdk_codesign $@
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   268
  endif
8008
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7668
diff changeset
   269
	@$(call binary_file_verification,$@)
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   270
  ifneq ($(PLATFORM), macosx)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   271
    ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   272
      ifeq ($(PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
12853
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   273
        ifeq ($(PLATFORM), solaris)
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   274
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   275
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   276
# empty section headers until a fixed $(OBJCOPY) is available.
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   277
# An empty section header has sh_addr == 0 and sh_size == 0.
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   278
# This problem has only been seen on Solaris X64, but we call this tool
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   279
# on all Solaris builds just in case.
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   280
#
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   281
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   282
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   283
	(set -e ; \
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   284
	 $(CD) $(@D) ; \
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   285
	 $(FIX_EMPTY_SEC_HDR_FLAGS) $(@F) ; \
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   286
	 $(OBJCOPY) --only-keep-debug $(@F) $(@F).debuginfo ; \
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   287
         $(ADD_GNU_DEBUGLINK) $(@F).debuginfo $(@F) ; \
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   288
	)
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   289
        else # PLATFORM != solaris
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   290
	(set -e ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   291
	 $(CD) $(@D) ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   292
	 $(OBJCOPY) --only-keep-debug $(@F) $(@F).debuginfo ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   293
	 $(OBJCOPY) --add-gnu-debuglink=$(@F).debuginfo $(@F) ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   294
	)
12853
7bdaa5aefd3d 7170449: Management is completely broken at least on Solaris 11 X86
dcubed
parents: 12433
diff changeset
   295
        endif # PLATFORM == solaris
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   296
        ifeq ($(STRIP_POLICY),all_strip)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   297
	  $(STRIP) $@
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   298
        else
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   299
          ifeq ($(STRIP_POLICY),min_strip)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   300
            ifeq ($(PLATFORM), solaris)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   301
	      $(STRIP) -x $@
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   302
            else
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   303
              # assume Linux
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   304
	      $(STRIP) -g $@
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   305
            endif
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   306
          # implied else here is no stripping at all
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   307
          endif
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   308
        endif
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   309
        ifeq ($(ZIP_DEBUGINFO_FILES),1)
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   310
	  (set -e ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   311
	   $(CD) $(@D) ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   312
	   $(ZIPEXE) -q $(@F).diz $(@F).debuginfo ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   313
	   $(RM) $(@F).debuginfo ; \
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   314
	  )
12433
ac48511f8b50 7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents: 12427
diff changeset
   315
          # save ZIP'ed debug info with rest of the program's build artifacts
ac48511f8b50 7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents: 12427
diff changeset
   316
	  $(MV) $@.diz $(OBJDIR)
ac48511f8b50 7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents: 12427
diff changeset
   317
        else
ac48511f8b50 7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents: 12427
diff changeset
   318
          # save debug info with rest of the program's build artifacts
ac48511f8b50 7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo
dcubed
parents: 12427
diff changeset
   319
	  $(MV) $@.debuginfo $(OBJDIR)
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   320
        endif
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   321
      endif # PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   322
    endif # ENABLE_FULL_DEBUG_SYMBOLS
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   323
  endif # PLATFORM-!macosx
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
	$(RM) $(OBJDIR)/$(PROGRAM).rc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
	$(RM) $(OBJDIR)/$(PROGRAM).ico
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
	$(RM) $(OBJDIR)/$(PROGRAM).lcf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
	$(RM) $(OBJDIR)/$(PROGRAM).map
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   332
	$(RM) $(OBJDIR)/$(PROGRAM).pdb
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
	$(RM) $(OBJDIR)/$(PROGRAM).exp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
	$(RM) $(OBJDIR)/$(PROGRAM).lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
	$(RM) $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
	$(RM) $(OBJDIR)/$(PROGRAM).ilk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
	$(RM) *.pdb
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   338
else
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   339
	$(RM) $(OBJDIR)/$(PROGRAM).debuginfo
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
endif
12427
116544b5a04c 7071907: JDK: Full Debug Symbols
dcubed
parents: 12307
diff changeset
   341
	$(RM) $(OBJDIR)/$(PROGRAM).diz
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
clobber:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
	$(RM) $(ACTUAL_PROGRAM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
# Now include make dependencies (created during compilation, see Rules.gmk)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
ifeq ($(INCREMENTAL_BUILD),true)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   351
  # Workaround: gnumake sometimes says files is empty when it shouldn't
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   352
  #    was:  files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file))
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   353
  files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   354
  ifneq ($(strip $(files)),)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   355
    include $(files)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   356
  endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   357
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
ifdef JAVA_ARGS
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   360
  OTHER_CPPFLAGS += -DJAVA_ARGS='$(JAVA_ARGS)'
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   361
  OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
ifeq ($(PLATFORM), windows)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   365
  ifdef RELEASE
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   366
    OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"'
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   367
  endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
ifneq ($(PLATFORM), windows)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   372
  HAVE_GETHRTIME=true
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
ifeq ($(HAVE_GETHRTIME),true)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   376
  OTHER_CPPFLAGS += -DHAVE_GETHRTIME
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   380
ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   381
  OTHER_INCLUDES += -I$(LAUNCHER_SOLARIS_PLATFORM_SRC)/bin
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   382
  ifneq ($(SYSTEM_ZLIB), true)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   383
    OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   384
  endif
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   385
else
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   386
  OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   387
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   389
OTHER_CPPFLAGS  += -DPROGNAME='"$(PROGRAM)"'
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9455
diff changeset
   393
                   -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
$(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
		$(VERSION_DEFINES) $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
# Default dependencies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
all: build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
build: program
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
debug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
	$(MAKE) VARIANT=DBG build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
fastdebug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
	$(MAKE) VARIANT=DBG FASTDEBUG=true build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
.PHONY: all build program clean clobber debug fastdebug