1 #
2 # Copyright (c) 2011, 2015, 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
683 # Only copy debug symbols for dynamic libraries and programs.
684 ifeq ($$($1_STATIC_LIBRARY), )
685 ifneq ($$($1_OUTPUT_DIR), $$($1_OBJECT_DIR))
686 # The dependency on TARGET is needed on windows for debuginfo files
687 # to be rebuilt properly.
688 $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET)
689 $(CP) $$< $$@
690 endif
691
692 # Generate debuginfo files.
693 ifeq ($(OPENJDK_TARGET_OS), windows)
694 $1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \
695 "-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map"
696 $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
697 $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
698 # No separate command is needed for debuginfo on windows, instead
699 # touch target to make sure it has a later time stamp than the debug
700 # symbol files to avoid unnecessary relinking on rebuild.
701 $1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET)
702
703 else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
704 $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
705 # Setup the command line creating debuginfo files, to be run after linking.
706 # It cannot be run separately since it updates the original target file
707 $1_CREATE_DEBUGINFO_CMDS := \
708 $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
709 $(CD) $$($1_OUTPUT_DIR) && \
710 $(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
711
712 else ifeq ($(OPENJDK_TARGET_OS), macosx)
713 $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_BASENAME).dSYM
714 # On Macosx, the debuginfo generation doesn't touch the linked binary, but
715 # to avoid always relinking, touch it anyway to force a later timestamp than
716 # the dSYM files.
717 $1_CREATE_DEBUGINFO_CMDS := \
718 $(DSYMUTIL) --out $$($1_DEBUGINFO_FILES) $$($1_TARGET) $$(NEWLINE) \
719 $(TOUCH) $$($1_TARGET)
720 endif # OPENJDK_TARGET_OS
721
722 # This dependency dance ensures that debug info files get rebuilt
723 # properly if deleted.
|
1 #
2 # Copyright (c) 2011, 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
683 # Only copy debug symbols for dynamic libraries and programs.
684 ifeq ($$($1_STATIC_LIBRARY), )
685 ifneq ($$($1_OUTPUT_DIR), $$($1_OBJECT_DIR))
686 # The dependency on TARGET is needed on windows for debuginfo files
687 # to be rebuilt properly.
688 $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET)
689 $(CP) $$< $$@
690 endif
691
692 # Generate debuginfo files.
693 ifeq ($(OPENJDK_TARGET_OS), windows)
694 $1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \
695 "-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map"
696 $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
697 $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
698 # No separate command is needed for debuginfo on windows, instead
699 # touch target to make sure it has a later time stamp than the debug
700 # symbol files to avoid unnecessary relinking on rebuild.
701 $1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET)
702
703 else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris bsd), )
704 $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
705 # Setup the command line creating debuginfo files, to be run after linking.
706 # It cannot be run separately since it updates the original target file
707 $1_CREATE_DEBUGINFO_CMDS := \
708 $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
709 $(CD) $$($1_OUTPUT_DIR) && \
710 $(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
711
712 else ifeq ($(OPENJDK_TARGET_OS), macosx)
713 $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_BASENAME).dSYM
714 # On Macosx, the debuginfo generation doesn't touch the linked binary, but
715 # to avoid always relinking, touch it anyway to force a later timestamp than
716 # the dSYM files.
717 $1_CREATE_DEBUGINFO_CMDS := \
718 $(DSYMUTIL) --out $$($1_DEBUGINFO_FILES) $$($1_TARGET) $$(NEWLINE) \
719 $(TOUCH) $$($1_TARGET)
720 endif # OPENJDK_TARGET_OS
721
722 # This dependency dance ensures that debug info files get rebuilt
723 # properly if deleted.
|