Main.gmk revision 1131:70e378877c6a
198944Sobrien#
298944Sobrien# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
398944Sobrien# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
498944Sobrien#
598944Sobrien# This code is free software; you can redistribute it and/or modify it
698944Sobrien# under the terms of the GNU General Public License version 2 only, as
798944Sobrien# published by the Free Software Foundation.  Oracle designates this
898944Sobrien# particular file as subject to the "Classpath" exception as provided
998944Sobrien# by Oracle in the LICENSE file that accompanied this code.
1098944Sobrien#
1198944Sobrien# This code is distributed in the hope that it will be useful, but WITHOUT
1298944Sobrien# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1398944Sobrien# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1498944Sobrien# version 2 for more details (a copy is included in the LICENSE file that
1598944Sobrien# accompanied this code).
1698944Sobrien#
1798944Sobrien# You should have received a copy of the GNU General Public License version
1898944Sobrien# 2 along with this work; if not, write to the Free Software Foundation,
1998944Sobrien# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2098944Sobrien#
2198944Sobrien# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2298944Sobrien# or visit www.oracle.com if you need additional information or have any
2398944Sobrien# questions.
2498944Sobrien#
25130803Smarcel
26130803Smarcel################################################################################
27130803Smarcel# This is the main makefile containing most actual top level targets. It needs
2898944Sobrien# to be called with a SPEC file defined.
2998944Sobrien
3098944Sobrien# Declare default target
3198944Sobriendefault:
3298944Sobrien
3398944Sobrien# Now load the spec
3498944Sobrieninclude $(SPEC)
3598944Sobrien
3698944Sobrieninclude $(SRC_ROOT)/make/MakeHelpers.gmk
3798944Sobrien
3898944Sobrien# Load the vital tools for all the makefiles.
3998944Sobrieninclude $(SRC_ROOT)/make/common/MakeBase.gmk
40130803Smarcelinclude $(SRC_ROOT)/make/common/Modules.gmk
41130803Smarcel
42130803Smarcel# Load common profile names definitions
4398944Sobrieninclude $(JDK_TOPDIR)/make/ProfileNames.gmk
4498944Sobrien
4598944Sobrien# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
46130803Smarcel# valid top level targets. It's used to declare them all as PHONY and to 
47130803Smarcel# generate the -only targets.
4898944SobrienALL_TARGETS :=
4998944Sobrien
5098944Sobrien# Hook to include the corresponding custom file, if present.
5198944Sobrien$(eval $(call IncludeCustomExtension, , Main.gmk))
52130803Smarcel
5398944Sobrien# All modules for the current target platform.
5498944Sobrien# Manually add jdk.hotspot.agent for now.
5598944SobrienALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
5698944Sobrien
5798944Sobrien################################################################################
58130803Smarcel################################################################################
5998944Sobrien#
6098944Sobrien# Recipes for all targets. Only recipes, dependencies are declared later.
6198944Sobrien#
6298944Sobrien################################################################################
6398944Sobrien
64130803Smarcel################################################################################
6598944Sobrien# Interim/build tools targets, compiling tools used during the build
6698944Sobrien
6798944Sobrieninterim-langtools:
6898944Sobrien	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterim.gmk)
6998944Sobrien
70130803Smarcelinterim-corba:
7198944Sobrien	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileCorba.gmk)
72130803Smarcel
7398944Sobrieninterim-rmic:
7498944Sobrien	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
7598944Sobrien
7698944Sobrienbuild-tools-jdk:
7798944Sobrien	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Tools.gmk java-tools)
78130803Smarcel
7998944SobrienALL_TARGETS += interim-langtools interim-corba build-tools-jdk
8098944Sobrien
8198944Sobrien################################################################################
8298944Sobrien# Special targets for certain modules
8398944Sobrien
8498944Sobrienimport-hotspot:
8598944Sobrien	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Import.gmk)
8698944Sobrien
8798944Sobrienunpack-sec:
8898944Sobrien	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f UnpackSecurity.gmk)
8998944Sobrien
9098944Sobrienpolicy-jars:
91130803Smarcel	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreatePolicyJars.gmk)
9298944Sobrien
9398944SobrienALL_TARGETS += import-hotspot unpack-sec policy-jars
9498944Sobrien
9598944Sobrien################################################################################
9698944Sobrien# Gensrc targets, generating source before java compilation can be done
97130803SmarcelJDK_GENSRC_MODULES := $(call FindModulesWithMakefileFor, gensrc, Gensrc)
9898944SobrienLANGTOOLS_GENSRC_MODULES := jdk.compiler.tools
9998944SobrienCORBA_GENSRC_MODULES := java.corba
10098944SobrienGENSRC_MODULES := $(JDK_GENSRC_MODULES) $(LANGTOOLS_GENSRC_MODULES) \
10198944Sobrien    $(CORBA_GENSRC_MODULES)
10298944SobrienJDK_GENSRC_TARGETS := $(addsuffix -gensrc, $(JDK_GENSRC_MODULES))
10398944SobrienLANGTOOLS_GENSRC_TARGETS := $(addsuffix -gensrc, $(LANGTOOLS_GENSRC_MODULES))
104130803SmarcelCORBA_GENSRC_TARGETS := $(addsuffix -gensrc, $(CORBA_GENSRC_MODULES))
10598944SobrienGENSRC_TARGETS := $(addsuffix -gensrc, $(GENSRC_MODULES))
10698944Sobrien
10798944Sobrienjdk.compiler.tools-gensrc:
10898944Sobrien	+($(CD) $(LANGTOOLS_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcLangtools.gmk)
10998944Sobrien
110130803Smarceljava.corba-gensrc:
11198944Sobrien	+($(CD) $(CORBA_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f GensrcCorba.gmk)
11298944Sobrien
11398944Sobrien# Declare recipes for all jdk <module>-gensrc targets
11498944Sobrien$(foreach m, $(JDK_GENSRC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
11598944Sobrien    $m, gensrc, gensrc, Gensrc)))
11698944Sobrien
11798944SobrienALL_TARGETS += $(GENSRC_TARGETS)
11898944Sobrien
11998944Sobrien################################################################################
12098944Sobrien# Generate data targets
12198944SobrienGENDATA_MODULES := $(call FindModulesWithMakefileFor, gendata, Gendata)
122130803SmarcelGENDATA_TARGETS := $(addsuffix -gendata, $(GENDATA_MODULES))
12398944Sobrien
12498944Sobrien# Declare recipes for all <module>-gendata targets
12598944Sobrien$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
12698944Sobrien    $m, gendata, gendata, Gendata)))
127130803Smarcel
12898944Sobrien$(foreach m, $(GENDATA_MODULES), $(eval $(call DeclareGendataRecipe,$m)))
12998944Sobrien
13098944SobrienALL_TARGETS += $(GENDATA_TARGETS)
13198944Sobrien
13298944Sobrien################################################################################
13398944Sobrien# Copy files targets
13498944SobrienCOPY_MODULES := $(call FindModulesWithMakefileFor, copy, Copy)
13598944SobrienCOPY_TARGETS := $(addsuffix -copy, $(COPY_MODULES))
13698944Sobrien
13798944Sobrien# Declare recipes for all <module>-copy targets
13898944Sobrien$(foreach m, $(COPY_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
139130803Smarcel    $m, copy, copy, Copy)))
14098944Sobrien
14198944SobrienALL_TARGETS += $(COPY_TARGETS)
14298944Sobrien
14398944Sobrien################################################################################
14498944Sobrien# Targets for compiling all java modules. Nashorn is treated separately.
145130803SmarcelJAVA_MODULES := $(call FindJavaModules)
14698944SobrienJAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
14798944Sobrien
14898944Sobriendefine DeclareCompileJavaRecipe
14998944Sobrien  $1-java:
15098944Sobrien	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CompileJavaModules.gmk \
15198944Sobrien	    $1 JAVA_MODULES=$1)
152endef
153
154$(foreach m, $(filter-out jdk.scripting.nashorn, $(JAVA_MODULES)), \
155    $(eval $(call DeclareCompileJavaRecipe,$m)))
156
157# Build nashorn. Needs to be compiled separately from the rest of the modules
158# due to nasgen.
159jdk.scripting.nashorn-java:
160	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk compile)
161
162ALL_TARGETS += $(JAVA_TARGETS)
163
164################################################################################
165# Targets for running rmic.
166RMIC_MODULES := $(call FindModulesWithMakefileFor, rmic, Rmic)
167RMIC_TARGETS := $(addsuffix -rmic, $(RMIC_MODULES))
168
169# Declare recipes for all <module>-rmic targets
170$(foreach m, $(RMIC_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
171    $m, rmic, rmic, Rmic)))
172
173ALL_TARGETS += $(RMIC_TARGETS)
174
175################################################################################
176# Targets for compiling native libraries
177ALL_LIB_MODULES := $(call FindModulesWithMakefileFor, lib, Lib)
178LIB_MODULES := $(filter $(ALL_MODULES), $(ALL_LIB_MODULES))
179LIB_TARGETS := $(addsuffix -libs, $(LIB_MODULES))
180
181# Declare recipes for all <module>-libs targets
182$(foreach m, $(LIB_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
183    $m, libs, lib, Lib)))
184
185ALL_TARGETS += $(LIB_TARGETS)
186
187################################################################################
188# Targets for compiling native executables
189ALL_LAUNCHER_MODULES := $(call FindModulesWithMakefileFor, launcher, Launcher)
190LAUNCHER_MODULES := $(filter $(ALL_MODULES), $(ALL_LAUNCHER_MODULES))
191LAUNCHER_TARGETS := $(addsuffix -launchers, $(LAUNCHER_MODULES))
192
193# Declare recipes for all <module>-launchers targets
194$(foreach m, $(LAUNCHER_MODULES), $(eval $(call DeclareRecipeForModuleMakefile, \
195    $m, launchers, launcher, Launcher)))
196
197ALL_TARGETS += $(LAUNCHER_TARGETS)
198
199################################################################################
200# Build hotspot target
201
202ifeq ($(BUILD_HOTSPOT),true)
203  hotspot:
204	($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
205endif
206
207ALL_TARGETS += hotspot
208
209################################################################################
210# Build demos and samples targets
211
212demos:
213	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileDemos.gmk)
214
215samples:
216	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopySamples.gmk)
217
218ALL_TARGETS += demos samples
219
220################################################################################
221# Image targets
222
223# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
224# used to track the exact sources used to build that image.
225source-tips: $(OUTPUT_ROOT)/source_tips
226$(OUTPUT_ROOT)/source_tips: FRC
227	@$(MKDIR) -p $(@D)
228	@$(RM) $@
229	@$(call GetSourceTips)
230
231security-jars:
232	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateSecurityJars.gmk)
233
234nashorn-jar:
235	+($(CD) $(NASHORN_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk all)
236
237# Creates the jar files (rt.jar resources.jar etc)
238main-jars:
239	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CreateJars.gmk)
240
241# Creates the images (j2sdk-image j2re-image etc)
242images:
243	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk)
244        ifeq ($(OPENJDK_TARGET_OS), macosx)
245	  +($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk)
246        endif
247
248# Create Compact Profile jars
249PROFILE_JARS_TARGETS := $(addsuffix -jars, $(ALL_PROFILES))
250$(PROFILE_JARS_TARGETS):
251	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-jars=%) -f CreateJars.gmk)
252
253# Create Compact Profile images
254PROFILE_IMAGES_TARGETS := $(addsuffix -images, $(ALL_PROFILES))
255$(PROFILE_IMAGES_TARGETS):
256	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) PROFILE=$(@:%-images=%) \
257	    JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/j2re-$(word $(call profile_number,$(@:%-images=%)),$(PROFILE_NAMES))-image \
258	    -f Images.gmk profile-image)
259
260profiles-oscheck:
261        ifneq ($(OPENJDK_TARGET_OS), linux)
262	  @echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1
263        endif
264
265bootcycle-images:
266	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
267	+$(MAKE) $(MAKE_ARGS) -f Main.gmk SPEC=$(dir $(SPEC))bootcycle-spec.gmk images
268
269ALL_TARGETS += source-tips security-jars nashorn-jar main-jars images \
270    $(PROFILE_JARS_TARGETS) $(PROFILE_IMAGES_TARGETS) profiles-oscheck \
271    bootcycle-images
272
273################################################################################
274# Docs targets
275
276docs-javadoc:
277	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
278
279docs-jvmtidoc:
280	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
281
282ALL_TARGETS += docs-javadoc docs-jvmtidoc
283
284################################################################################
285# Test target
286
287test:
288	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
289	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_OUTPUT_DIR) \
290	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
291
292test-make:
293	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
294
295ALL_TARGETS += test test-make
296
297################################################################################
298# Verification targets
299
300# generate modules.xml in the exploded image
301modules-xml:
302	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk gen-modules-xml)
303
304verify-modules:
305	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ModulesXml.gmk checkdeps)
306
307ALL_TARGETS += modules-xml verify-modules
308
309################################################################################
310# Install targets
311
312install:
313	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
314
315ALL_TARGETS += install
316
317################################################################################
318#
319# Dependency declarations between targets. 
320#
321# These are declared in two groups. First all dependencies between targets that 
322# have recipes above as these dependencies may be disabled. Then the aggregator
323# targets that do not have recipes of their own, which will never have their
324# dependencies disabled.
325#
326################################################################################
327# Targets with recipes above
328
329# If running an *-only target, parallel execution and dependencies between 
330# recipe targets are disabled. This makes it possible to run a select set of 
331# recipe targets in order. It's the responsibility of the user to make sure
332# all prerequisites are fulfilled. 
333ifneq ($(findstring -only, $(MAKECMDGOALS)), )
334  .NOTPARALLEL:
335else
336  interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
337
338  build-tools-jdk: interim-langtools
339
340  $(CORBA_GENSRC_TARGETS): interim-langtools
341
342  $(JDK_GENSRC_TARGETS): interim-langtools build-tools-jdk
343
344  interim-corba: $(CORBA_GENSRC_TARGETS)
345
346  $(GENDATA_TARGETS): interim-langtools build-tools-jdk
347
348  interim-rmic: interim-langtools
349
350  $(RMIC_TARGETS): interim-langtools interim-corba interim-rmic
351
352  import-hotspot: hotspot
353
354  $(LIB_TARGETS): import-hotspot
355
356  $(LAUNCHER_TARGETS): java.base-libs
357
358  # The demos are currently linking to libjvm and libjava, just like all other
359  # jdk libs, even though they don't need to. To avoid warnings, make sure they
360  # aren't built until after libjava and libjvm are available to link to.
361  demos: $(JAVA_TARGETS)
362
363  # Declare dependency from <module>-java to <module>-gensrc
364  $(foreach m, $(GENSRC_MODULES), $(eval $m-java: $m-gensrc))
365
366  # Declare dependencies between java modules
367  $(foreach m, $(JAVA_MODULES), \
368      $(eval $m-java: $(addsuffix -java, $(filter $(JAVA_MODULES), \
369      $(call FindDepsForModule,$m)))))
370
371  # Declare dependencies between <module>-rmic to <module>-java
372  $(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
373
374  # Declare dependencies from <module>-lib to <module>-java
375  # Skip jdk.jdwp.agent as it contains no java code.
376  $(foreach m, $(filter-out jdk.jdwp.agent, $(LIB_MODULES)), $(eval $m-libs: $m-java))
377
378  # Declare dependencies from all other <module>-lib to java.base-lib
379  $(foreach t, $(filter-out java.base-libs, $(LIB_TARGETS)), \
380      $(eval $t: java.base-libs))
381  # Declare the special case dependency for jdk.deploy.osx where libosx 
382  # links against libosxapp.
383  jdk.deploy.osx-libs: java.desktop-libs
384
385  # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a 
386  # header file used by jdk.jdwp libs.
387  jdk.jdwp.agent-libs: jdk.jdi-gensrc
388
389  # Explicitly add dependencies for special targets
390  java.base-java: unpack-sec
391
392  security-jars: java
393
394  nashorn-jar: jdk.scripting.nashorn-java
395
396  main-jars: java rmic security-jars nashorn-jar policy-jars import-hotspot gendata
397
398  # On windows, the jars target needs to wait for jgss libs to be built.
399  # Should ideally split out the sec-bin zip file generation to avoid
400  # this dependency.
401  ifeq ($(OPENJDK_TARGET_OS), windows)
402    main-jars: java.security.jgss-libs
403  endif
404
405  images: jars demos samples exploded-image source-tips
406
407  bootcycle-images: images
408
409  # Need to depend on jars as otherwise there will a race between all the
410  # invocations of CreateJars.gmk.
411  $(PROFILE_JARS_TARGETS): jars profiles-oscheck
412
413  $(PROFILE_IMAGES_TARGETS): demos samples exploded-image source-tips
414
415  # Declare dependencies from <profile>-images to <profile>-jars
416  $(foreach p, $(ALL_PROFILES), $(eval $p-images: $p-jars))
417
418  docs-javadoc: $(GENSRC_TARGETS) rmic
419
420  docs-jvmtidoc: hotspot
421
422  test: exploded-image
423
424  modules-xml: build-tools-jdk java
425
426  verify-modules: exploded-image modules-xml
427
428endif
429
430################################################################################
431# Virtual targets without recipes
432
433gensrc: $(GENSRC_TARGETS)
434
435gendata: $(GENDATA_TARGETS)
436
437copy: $(COPY_TARGETS)
438
439java: $(JAVA_TARGETS)
440
441rmic: $(RMIC_TARGETS)
442
443libs: $(LIB_TARGETS)
444
445launchers: $(LAUNCHER_TARGETS)
446
447# Explicitly add dependencies for these special targets
448java.base: import-hotspot policy-jars
449
450# Declare dependencies from <module> to all the individual targets specific
451# to that module <module>-*.
452$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
453$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
454$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
455$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
456$(foreach m, $(LIB_MODULES), $(eval $m: $m-libs))
457$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
458$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
459
460ALL_MODULE_TARGETS := $(sort $(GENSRC_MODULES) $(JAVA_MODULES) \
461    $(GENDATA_MODULES) $(LIB_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
462
463exploded-image: $(ALL_MODULE_TARGETS) modules-xml
464
465jars: main-jars nashorn-jar security-jars policy-jars
466
467# Make each profile name a target that depends on it's images target.
468$(foreach p, $(ALL_PROFILES), $(eval $(p): $(p)-images $(p)-jars))
469
470profiles: $(ALL_PROFILES)
471
472docs: docs-javadoc docs-jvmtidoc
473
474ALL_TARGETS += gensrc gendata copy java rmic libs launchers \
475    $(ALL_MODULE_TARGETS) exploded-image jars \
476    $(ALL_PROFILES) profiles docs
477
478################################################################################
479
480all: images docs verify-modules
481default: exploded-image
482
483ALL_TARGETS += default all
484
485################################################################################
486################################################################################
487#
488# Clean targets
489#
490################################################################################
491
492# If running a clean target, disable parallel execution
493ifneq ($(findstring clean, $(MAKECMDGOALS)), )
494  .NOTPARALLEL:
495endif
496
497CLEAN_COMPONENTS += langtools corba hotspot jdk nashorn images \
498    bootcycle-build docs docstemp test
499CLEAN_TARGETS := $(addprefix clean-, $(CLEAN_COMPONENTS))
500
501# Remove everything, except the output from configure.
502clean: $(CLEAN_TARGETS)
503	($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
504	$(ECHO) Cleaned all build artifacts.
505
506$(CLEAN_TARGETS):
507	$(call CleanComponent,$(patsubst clean-%, %, $@))
508
509clean-docs: clean-docstemp
510
511# Remove everything, including configure configuration.
512# If the output directory was created by configure and now becomes empty, remove it as well.
513dist-clean: clean
514	($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \
515	    Makefile compare.sh spec.sh tmp javacservers)
516	$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
517	  if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
518	    $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
519	  else \
520	    ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
521	        && $(RM) -r $(OUTPUT_ROOT)) \
522	  fi \
523	)
524	$(ECHO) Cleaned everything, you will have to re-run configure.
525
526ALL_TARGETS += clean dist-clean $(CLEAN_TARGETS)
527
528################################################################################
529
530# Setup a rule for SPEC file that fails if executed. This check makes sure the 
531# configuration is up to date after changes to configure. 
532ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
533  $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
534	@$(ECHO) "ERROR: $(SPEC) is not up to date."
535	@$(ECHO) "Please rerun configure! Easiest way to do this is by running"
536	@$(ECHO) "'make reconfigure'."
537	@$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true"
538	@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
539endif
540
541reconfigure:
542        ifneq ($(CONFIGURE_COMMAND_LINE), )
543	  @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
544        else
545	  @$(ECHO) "Re-running configure using default settings"
546        endif
547	@( cd $(OUTPUT_ROOT) && $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
548
549ALL_TARGETS += reconfigure
550
551################################################################################
552# Declare *-only targets for each normal target
553$(foreach t, $(ALL_TARGETS), $(eval $(t)-only: $(t)))
554
555ALL_TARGETS += $(addsuffix -only, $(ALL_TARGETS))
556
557################################################################################
558
559.PHONY: $(ALL_TARGETS)
560
561include $(SRC_ROOT)/make/Jprt.gmk
562
563FRC: # Force target
564