jdk/make/common/Program.gmk
author ohair
Wed, 06 Apr 2011 22:06:11 -0700
changeset 9035 1255eb81cc2f
parent 8796 604a43386301
child 9275 1df1f7dfab7f
permissions -rw-r--r--
7033660: Update copyright year to 2011 on any files changed in 2011 Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
9035
1255eb81cc2f 7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents: 8796
diff changeset
     2
# Copyright (c) 1995, 2011, 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
ifndef LAUNCHER_PLATFORM_SRC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
ifndef LAUNCHER_SHARE_SRC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
LAUNCHER_SHARE_SRC = $(SHARE_SRC)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
ACTUAL_PROGRAM_NAME = $(PROGRAM)$(EXE_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
ACTUAL_PROGRAM_DIR  = $(BINDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
ACTUAL_PROGRAM      = $(ACTUAL_PROGRAM_DIR)/$(ACTUAL_PROGRAM_NAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
# Make sure the default rule is all
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
program_default_rule: all
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
program: $(ACTUAL_PROGRAM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
include $(JDK_TOPDIR)/make/common/Rules.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
OTHER_CPPFLAGS += -DNEVER_ACT_AS_SERVER_CLASS_MACHINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
# Create a dependency on libjli (Java Launcher Infrastructure)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
# On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
# do this reliably on Linux takes a different syntax than Solaris.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
# On Windows, this is done by using the same directory as the executable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
# itself, as with all the Windows libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
ifneq (,$(findstring $(PLATFORM), linux solaris))	# UNIX systems
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    OTHER_LDLIBS += -ljli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
	ifeq ($(ARCH_DATA_MODEL), 32)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
		LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
		LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
	else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
		LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
		LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
	endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    ifeq ($(PLATFORM), linux)
8796
604a43386301 7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents: 8583
diff changeset
    86
	LDFLAGS += $(LDFLAG_Z_ORIGIN)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
	LDFLAGS += -Wl,--allow-shlib-undefined
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
	JLI_LCF = $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/jli.lcf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
	ifdef STATIC_JLI
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
	    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
	else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
	    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
	endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
	OTHER_LDLIBS += jli.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
# Launcher specific files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
FILES_o = \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
	$(OBJDIR)/main.$(OBJECT_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   108
$(ACTUAL_PROGRAM):: classes $(INIT) 
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
# Windows only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
3111
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 1776
diff changeset
   115
# JDK name required here
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 1776
diff changeset
   116
RC_FLAGS += /D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 1776
diff changeset
   117
	    /D "JDK_INTERNAL_NAME=$(PROGRAM)" \
fefdeafb7ab9 6797688: Umbrella: Merge all JDK 6u4 - 6u12 deployment code into JDK7
herrick
parents: 1776
diff changeset
   118
	    /D "JDK_FTYPE=0x1L"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
$(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
ifndef LOCAL_RESOURCE_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
$(OBJDIR)/$(PROGRAM).lcf: $(OBJDIR)/$(PROGRAM).res $(FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
	@$(ECHO) $(FILES_o) > $@ 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
  ifndef LOCAL_RESOURCE_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
	@$(ECHO) $(OBJDIR)/$(PROGRAM).res >> $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
	@$(ECHO) setargv.obj >> $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
	@$(ECHO) Created $@ 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
$(ACTUAL_PROGRAM):: $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
	@$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
ifeq ($(ARCH_DATA_MODEL), 32)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
  STACK_SIZE=327680
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
# We need more Stack for Windows 64bit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
  STACK_SIZE=1048576
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
7945
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   145
IMVERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   146
$(OBJDIR)/$(PROGRAM).exe.manifest: $(JDK_TOPDIR)/src/windows/resource/java.manifest
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   147
	@$(prep-target)
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   148
	$(SED) 's%IMVERSION%$(IMVERSION)%g;s%PROGRAM%$(PROGRAM)%g' $< > $@
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   149
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   150
# We used a hand-crafted manifest file for all executables.
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   151
# It is tweaked to embed the build number and executable name.
1776
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   152
# Use ";#2" for .dll and ";#1" for .exe in the MT command below:
7945
7296aacd696f 7013109: windows application manifest problems
prr
parents: 7668
diff changeset
   153
$(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) $(OBJDIR)/$(PROGRAM).exe.manifest
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
	@set -- $?; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
	$(LINK) -out:$@ /STACK:$(STACK_SIZE) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
	    -map:$(OBJDIR)/$(PROGRAM).map $(LFLAGS) $(LDFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
	    @$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS)
1776
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   160
ifdef MT
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   161
	$(MT) /manifest $(OBJDIR)/$(PROGRAM).exe.manifest /outputresource:$@;#1
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   162
endif
8008
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7668
diff changeset
   163
	@$(call binary_file_verification,$@)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
else # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
# Note that we have to link -lthread even when USE_PTHREADS is true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
# This is becuase checkForCorrectLibthread() croaks otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
LIBTHREAD = -lthread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
ifeq ($(USE_PTHREADS),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
  THREADLIBS = -lpthread $(LIBTHREAD)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
else # USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
  THREADLIBS = $(LIBTHREAD)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
endif # USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
# This rule only applies on unix.  It supports quantify and its ilk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
$(ACTUAL_PROGRAM):: $(FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
	@set -- $?; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
	@$(MKDIR) -p $(TEMPDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
	$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
	    $(FILES_o) $(THREADLIBS) $(LDLIBS)
8008
753c38f4af83 6975326: Problem in install/make/rebase/Makefile, grep on empty pattern
ohair
parents: 7668
diff changeset
   188
	@$(call binary_file_verification,$@)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
	$(RM) $(OBJDIR)/$(PROGRAM).rc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
	$(RM) $(OBJDIR)/$(PROGRAM).ico
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
	$(RM) $(OBJDIR)/$(PROGRAM).lcf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
	$(RM) $(OBJDIR)/$(PROGRAM).map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
	$(RM) $(OBJDIR)/$(PROGRAM).exp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
	$(RM) $(OBJDIR)/$(PROGRAM).lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
	$(RM) $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
	$(RM) $(OBJDIR)/$(PROGRAM).ilk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
	$(RM) *.pdb
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
clobber:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
	$(RM) $(ACTUAL_PROGRAM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
# Now include make dependencies (created during compilation, see Rules.gmk)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
ifeq ($(INCREMENTAL_BUILD),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
# Workaround: gnumake sometimes says files is empty when it shouldn't
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
#    was:  files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
ifneq ($(strip $(files)),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
include $(files)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
endif # files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
endif # INCREMENTAL_BUILD
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
ifdef JAVA_ARGS
4116
54b55d640d9a 6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents: 4111
diff changeset
   222
OTHER_CPPFLAGS += -DJAVA_ARGS='$(JAVA_ARGS)'
54b55d640d9a 6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents: 4111
diff changeset
   223
OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
ifdef RELEASE
4116
54b55d640d9a 6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents: 4111
diff changeset
   228
OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"'
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
ifneq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
HAVE_GETHRTIME=true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
ifeq ($(HAVE_GETHRTIME),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
OTHER_CPPFLAGS += -DHAVE_GETHRTIME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
		   -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
$(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
		$(VERSION_DEFINES) $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
# Default dependencies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
all: build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
build: program
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
debug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
	$(MAKE) VARIANT=DBG build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
fastdebug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
	$(MAKE) VARIANT=DBG FASTDEBUG=true build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
.PHONY: all build program clean clobber debug fastdebug