author | valeriep |
Fri, 26 Jun 2015 21:34:34 +0000 | |
changeset 31270 | e6470b24700d |
parent 30853 | 0384273d840d |
child 31305 | 11c86b5b827d |
child 31310 | 481585782338 |
permissions | -rw-r--r-- |
27560 | 1 |
# |
2 |
# Copyright (c) 2014, 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 |
default: all |
|
27 |
||
28 |
include $(SPEC) |
|
29 |
include MakeBase.gmk |
|
30 |
||
31 |
################################################################################ |
|
32 |
# Copy native libraries and executables to a secondary location to strip them |
|
33 |
# and filter out files that shouldn't go into the image. |
|
34 |
||
35 |
MODULES_CMDS_STRIPPED := $(SUPPORT_OUTPUTDIR)/modules_cmds-stripped |
|
36 |
MODULES_LIBS_STRIPPED := $(SUPPORT_OUTPUTDIR)/modules_libs-stripped |
|
37 |
||
38 |
ifneq ($(POST_STRIP_CMD), ) |
|
39 |
define StripRecipe |
|
40 |
$(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<) |
|
41 |
$(MKDIR) -p $(@D) |
|
42 |
$(CP) $< $@.tmp |
|
43 |
$(CHMOD) u+w $@.tmp |
|
44 |
$(POST_STRIP_CMD) $@.tmp |
|
45 |
$(CHMOD) go-w $@.tmp |
|
46 |
$(MV) $@.tmp $@ |
|
47 |
endef |
|
48 |
else |
|
49 |
define StripRecipe |
|
50 |
$(call install-file) |
|
51 |
endef |
|
52 |
endif |
|
53 |
||
54 |
# Don't include debug info for executables. |
|
28814 | 55 |
ALL_CMDS_SRC := $(filter-out %.bc %.debuginfo %.diz %.map %.pdb, \ |
27560 | 56 |
$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_cmds -type f -o -type l)) |
57 |
COPY_CMDS_SRC := $(filter %.cgi, $(ALL_CMDS_SRC)) |
|
58 |
STRIP_CMDS_SRC := $(filter-out $(COPY_CMDS_SRC), $(ALL_CMDS_SRC)) |
|
59 |
||
60 |
# Make sure symbolic links are copied and not stripped |
|
61 |
COPY_LIBS_SRC := \ |
|
62 |
$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs \ |
|
63 |
\( ! -name '*$(SHARED_LIBRARY_SUFFIX)' -type f \) -o -type l) |
|
30853
0384273d840d
8066757: Can't build 'images' with --disable-zip-debug-info on OS X after jigsaw m2 merge
sla
parents:
30096
diff
changeset
|
64 |
# OS X stores symbol information in a .dylib file inside a .dSYM directory - |
0384273d840d
8066757: Can't build 'images' with --disable-zip-debug-info on OS X after jigsaw m2 merge
sla
parents:
30096
diff
changeset
|
65 |
# that file should not be stripped, so we prune the tree at the .dSYM directory. |
0384273d840d
8066757: Can't build 'images' with --disable-zip-debug-info on OS X after jigsaw m2 merge
sla
parents:
30096
diff
changeset
|
66 |
# Example: support/modules_libs/java.base/libjsig.dylib.dSYM/Contents/Resources/DWARF/libjsig.dylib |
27560 | 67 |
STRIP_LIBS_SRC := \ |
68 |
$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs \ |
|
30853
0384273d840d
8066757: Can't build 'images' with --disable-zip-debug-info on OS X after jigsaw m2 merge
sla
parents:
30096
diff
changeset
|
69 |
-name '*$(SHARED_LIBRARY_SUFFIX)' -type f -print -o -name "*.dSYM" -prune) |
27560 | 70 |
|
71 |
$(eval $(call SetupCopyFiles,STRIP_MODULES_CMDS, \ |
|
72 |
SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds, \ |
|
73 |
DEST := $(MODULES_CMDS_STRIPPED), \ |
|
74 |
FILES := $(STRIP_CMDS_SRC), \ |
|
75 |
MACRO := StripRecipe)) |
|
76 |
||
77 |
$(eval $(call SetupCopyFiles,COPY_MODULES_CMDS, \ |
|
78 |
SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds, \ |
|
79 |
DEST := $(MODULES_CMDS_STRIPPED), \ |
|
80 |
FILES := $(COPY_CMDS_SRC))) |
|
81 |
||
82 |
$(eval $(call SetupCopyFiles,STRIP_MODULES_LIBS, \ |
|
83 |
SRC := $(SUPPORT_OUTPUTDIR)/modules_libs, \ |
|
84 |
DEST := $(MODULES_LIBS_STRIPPED), \ |
|
85 |
FILES := $(STRIP_LIBS_SRC), \ |
|
86 |
MACRO := StripRecipe)) |
|
87 |
||
88 |
$(eval $(call SetupCopyFiles,COPY_MODULES_LIBS, \ |
|
89 |
SRC := $(SUPPORT_OUTPUTDIR)/modules_libs, \ |
|
90 |
DEST := $(MODULES_LIBS_STRIPPED), \ |
|
91 |
FILES := $(COPY_LIBS_SRC))) |
|
92 |
||
93 |
TARGETS += $(STRIP_MODULES_CMDS) $(COPY_MODULES_CMDS) \ |
|
94 |
$(STRIP_MODULES_LIBS) $(COPY_MODULES_LIBS) |
|
95 |
||
96 |
all: $(TARGETS) |