21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
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 |
22 # or visit www.oracle.com if you need additional information or have any |
23 # questions. |
23 # questions. |
24 # |
24 # |
25 |
25 |
26 # This must be the first rule |
26 include ../../NewMakefile.gmk |
27 all: |
|
28 |
|
29 # Inclusion of this pseudo-target will cause make to execute this file |
|
30 # serially, regardless of -j. Recursively called makefiles will not be |
|
31 # affected, however. This is required for correct dependency management. |
|
32 .NOTPARALLEL: |
|
33 |
|
34 # The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make. |
|
35 # /usr/ccs/bin/make lacks basically every other flow control mechanism. |
|
36 TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1 |
|
37 |
|
38 # Assume we have GNU make, but check version. |
|
39 ifeq (,$(findstring 3.81,$(MAKE_VERSION))) |
|
40 ifeq (,$(findstring 3.82,$(MAKE_VERSION))) |
|
41 $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.) |
|
42 endif |
|
43 endif |
|
44 |
|
45 # Locate this Makefile |
|
46 ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) |
|
47 makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) |
|
48 else |
|
49 makefile_path:=$(lastword $(MAKEFILE_LIST)) |
|
50 endif |
|
51 root_dir:=$(patsubst %/common/makefiles/Makefile,%,$(makefile_path)) |
|
52 |
|
53 # ... and then we can include our helper functions |
|
54 include $(dir $(makefile_path))/MakeHelpers.gmk |
|
55 |
|
56 $(eval $(call ParseLogLevel)) |
|
57 $(eval $(call ParseConfAndSpec)) |
|
58 |
|
59 # Now determine if we have zero, one or several configurations to build. |
|
60 ifeq ($(SPEC),) |
|
61 # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing. |
|
62 else |
|
63 ifeq ($(words $(SPEC)),1) |
|
64 # We are building a single configuration. This is the normal case. Execute the Main.gmk file. |
|
65 include $(dir $(makefile_path))/Main.gmk |
|
66 else |
|
67 # We are building multiple configurations. |
|
68 # First, find out the valid targets |
|
69 # Run the makefile with an arbitraty SPEC using -p -q (quiet dry-run and dump rules) to find |
|
70 # available PHONY targets. Use this list as valid targets to pass on to the repeated calls. |
|
71 all_phony_targets=$(filter-out $(global_targets), $(strip $(shell \ |
|
72 $(MAKE) -p -q -f $(makefile_path) SPEC=$(firstword $(SPEC)) | \ |
|
73 grep ^.PHONY: | head -n 1 | cut -d " " -f 2-))) |
|
74 |
|
75 $(all_phony_targets): |
|
76 @$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@) &&) true |
|
77 |
|
78 endif |
|
79 endif |
|
80 |
|
81 # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration. |
|
82 # If you addd more global targets, please update the variable global_targets in MakeHelpers. |
|
83 |
|
84 help: |
|
85 $(info ) |
|
86 $(info OpenJDK Makefile help) |
|
87 $(info =====================) |
|
88 $(info ) |
|
89 $(info Common make targets) |
|
90 $(info . make [all] # Compile all code but do not create images) |
|
91 $(info . make images # Create complete j2sdk and j2re images) |
|
92 $(info . make overlay-images # Create limited images for sparc 64 bit platforms) |
|
93 $(info . make bootcycle-images # Build images twice, second time with newly build JDK) |
|
94 $(info . make install # Install the generated images locally) |
|
95 $(info . make clean # Remove all files generated by make, but not those) |
|
96 $(info . # generated by configure) |
|
97 $(info . make dist-clean # Remove all files, including configuration) |
|
98 $(info . make help # Give some help on using make) |
|
99 $(info . make test # Run tests, default is all tests (see TEST below)) |
|
100 $(info ) |
|
101 $(info Targets for specific components) |
|
102 $(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk, images or overlay-images)) |
|
103 $(info . make <component> # Build <component> and everything it depends on. ) |
|
104 $(info . make <component>-only # Build <component> only, without dependencies. This) |
|
105 $(info . # is faster but can result in incorrect build results!) |
|
106 $(info . make clean-<component> # Remove files generated by make for <component>) |
|
107 $(info ) |
|
108 $(info Useful make variables) |
|
109 $(info . make CONF= # Build all configurations (note, assignment is empty)) |
|
110 $(info . make CONF=<substring> # Build the configuration(s) with a name matching) |
|
111 $(info . # <substring>) |
|
112 $(info ) |
|
113 $(info . make LOG=<loglevel> # Change the log level from warn to <loglevel>) |
|
114 $(info . # Available log levels are:) |
|
115 $(info . # 'warn' (default), 'info', 'debug' and 'trace') |
|
116 $(info . # To see executed command lines, use LOG=debug) |
|
117 $(info ) |
|
118 $(info . make JOBS=<n> # Run <n> parallel make jobs) |
|
119 $(info . # Note that -jN does not work as expected!) |
|
120 $(info ) |
|
121 $(info . make test TEST=<test> # Only run the given test or tests, e.g.) |
|
122 $(info . # make test TEST="jdk_lang jdk_net") |
|
123 $(info ) |
|
124 |
|
125 configure: |
|
126 @$(SHELL) $(root_dir)/configure $(CONFIGURE_ARGS) |
|
127 @echo ==================================================== |
|
128 @echo "Note: This is a non-recommended way of running configure." |
|
129 @echo "Instead, run 'sh configure' in the top-level directory" |
|
130 |
|
131 .PHONY: help configure |
|