jdk/make/common/Program.gmk
author tbell
Wed, 14 Jan 2009 21:35:03 -0800
changeset 1776 33e9405ab91b
parent 2 90ce3da70b43
child 3111 fefdeafb7ab9
permissions -rw-r--r--
6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll 6779412: VS2008 errors compiling jdk sources Summary: Update Makefiles to tolerate newer Visual Studio releases and runtimes. Reviewed-by: ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
# Copyright 1995-2007 Sun Microsystems, Inc.  All Rights Reserved.
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
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
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# have any questions.
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
JVMCFG = $(LIBDIR)/$(LIBARCH)/jvm.cfg
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
# Make sure the default rule is all
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
program_default_rule: all
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
program: $(ACTUAL_PROGRAM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
include $(JDK_TOPDIR)/make/common/Rules.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
OTHER_CPPFLAGS += -DNEVER_ACT_AS_SERVER_CLASS_MACHINE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
# Create a dependency on libjli (Java Launcher Infrastructure)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
# On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
# do this reliably on Linux takes a different syntax than Solaris.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
# On Windows, this is done by using the same directory as the executable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
# itself, as with all the Windows libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
ifneq (,$(findstring $(PLATFORM), linux solaris))	# UNIX systems
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    OTHER_LDLIBS += -ljli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
	ifeq ($(ARCH_DATA_MODEL), 32)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
		LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
		LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
	else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
		LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
		LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
	endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    ifeq ($(PLATFORM), linux)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
	LDFLAGS += -z origin
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
	LDFLAGS += -Wl,--allow-shlib-undefined
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
	JLI_LCF = $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/jli.lcf
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
	ifdef STATIC_JLI
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
	    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
	else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
	    LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
	endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
	OTHER_LDLIBS += jli.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
# Launcher specific files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
FILES_o = \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
	$(OBJDIR)/main.$(OBJECT_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
# We either need to import (copy) binaries in, or build them
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
ifneq ($(IMPORT_NATIVE_BINARIES),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
  COMPILE_IT=true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
  COMPILE_IT=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
ifeq ($(COMPILE_IT),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
$(ACTUAL_PROGRAM):: classes $(JVMCFG) $(INIT) 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
# Windows only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
# J2SE name required here
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
RC_FLAGS += /D "J2SE_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
	    /D "J2SE_INTERNAL_NAME=$(PROGRAM)" \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
	    /D "J2SE_FTYPE=0x1L"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
$(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
ifndef LOCAL_RESOURCE_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
$(OBJDIR)/$(PROGRAM).lcf: $(OBJDIR)/$(PROGRAM).res $(FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
	@$(ECHO) $(FILES_o) > $@ 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
  ifndef LOCAL_RESOURCE_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
	@$(ECHO) $(OBJDIR)/$(PROGRAM).res >> $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
	@$(ECHO) setargv.obj >> $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
	@$(ECHO) Created $@ 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
$(ACTUAL_PROGRAM):: $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
	@$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
ifeq ($(ARCH_DATA_MODEL), 32)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
  STACK_SIZE=327680
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
# We need more Stack for Windows 64bit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
  STACK_SIZE=1048576
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
1776
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   156
# In VS2005 or VS2008 the link command creates a .manifest file that we want
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   157
# to insert into the linked artifact so we do not need to track it separately.
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   158
# Use ";#2" for .dll and ";#1" for .exe in the MT command below:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
$(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
	@set -- $?; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
	$(LINK) -out:$@ /STACK:$(STACK_SIZE) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
	    -map:$(OBJDIR)/$(PROGRAM).map $(LFLAGS) $(LDFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
	    @$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS)
1776
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   166
ifdef MT
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   167
	$(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
   168
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
else # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
# Note that we have to link -lthread even when USE_PTHREADS is true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
# This is becuase checkForCorrectLibthread() croaks otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
LIBTHREAD = -lthread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
ifeq ($(USE_PTHREADS),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
  THREADLIBS = -lpthread $(LIBTHREAD)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
else # USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
  THREADLIBS = $(LIBTHREAD)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
endif # USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
# This rule only applies on unix.  It supports quantify and its ilk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
$(ACTUAL_PROGRAM):: $(FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
	@set -- $?; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
	@$(MKDIR) -p $(TEMPDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
	$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
	    $(FILES_o) $(THREADLIBS) $(LDLIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
else  # COMPILE_IT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
$(ACTUAL_PROGRAM):: $(JVMCFG)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
# Copies in the file from the JDK_IMPORT_PATH area
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
$(ACTUAL_PROGRAM_DIR)/%: $(JDK_IMPORT_PATH)/jre/bin/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
	@$(install-import-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
$(ACTUAL_PROGRAM_DIR)/%: $(JDK_IMPORT_PATH)/bin/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
	@$(install-import-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
endif # COMPILE_IT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
	$(RM) $(OBJDIR)/$(PROGRAM).rc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
	$(RM) $(OBJDIR)/$(PROGRAM).ico
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
	$(RM) $(OBJDIR)/$(PROGRAM).lcf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
	$(RM) $(OBJDIR)/$(PROGRAM).map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
	$(RM) $(OBJDIR)/$(PROGRAM).exp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
	$(RM) $(OBJDIR)/$(PROGRAM).lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
	$(RM) $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
	$(RM) $(OBJDIR)/$(PROGRAM).ilk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
	$(RM) *.pdb
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
clobber:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
	$(RM) $(ACTUAL_PROGRAM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
# Now include make dependencies (created during compilation, see Rules.gmk)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
ifeq ($(INCREMENTAL_BUILD),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
# Workaround: gnumake sometimes says files is empty when it shouldn't
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
#    was:  files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
ifneq ($(strip $(files)),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
include $(files)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
endif # files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
endif # INCREMENTAL_BUILD
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
ifdef JAVA_ARGS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
OTHER_CPPFLAGS += -DJAVA_ARGS=$(JAVA_ARGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
OTHER_CPPFLAGS += -DLAUNCHER_NAME=\"$(LAUNCHER_NAME)\"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
ifdef RELEASE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
OTHER_CPPFLAGS += -DVERSION="$(RELEASE)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
ifneq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
HAVE_GETHRTIME=true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
ifeq ($(HAVE_GETHRTIME),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
OTHER_CPPFLAGS += -DHAVE_GETHRTIME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
# this may not be necessary...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
OTHER_CPPFLAGS += -DPROGNAME="\"$(PROGRAM)\""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
VERSION_DEFINES += -DFULL_VERSION="\"$(FULL_VERSION)\""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
		   -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
$(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
		$(VERSION_DEFINES) $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
# How to install jvm.cfg. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
# 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
$(JVMCFG): $(LAUNCHER_PLATFORM_SRC)/bin/$(ARCH)/jvm.cfg 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
# Default dependencies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
all: build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
build: program
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
debug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
	$(MAKE) VARIANT=DBG build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
fastdebug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
	$(MAKE) VARIANT=DBG FASTDEBUG=true build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
.PHONY: all build program clean clobber debug fastdebug