Makefile (24da5b34) Makefile (7b07063d)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 8 unchanged lines hidden (view full) ---

17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24# Use is subject to license terms.
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 8 unchanged lines hidden (view full) ---

17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24# Use is subject to license terms.
25# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
25#
26#
26# ident "%Z%%M% %I% %E% SMI"
27#
28
29include $(SRC)/Makefile.master
30
31FILES= \
32 $(MACH)_cc_map.noexeglobs \
33 $(MACH)_gcc_map.noexeglobs
34
35$(BUILD64)FILES += \

--- 57 unchanged lines hidden (view full) ---

93# expected visibility requirements. By inspecting the deferences between the
94# global symbols within the two executables, a mapfile can be generated to
95# ensure the symbols defined by the compilation environments files remain
96# global.
97
98%map.noexeglobs:main.c $(TEMPLATE1) $(TEMPLATE2)
99 $(LINK) -o $(MAIN1) -M$(TEMPLATE1) main.c
100 $(ELFDUMP) -s -N.dynsym $(MAIN1) | $(EGREP) "WEAK|GLOB" | \
27
28include $(SRC)/Makefile.master
29
30FILES= \
31 $(MACH)_cc_map.noexeglobs \
32 $(MACH)_gcc_map.noexeglobs
33
34$(BUILD64)FILES += \

--- 57 unchanged lines hidden (view full) ---

92# expected visibility requirements. By inspecting the deferences between the
93# global symbols within the two executables, a mapfile can be generated to
94# ensure the symbols defined by the compilation environments files remain
95# global.
96
97%map.noexeglobs:main.c $(TEMPLATE1) $(TEMPLATE2)
98 $(LINK) -o $(MAIN1) -M$(TEMPLATE1) main.c
99 $(ELFDUMP) -s -N.dynsym $(MAIN1) | $(EGREP) "WEAK|GLOB" | \
101 $(GREP) -v UNDEF | $(NAWK) '{print $$9 }' | $(SORT) > $(SYMS1)
100 $(GREP) -v UNDEF | $(AWK) '{print $$9 }' | $(SORT) > $(SYMS1)
102 $(LINK) -o $(MAIN2) -M$(TEMPLATE2) main.c
103 $(ELFDUMP) -s -N.dynsym $(MAIN2) | $(EGREP) "WEAK|GLOB" | \
101 $(LINK) -o $(MAIN2) -M$(TEMPLATE2) main.c
102 $(ELFDUMP) -s -N.dynsym $(MAIN2) | $(EGREP) "WEAK|GLOB" | \
104 $(GREP) -v UNDEF | $(NAWK) '{print $$9 }' | $(SORT) > $(SYMS2)
103 $(GREP) -v UNDEF | $(AWK) '{print $$9 }' | $(SORT) > $(SYMS2)
105 $(ECHO) "# GENERATED FILE - DO NOT EDIT" > $@
106 $(GREP) MAP-HEAD $(TEMPLATE2) | \
107 $(SED) -e "s/ *# MAP-HEAD//" >> $@
108 $(DIFF) $(SYMS1) $(SYMS2) | $(GREP) "^<" | \
109 $(SED) -e "s/^< \(.*\)/ \1;/" >> $@
110 $(GREP) MAP-TAIL $(TEMPLATE2) | \
111 $(SED) -e "s/ *# MAP-TAIL//" >> $@
112 $(RM) $(SYMS1) $(SYMS2) $(MAIN1) $(MAIN2)
104 $(ECHO) "# GENERATED FILE - DO NOT EDIT" > $@
105 $(GREP) MAP-HEAD $(TEMPLATE2) | \
106 $(SED) -e "s/ *# MAP-HEAD//" >> $@
107 $(DIFF) $(SYMS1) $(SYMS2) | $(GREP) "^<" | \
108 $(SED) -e "s/^< \(.*\)/ \1;/" >> $@
109 $(GREP) MAP-TAIL $(TEMPLATE2) | \
110 $(SED) -e "s/ *# MAP-TAIL//" >> $@
111 $(RM) $(SYMS1) $(SYMS2) $(MAIN1) $(MAIN2)