jdk/make/common/Program.gmk
author kvn
Wed, 05 Mar 2008 11:33:31 -0800
changeset 210 6da234892f4a
parent 2 90ce3da70b43
child 1776 33e9405ab91b
permissions -rw-r--r--
6671250: In Parse::do_if() old Cmp node 'c' should be replaced with new one after BoolNode transformation Summary: In Parse::do_if() 'c' (CmpNode) node may be changed during BoolNode transformation so 'c' may became dead but the node is referenced later in the code. Reviewed-by: never
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
$(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
	@set -- $?; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
	$(LINK) -out:$@ /STACK:$(STACK_SIZE) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
	    -map:$(OBJDIR)/$(PROGRAM).map $(LFLAGS) $(LDFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
	    @$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
else # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
# Note that we have to link -lthread even when USE_PTHREADS is true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
# This is becuase checkForCorrectLibthread() croaks otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
LIBTHREAD = -lthread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
ifeq ($(USE_PTHREADS),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
  THREADLIBS = -lpthread $(LIBTHREAD)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
else # USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
  THREADLIBS = $(LIBTHREAD)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
endif # USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
# This rule only applies on unix.  It supports quantify and its ilk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
$(ACTUAL_PROGRAM):: $(FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
	@set -- $?; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
	@$(MKDIR) -p $(TEMPDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
	$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
	    $(FILES_o) $(THREADLIBS) $(LDLIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
else  # COMPILE_IT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
$(ACTUAL_PROGRAM):: $(JVMCFG)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
# Copies in the file from the JDK_IMPORT_PATH area
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
$(ACTUAL_PROGRAM_DIR)/%: $(JDK_IMPORT_PATH)/jre/bin/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
	@$(install-import-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
$(ACTUAL_PROGRAM_DIR)/%: $(JDK_IMPORT_PATH)/bin/%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
	@$(install-import-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
endif # COMPILE_IT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
	$(RM) $(OBJDIR)/$(PROGRAM).rc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
	$(RM) $(OBJDIR)/$(PROGRAM).ico
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
	$(RM) $(OBJDIR)/$(PROGRAM).lcf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
	$(RM) $(OBJDIR)/$(PROGRAM).map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
	$(RM) $(OBJDIR)/$(PROGRAM).exp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
	$(RM) $(OBJDIR)/$(PROGRAM).lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
	$(RM) $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
	$(RM) $(OBJDIR)/$(PROGRAM).ilk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
	$(RM) *.pdb
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
clobber:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
	$(RM) $(ACTUAL_PROGRAM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
# Now include make dependencies (created during compilation, see Rules.gmk)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
ifeq ($(INCREMENTAL_BUILD),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
# Workaround: gnumake sometimes says files is empty when it shouldn't
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
#    was:  files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
ifneq ($(strip $(files)),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
include $(files)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
endif # files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
endif # INCREMENTAL_BUILD
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
ifdef JAVA_ARGS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
OTHER_CPPFLAGS += -DJAVA_ARGS=$(JAVA_ARGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
OTHER_CPPFLAGS += -DLAUNCHER_NAME=\"$(LAUNCHER_NAME)\"
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 ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
ifdef RELEASE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
OTHER_CPPFLAGS += -DVERSION="$(RELEASE)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
endif
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
ifneq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
HAVE_GETHRTIME=true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
ifeq ($(HAVE_GETHRTIME),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
OTHER_CPPFLAGS += -DHAVE_GETHRTIME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
# this may not be necessary...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
OTHER_CPPFLAGS += -DPROGNAME="\"$(PROGRAM)\""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
VERSION_DEFINES += -DFULL_VERSION="\"$(FULL_VERSION)\""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
		   -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
$(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
		$(VERSION_DEFINES) $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
# How to install jvm.cfg. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
# 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
$(JVMCFG): $(LAUNCHER_PLATFORM_SRC)/bin/$(ARCH)/jvm.cfg 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
# Default dependencies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
all: build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
build: program
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
debug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
	$(MAKE) VARIANT=DBG build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
fastdebug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
	$(MAKE) VARIANT=DBG FASTDEBUG=true build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
.PHONY: all build program clean clobber debug fastdebug