jdk/make/common/Program.gmk
author ohair
Tue, 28 Dec 2010 15:53:50 -0800
changeset 7668 d4a77089c587
parent 7666 7b994e3dd41d
child 8008 753c38f4af83
child 7945 7296aacd696f
permissions -rw-r--r--
6962318: Update copyright year Reviewed-by: xdono
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 7666
diff changeset
     2
# Copyright (c) 1995, 2010, 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)
4111
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3111
diff changeset
    86
	LDFLAGS += -Wl,-z -Wl,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
1776
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   145
# 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
   146
# 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
   147
# Use ";#2" for .dll and ";#1" for .exe in the MT command below:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
$(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
	@set -- $?; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
	$(LINK) -out:$@ /STACK:$(STACK_SIZE) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
	    -map:$(OBJDIR)/$(PROGRAM).map $(LFLAGS) $(LDFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
	    @$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS)
1776
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   155
ifdef MT
33e9405ab91b 6754862: jdk/src/windows/bin/java_md.c: hardcoded reference to msvcr71.dll
tbell
parents: 2
diff changeset
   156
	$(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
   157
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
else # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
# Note that we have to link -lthread even when USE_PTHREADS is true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
# This is becuase checkForCorrectLibthread() croaks otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
LIBTHREAD = -lthread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
ifeq ($(USE_PTHREADS),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
  THREADLIBS = -lpthread $(LIBTHREAD)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
else # USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
  THREADLIBS = $(LIBTHREAD)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
endif # USE_PTHREADS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
# This rule only applies on unix.  It supports quantify and its ilk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
$(ACTUAL_PROGRAM):: $(FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
	@set -- $?; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
	    $(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
	@$(MKDIR) -p $(TEMPDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
	$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
	    $(FILES_o) $(THREADLIBS) $(LDLIBS)
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   182
	$(install-module-file)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
	$(RM) $(OBJDIR)/$(PROGRAM).rc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
	$(RM) $(OBJDIR)/$(PROGRAM).ico
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
	$(RM) $(OBJDIR)/$(PROGRAM).lcf
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
	$(RM) $(OBJDIR)/$(PROGRAM).map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
	$(RM) $(OBJDIR)/$(PROGRAM).exp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
	$(RM) $(OBJDIR)/$(PROGRAM).lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
	$(RM) $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
	$(RM) $(OBJDIR)/$(PROGRAM).ilk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
	$(RM) *.pdb
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
clobber:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
	$(RM) $(ACTUAL_PROGRAM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
# Now include make dependencies (created during compilation, see Rules.gmk)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
ifeq ($(INCREMENTAL_BUILD),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
# Workaround: gnumake sometimes says files is empty when it shouldn't
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
#    was:  files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
ifneq ($(strip $(files)),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
include $(files)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
endif # files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
endif # INCREMENTAL_BUILD
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
ifdef JAVA_ARGS
4116
54b55d640d9a 6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents: 4111
diff changeset
   216
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
   217
OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
ifdef RELEASE
4116
54b55d640d9a 6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents: 4111
diff changeset
   222
OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"'
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
endif
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
ifneq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
HAVE_GETHRTIME=true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
ifeq ($(HAVE_GETHRTIME),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
OTHER_CPPFLAGS += -DHAVE_GETHRTIME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
		   -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
$(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
	$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
		$(VERSION_DEFINES) $<
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
# Default dependencies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
all: build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
build: program
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
debug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
	$(MAKE) VARIANT=DBG build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
fastdebug:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
	$(MAKE) VARIANT=DBG FASTDEBUG=true build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
.PHONY: all build program clean clobber debug fastdebug