1 # |
1 # |
2 # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
2 # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # |
4 # |
5 # This code is free software; you can redistribute it and/or modify it |
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 |
6 # under the terms of the GNU General Public License version 2 only, as |
7 # published by the Free Software Foundation. Oracle designates this |
7 # published by the Free Software Foundation. Oracle designates this |
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 # |
26 # Locate this Makefile |
27 # On Solaris, the standard 'make' utility will not work with these makefiles. |
27 ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), ) |
28 # This little rule is only understood by Solaris make, and is harmless |
28 makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST)) |
29 # when seen by the GNU make tool. If using Solaris make, this causes the |
29 else |
30 # make command to fail. |
30 makefile_path := $(lastword $(MAKEFILE_LIST)) |
31 # |
31 endif |
32 SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33 |
32 repo_dir := $(patsubst %/make/Makefile, %, $(makefile_path)) |
33 |
33 |
|
34 # What is the name of this subsystem (langtools, corba, etc)? |
|
35 subsystem_name := $(notdir $(repo_dir)) |
34 |
36 |
35 # Default target and expected 'do everything' target |
37 # Try to locate top-level makefile |
|
38 top_level_makefile := $(repo_dir)/../Makefile |
|
39 ifneq ($(wildcard $(top_level_makefile)), ) |
|
40 $(info Will run $(subsystem_name) target on top-level Makefile) |
|
41 $(info WARNING: This is a non-recommended way of building!) |
|
42 $(info ===================================================) |
|
43 else |
|
44 $(info Cannot locate top-level Makefile. Is this repo not checked out as part of a complete forest?) |
|
45 $(error Build from top-level Makefile instead) |
|
46 endif |
|
47 |
36 all: |
48 all: |
37 echo Nashorn can only be built with NEWBUILD=true |
49 @$(MAKE) -f $(top_level_makefile) $(subsystem_name) |
38 |
|
39 # Standard make clobber target |
|
40 clobber: |
|
41 |
|
42 #------------------------------------------------------------------- |
|
43 # |
|
44 # Targets for Oracle's internal JPRT build system |
|
45 |
|
46 CD = cd |
|
47 ZIP = zip |
|
48 |
|
49 JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip |
|
50 |
|
51 jprt_build_product jprt_build_debug jprt_build_fastdebug: all |
|
52 ( $(CD) $(OUTPUTDIR) && \ |
|
53 $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist ) |
|
54 |
|
55 #------------------------------------------------------------------- |
|
56 |
|
57 # Declare these phony (not filenames) |
|
58 .PHONY: $(ANT_TARGETS) all clobber \ |
|
59 jprt_build_product jprt_build_debug jprt_build_fastdebug |
|