source: trunk/openjdk/jdk/make/common/Defs.gmk

Last change on this file was 278, checked in by dmik, 14 years ago

trunk: Merged in openjdk6 b22 from branches/vendor/oracle.

File size: 20.5 KB
Line 
1#
2# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
7# published by the Free Software Foundation. Oracle designates this
8# particular file as subject to the "Classpath" exception as provided
9# by Oracle in the LICENSE file that accompanied this code.
10#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22# or visit www.oracle.com if you need additional information or have any
23# questions.
24#
25
26#
27# Common variables used by all the Java makefiles. This file should
28# not contain rules.
29#
30
31# WARNING: This file is shared with other workspaces.
32# So when it includes other files, it must use JDK_TOPDIR.
33#
34
35#
36# On Solaris, the 'make' utility from Sun will not work with these makefiles.
37# This little rule is only understood by Sun's make, and is harmless
38# when seen by the GNU make tool. If using Sun's make, this causes the
39# make command to fail.
40#
41SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
42
43ifndef JDK_TOPDIR
44 ifdef BUILDDIR
45 JDK_TOPDIR=$(BUILDDIR)/..
46 else
47 JDK_TOPDIR:=$(error "ERROR: Cannot define top of jdk repository")
48 endif
49endif
50ifndef BUILDDIR
51 # Hack, due to deploy repository using this file.
52 BUILDDIR=$(JDK_TOPDIR)/make
53endif
54ifndef JDK_MAKE_SHARED_DIR
55 JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
56endif
57
58include $(JDK_MAKE_SHARED_DIR)/Platform.gmk
59
60TOPDIR=$(BUILDDIR)/..
61
62include $(JDK_TOPDIR)/make/common/CancelImplicits.gmk
63
64# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to
65# src/solaris so if you want to build on Linux you didn't need a src/linux
66# directory. In an ideal world it would be called src/genunix but we are not
67# there yet.
68#
69ifndef SHARE_SRC
70 SHARE_SRC = $(BUILDDIR)/../src/share
71endif
72
73# Files that cannot be included in the OpenJDK distribution are
74# collected under a parent directory which contains just those files.
75ifndef CLOSED_SRC
76 CLOSED_SRC = $(BUILDDIR)/../src/closed
77endif
78
79# If we have no closed directory, force it to an openjdk build
80CLOSED_SRC_DIR_EXISTS := $(shell \
81 if [ -d $(CLOSED_SRC) ] ; then \
82 echo true; \
83 else \
84 echo false; \
85 fi)
86ifeq ($(CLOSED_SRC_DIR_EXISTS), false)
87 OPENJDK = true
88endif
89
90# Check for strange explicit settings (change to empty or true)
91ifdef OPENJDK
92 ifeq ($(OPENJDK),false)
93 # Silently treat as not defined
94 OPENJDK =
95 else
96 ifneq ($(OPENJDK),true)
97 dummy := $(warning "WARNING: OPENKJDK=$(OPENJDK) being treated as true")
98 OPENJDK = true
99 endif
100 endif
101endif
102
103# Define where closed directories are
104ifdef OPENJDK
105 CLOSED_SRC =
106 CLOSED_SHARE_SRC =
107else
108 ifndef CLOSED_SHARE_SRC
109 CLOSED_SHARE_SRC = $(CLOSED_SRC)/share
110 endif
111endif
112
113# Default output directory
114ifdef OPENJDK
115_OUTPUTDIR=$(JDK_TOPDIR)/build/$(PLATFORM)-$(ARCH)$(OPENJDK_SUFFIX)
116else
117_OUTPUTDIR=$(JDK_TOPDIR)/build/$(PLATFORM)-$(ARCH)
118endif
119
120#
121# Get platform definitions
122#
123
124include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
125
126#
127# Freetype logic is applicable to OpenJDK only
128#
129ifdef OPENJDK
130
131#if we use system lib we do not need to copy it to build tree
132USING_SYSTEM_FT_LIB=false
133
134ifeq ($(PLATFORM), windows)
135 DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH)
136endif
137ifeq ($(PLATFORM), linux)
138 DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH)
139endif
140ifeq ($(PLATFORM), solaris)
141 # historically for Solaris we have slightly different devtools
142 # naming conventions
143 DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH)
144endif
145
146DEVTOOLS_FT_DIR_EXISTS = $(shell \
147 if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \
148 echo true; \
149 else \
150 echo false; \
151 fi)
152
153 ifdef ALT_FREETYPE_LIB_PATH
154 FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH)
155 else
156 ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
157 FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib
158 else
159 FREETYPE_LIB_PATH = /usr/lib
160 USING_SYSTEM_FT_LIB=true
161 endif
162 endif
163
164 ifeq ($(filter-out windows os2,$(PLATFORM)),)
165 FREETYPE_LIB = $(FREETYPE_LIB_PATH)/freetype.lib
166 else
167 FREETYPE_LIB = -L$(FREETYPE_LIB_PATH) -lfreetype
168 endif
169
170 ifdef ALT_FREETYPE_HEADERS_PATH
171 FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH)
172 else
173 ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
174 FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include
175 else
176 FREETYPE_HEADERS_PATH = /usr/include
177 endif
178 endif
179endif
180
181#
182# Localizations for the different parts of the product beyond English
183#
184
185JRE_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK
186PLUGIN_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK
187JDK_LOCALES = ja zh_CN
188
189#
190# A list of locales we support but don't have resource files.
191# This is defined to optimize the search of resource bundles.
192#
193JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
194
195#
196# All libraries except libjava and libjvm itself link against libjvm and
197# libjava, the latter for its exported common utilities. libjava only links
198# against libjvm. Programs' makefiles take their own responsibility for
199# adding other libs.
200#
201ifdef PACKAGE
202# put JAVALIB first, but do not lose any platform specific values....
203 LDLIBS_COMMON = $(JAVALIB)
204endif # PACKAGE
205
206#
207# Libraries that must appear ahead of libc.so on the link command line
208#
209ifdef PROGRAM
210
211 ifeq ($(PLATFORM), solaris)
212 LDLIBS_COMMON = -lthread -ldl
213 endif
214
215 ifeq ($(PLATFORM), linux)
216 LDLIBS_COMMON = -ldl
217 endif
218
219endif # PROGRAM
220
221LDLIBS_COMMON += $(EXTRA_LIBS)
222
223# for generated libraries
224LIBDIR = $(OUTPUTDIR)/lib
225ABS_LIBDIR = $(ABS_OUTPUTDIR)/lib
226# Optional place to save the windows .lib files
227LIBFILES_DIR = $(OUTPUTDIR)/libfiles
228# for ext jre files
229EXTDIR = $(LIBDIR)/ext
230# for generated include files
231INCLUDEDIR = $(OUTPUTDIR)/include
232# for generated class files
233CLASSBINDIR = $(OUTPUTDIR)/classes
234DEMOCLASSDIR = $(OUTPUTDIR)/democlasses
235# for generated tool class files
236BUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses
237# for build tool jar files
238BUILDTOOLJARDIR = $(OUTPUTDIR)/btjars
239ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
240# for generated java source files
241GENSRCDIR = $(OUTPUTDIR)/gensrc
242# for generated C source files (not javah)
243GENNATIVESRCDIR = $(OUTPUTDIR)/gennativesrc
244# for imported source files
245IMPORTSRCDIR = $(OUTPUTDIR)/impsrc
246# for imported documents
247IMPORTDOCDIR = $(OUTPUTDIR)/impdoc
248# for generated demo
249DEMODIR = $(OUTPUTDIR)/demo
250# for sample code
251SAMPLEDIR = $(OUTPUTDIR)/sample
252# for generated documentation
253DOCSDIR = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX)
254DOCSDIRSUFFIX =
255
256# The MESSAGE, WARNING and ERROR files are used to store sanityck and
257# SCCS check messages, warnings and errors.
258ifndef ERROR_FILE
259 ERROR_FILE = $(OUTPUTDIR)/sanityCheckErrors.txt
260endif
261ifndef WARNING_FILE
262 WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt
263endif
264ifndef MESSAGE_FILE
265 MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt
266endif
267
268JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-image
269JRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image
270
271#where the demo source can be found
272DEMOSRCDIR = $(SHARE_SRC)/demo
273
274# An attempt is made to generate unique enough directories for the
275# generated files to not have name collisisons. Most build units
276# defines PRODUCT (except Release.gmk), but then they may or may
277# not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and
278# LIBRARY. This code chunk attempts to generate a unique
279# OBJDIR/CLASSHDRDIR for each build unit based on which of those
280# values are set within each build unit.
281
282UNIQUE_LOCATION_STRING = tmp
283
284ifneq ($(PRODUCT),)
285 UNIQUE_LOCATION_STRING += /$(PRODUCT)
286endif
287
288ifneq ($(PACKAGE),)
289 UNIQUE_LOCATION_STRING += /$(PACKAGE)
290endif
291
292ifneq ($(PROGRAM),)
293 UNIQUE_LOCATION_STRING += /$(PROGRAM)
294endif
295
296ifneq ($(LIBRARY),)
297 ifneq ($(LIBRARY_OUTPUT),)
298 UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT)
299 else
300 UNIQUE_LOCATION_STRING += /$(LIBRARY)
301 endif
302endif
303
304ifneq ($(THREADDIR),)
305 UNIQUE_LOCATION_STRING += /$(THREADDIR)
306endif
307
308# the use of += above makes a space separated list which we need to
309# remove for filespecs.
310#
311NULLSTRING :=
312ONESPACE := $(NULLSTRING) # space before this comment is required.
313UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING))
314
315# TEMPDIR is a unique general purpose directory
316# need to use 'override' because GNU Make on Linux exports the wrong
317# value.
318override TEMPDIR = $(OUTPUTDIR)/$(UNIQUE_PATH)
319override ABS_TEMPDIR = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH)
320
321# This must be created right away for pattern rules in Sanity.gmk to work.
322dummy1:=$(shell $(MKDIR) -p $(TEMPDIR))
323dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK))
324
325# OBJDIRNAME is the name of the directory where the object code is to
326# be placed. It's name depends on whether the data model architecture
327# is 32-bit or not.
328ifneq ($(ARCH_DATA_MODEL), 32)
329 OBJDIRNAME = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)
330else
331 OBJDIRNAME = obj$(OBJDIRNAME_SUFFIX)
332endif
333OBJDIR = $(TEMPDIR)/$(OBJDIRNAME)
334
335# CLASSHDRDIR is where the generated C Class Header files go.
336CLASSHDRDIR = $(TEMPDIR)/CClassHeaders
337
338#
339# CLASSDESTDIR can be used to specify the directory where generated classes
340# are to be placed. The default is CLASSBINDIR.
341#
342ifndef CLASSDESTDIR
343CLASSDESTDIR = $(CLASSBINDIR)
344endif
345
346INCLUDES = -I. -I$(CLASSHDRDIR) \
347 $(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
348ifneq ($(PLATFORM), os2)
349OTHER_CPPFLAGS = $(INCLUDES)
350endif
351
352#
353# vpaths. These are the default locations searched for source files.
354# GNUmakefiles of individual areas often override the default settings.
355# There are no longer default vpath entries for C and assembler files
356# so we can ensure that libraries don't get their hands on JVM files.
357#
358# We define an intermediate variable for Java files because
359# we use its value later to help define $SOURCEPATH
360
361VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
362ifdef OPENJDK
363 VPATH.java = $(VPATH0.java)
364else
365 #
366 # If filenames are duplicated between open/closed workspaces, prefer
367 # the closed files.
368 #
369 # Source ordering is important: some targets depend on closed files
370 # replacing open ones, and thus the closed file sources must be found
371 # before the open ones.
372 #
373 # Don't reorder without consulting the teams that depend on this behavior.
374 #
375 VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java)
376endif
377vpath %.java $(VPATH.java)
378vpath %.class $(CLASSBINDIR)
379vpath %.$(OBJECT_SUFFIX) $(OBJDIR)
380
381#
382# VPATH.h is used elsewhere to generate include flags. By default,
383# anyone has access to the include files that the JVM area exports,
384# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
385# relatives.
386#
387VPATH.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/include$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/javavm/include
388vpath %.h $(VPATH.h)
389
390#
391# Used in two ways: helps link against libjava.so. Also if overridden
392# determines where your shared library is installed.
393#
394ifndef LIB_LOCATION
395 LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
396endif
397
398#
399# Java header and stub variables
400#
401CLASSHDRS = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export)))
402CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX)
403STUBPREAMBLE = $(INCLUDEDIR)/StubPreamble.h
404
405#
406# Classpath seen by javac (different from the one seen by the VM
407# running javac), and useful variables.
408#
409SOURCEPATH = $(VPATH.java)
410PKG = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)')
411PKGDIR = $(subst .,/,$(PACKAGE))
412
413#
414# The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.)
415#
416include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
417
418#
419# Set opt level to ALT_OPT if set otherwise _OPT
420#
421POPT = $(_OPT$(ALT_OPT))$(ALT_OPT)
422
423#
424# Convenient macros
425#
426
427# Prepare $@ target file, remove old one and making sure directory exists
428define prep-target
429$(MKDIR) -p $(@D)
430$(RM) $@
431endef
432
433# Prepare $@ target directory, remove old one and making sure parent exists
434define prep-dir-target
435$(MKDIR) -p $(@D)
436$(RM) -r $@
437endef
438
439# Simple install of $< file to $@
440define install-file
441$(prep-target)
442$(CP) $< $@
443endef
444
445# Cleanup rule for after debug java run (hotspot.log file is left around)
446# (This could be an old leftover file in a read-only area, use the @- prefix)
447HOTSPOT_LOG_NAME = hotspot.log
448define java-vm-cleanup
449if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi
450endef
451
452# Default make settings for processing SUBDIRS with clobber or clean names
453SUBDIRS_MAKEFLAGS-clobber = INCREMENTAL_BUILD=false
454SUBDIRS_MAKEFLAGS-clean = INCREMENTAL_BUILD=false
455
456# Current directory
457CURRENT_DIRECTORY := $(shell $(PWD))
458
459# If no timing wanted, we need to define these as empty
460ifdef NO_TIMING
461
462TIMING_ID:=NA
463
464define TIMING_start
465t=0:0:0:0
466endef
467
468define TIMING_end
469time_used=0
470endef
471
472else # NO_TIMING
473
474# Default timing id
475TIMING_ID:=$(shell $(BASENAME) $(CURRENT_DIRECTORY))
476
477# Timing start (must be used in same shell, e.g. same command line)
478# Defines the shell variable $1 to have the start time.
479define TIMING_start
480$1=`$(DATE) +%j:%H:%M:%S`
481endef
482
483# Timing end (must be used in same shell, e.g. same command line)
484# Expects shell variable $1 to have been defined as the start time.
485# Expects shell variable $2 to have timing id string
486# Sets total_seconds shell variable as the total seconds used.
487# Sets time_used shell variable to contain format "%dh%dm%ds"
488define TIMING_end
489begTime="$${$1}"; \
490timing_id="$${$2}"; \
491endTime=`$(DATE) +%j:%H:%M:%S`; \
492d1=`$(ECHO) $${begTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
493if [ "$${d1}" = "" ] ; then d1=0; fi; \
494h1=`$(ECHO) $${begTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
495if [ "$${h1}" = "" ] ; then h1=0; fi; \
496m1=`$(ECHO) $${begTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
497if [ "$${m1}" = "" ] ; then m1=0; fi; \
498s1=`$(ECHO) $${begTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
499if [ "$${s1}" = "" ] ; then s1=0; fi; \
500d2=`$(ECHO) $${endTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
501if [ "$${d2}" = "" ] ; then d2=0; fi; \
502h2=`$(ECHO) $${endTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
503if [ "$${h2}" = "" ] ; then h2=0; fi; \
504m2=`$(ECHO) $${endTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
505if [ "$${m2}" = "" ] ; then m2=0; fi; \
506s2=`$(ECHO) $${endTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
507if [ "$${s2}" = "" ] ; then s2=0; fi; \
508t1_secs=`$(EXPR) $${d1} '*' 60 '*' 60 '*' 24 '+' $${h1} '*' 60 '*' 60 \
509 '+' $${m1} '*' 60 '+' $${s1}`; \
510t2_secs=`$(EXPR) $${d2} '*' 60 '*' 60 '*' 24 '+' $${h2} '*' 60 '*' 60 \
511 '+' $${m2} '*' 60 '+' $${s2}`; \
512total_seconds=`$(EXPR) $${t2_secs} '-' $${t1_secs}`; \
513if [ "$${total_seconds}" -lt 0 ] ; then total_seconds=0; fi; \
514t_hour=`$(EXPR) $${total_seconds} '/' '(' 60 '*' 60 ')'`h; \
515t_min=`$(EXPR) '(' $${total_seconds} '%' '(' 60 '*' 60 ')' ')' '/' 60`m; \
516t_sec=`$(EXPR) $${total_seconds} '%' 60`s; \
517time_used=$${t_sec}; \
518if [ "$${t_hour}" != "0h" ] ; then \
519time_used=$${t_hour}$${t_min}$${t_sec}; \
520elif [ "$${t_min}" != "0m" ] ; then \
521time_used=$${t_min}$${t_sec}; \
522else \
523time_used=$${t_sec}; \
524fi; \
525$(PRINTF) " Timing: %05d seconds or %s for %s\n" \
526 $${total_seconds} $${time_used} $${timing_id}
527endef
528
529endif # NO_TIMING
530
531# Given a SUBDIRS list, cd into them and make them
532# SUBDIRS_MAKEFLAGS Make settings for a subdir make
533# SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target
534define SUBDIRS-loop
535@$(ECHO) "Begin Processing SUBDIRS: $(SUBDIRS)"
536@for i in DUMMY $(SUBDIRS) ; do \
537 if [ "$$i" != "DUMMY" ] ; then \
538 $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
539 timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
540 $(call TIMING_start,startTime); \
541 curDir=$(CURRENT_DIRECTORY); \
542 $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
543 $(SUBDIRS_MAKEFLAGS) \
544 $(SUBDIRS_MAKEFLAGS-$@) \
545 FULL_VERSION=$(FULL_VERSION) \
546 RELEASE=$(RELEASE) || exit 1; \
547 $(CD) $${curDir}; \
548 $(call TIMING_end,startTime,timing_id); \
549 $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
550 fi ; \
551done
552@$(ECHO) "Done Processing SUBDIRS: $(SUBDIRS)"
553endef
554
555# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
556# OTHERSUBDIRS_MAKEFLAGS Make settings for a subdir make
557define OTHERSUBDIRS-loop
558@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
559@for i in DUMMY $(OTHERSUBDIRS) ; do \
560 if [ "$$i" != "DUMMY" ] ; then \
561 $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
562 timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
563 $(call TIMING_start,startTime); \
564 curDir=$(CURRENT_DIRECTORY); \
565 $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
566 $(OTHERSUBDIRS_MAKEFLAGS) \
567 FULL_VERSION=$(FULL_VERSION) \
568 RELEASE=$(RELEASE) || exit 1; \
569 $(CD) $${curDir}; \
570 $(call TIMING_end,startTime,timing_id); \
571 $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
572 fi ; \
573done
574@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
575endef
576
577#
578# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
579# used for this file, otherwise the default settings are used.
580#
581CFLAGS_$(VARIANT)/BYFILE = $(CFLAGS_$(VARIANT)/$(@F)) \
582 $(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F)))
583CXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \
584 $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F)))
585
586#
587# Tool flags
588#
589ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
590CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS)
591CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)
592ifeq ($(PLATFORM), os2)
593CPPFLAGS = $(INCLUDES) $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
594 $(DEFINES) $(OPTIONS:%=-D%)
595else
596CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
597 $(DEFINES) $(OPTIONS:%=-D%)
598endif
599LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
600LDLIBS = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
601LINTFLAGS = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
602 $(OTHER_LINTFLAGS)
603
604VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
605
606# Note: As a rule, GNU Make rules should not appear in any of the
607# Defs*.gmk files. These were added for Kestrel-Solaris and do address
608# a TeamWare bug. They should be moved elsewhere for Merlin.
609#
610# Override gnumake built-in rules which do sccs get operations badly.
611# (They put the checked out code in the current directory, not in the
612# directory of the original file.)
613# Since this is a symptom of a teamware failure, complain and die on the spot.
614
615# This message immediately goes to stdout and the build terminates.
616define SCCS-trouble
617$(error \
618"ERROR: File $@ referenced while building in $(CURRENT_DIRECTORY) \
619 is out of date with respect to its SCCS file $<. \
620 This can happen from an unresolved Teamware conflict, a file movement, or \
621 a failure in which SCCS files are updated but the 'sccs get' was not done. \
622 You should double check for other out of date files in your workspace. \
623 Or run: cd $(TOPDIR) && $(MAKE) sccs_get")
624endef
625
626%:: s.%
627 @$(SCCS-trouble)
628%:: SCCS/s.%
629 @$(SCCS-trouble)
630 @$(ECHO) " is out of date with respect to its SCCS file." >> $(WARNING_FILE)
631 @$(ECHO) " This file may be from an unresolved Teamware conflict." >> $(WARNING_FILE)
632 @$(ECHO) " This is also a symptom of a Teamware bringover/putback failure" >> $(WARNING_FILE)
633 @$(ECHO) " in which SCCS files are updated but not checked out." >> $(WARNING_FILE)
634 @$(ECHO) " Check for other out of date files in your workspace." >> $(WARNING_FILE)
635 @$(ECHO) "" >> $(WARNING_FILE)
636 @#exit 666
637
638ifdef INSANE
639 export INSANE
640endif
641
642ifdef ALT_COPYRIGHT_YEAR
643 COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
644else
645 COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
646endif
647
648# Install of imported file (JDK_IMPORT_PATH, or some other external location)
649define install-import-file
650@$(ECHO) "ASSEMBLY_IMPORT: $@"
651$(install-file)
652endef
653
654.PHONY: all build clean clobber
Note: See TracBrowser for help on using the repository browser.