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
40
41 ifneq ($(STRIP), )
42 define StripRecipe
43 $(call LogInfo, Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<))
44 $(call MakeDir, $(@D))
45 $(CP) $< $@.tmp
46 $(CHMOD) u+w $@.tmp
47 $(STRIP) $(STRIPFLAGS) $@.tmp
48 $(CHMOD) go-w $@.tmp
49 $(MV) $@.tmp $@
50 endef
51 else
52 define StripRecipe
53 $(call install-file)
54 endef
55 endif
56
57 NO_STRIP_CMDS_FILTER += %.cgi
58
59 # Don't include debug info for executables.
60 ALL_CMDS_SRC := $(filter-out %.bc %.debuginfo %.diz %.map %.pdb, \
61 $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_cmds -type f -o -type l))
62 COPY_CMDS_SRC := $(filter $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC))
63 STRIP_CMDS_SRC := $(filter-out $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC))
64
65 # OS X stores symbol information in a .dylib file inside a .dSYM directory -
66 # that file should not be stripped, so we prune the tree at the .dSYM directory.
67 # Example: support/modules_libs/java.base/libjsig.dylib.dSYM/Contents/Resources/DWARF/libjsig.dylib
68 STRIP_LIBS_SRC := \
69 $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs \
70 -name '*$(SHARED_LIBRARY_SUFFIX)' -type f -print -o -name "*.dSYM" -prune)
71 # Make sure symbolic links are copied and not stripped.
72 COPY_LIBS_SRC := \
73 $(filter-out $(STRIP_LIBS_SRC), \
74 $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs -type f -o -type l))
75
76 $(eval $(call SetupCopyFiles,STRIP_MODULES_CMDS, \
77 SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds, \
78 DEST := $(MODULES_CMDS_STRIPPED), \
79 FILES := $(STRIP_CMDS_SRC), \
80 MACRO := StripRecipe))
81
|
1 #
2 # Copyright (c) 2014, 2016, 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
40
41 ifneq ($(STRIP), )
42 define StripRecipe
43 $(call LogInfo, Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<))
44 $(call MakeDir, $(@D))
45 $(CP) $< $@.tmp
46 $(CHMOD) u+w $@.tmp
47 $(STRIP) $(STRIPFLAGS) $@.tmp
48 $(CHMOD) go-w $@.tmp
49 $(MV) $@.tmp $@
50 endef
51 else
52 define StripRecipe
53 $(call install-file)
54 endef
55 endif
56
57 NO_STRIP_CMDS_FILTER += %.cgi
58
59 # Don't include debug info for executables.
60
61 # OS X stores symbol information in a .dylib file inside a .dSYM directory -
62 # that file should not be stripped, so we prune the tree at the .dSYM directory.
63 ALL_CMDS_SRC := $(filter-out %.bc %.debuginfo %.diz %.map %.pdb, \
64 $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_cmds \( -type f -o -type l \) \
65 -print -o -name "*.dSYM" -prune))
66 COPY_CMDS_SRC := $(filter $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC))
67 STRIP_CMDS_SRC := $(filter-out $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC))
68
69 # OS X stores symbol information in a .dylib file inside a .dSYM directory -
70 # that file should not be stripped, so we prune the tree at the .dSYM directory.
71 # Example: support/modules_libs/java.base/libjsig.dylib.dSYM/Contents/Resources/DWARF/libjsig.dylib
72 STRIP_LIBS_SRC := \
73 $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs \
74 -name '*$(SHARED_LIBRARY_SUFFIX)' -type f -print -o -name "*.dSYM" -prune)
75 # Make sure symbolic links are copied and not stripped.
76 COPY_LIBS_SRC := \
77 $(filter-out $(STRIP_LIBS_SRC), \
78 $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs -type f -o -type l))
79
80 $(eval $(call SetupCopyFiles,STRIP_MODULES_CMDS, \
81 SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds, \
82 DEST := $(MODULES_CMDS_STRIPPED), \
83 FILES := $(STRIP_CMDS_SRC), \
84 MACRO := StripRecipe))
85
|