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
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21 # Copyright 2015 Gary Mills
22 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 #
25 #
26 # Definitions common to libraries.
27 #
28 # include global definitions; SRC should be defined in the shell.
29 # SRC is needed until RFE 1026993 is implemented.
30
31 include $(SRC)/Makefile.master
32
33 LORDER= lorder
34 TSORT= tsort
35
36 #
37 # By default, we define the source directory for libraries to be
38 # one level up from the ISA-specific directory, where the code is
39 # actually built. Many libraries define a 'common' directory to
40 # contain the source. These libraries must redefine SRCDIR as:
41 # SRCDIR = ../common
42 # Other variations are possible (../port, ../src, etc).
43 #
118 # Demo rules
119 DEMOFILES=
120 DEMOFILESRCDIR= common
121 ROOTDEMODIRBASE= __nonexistent_directory__
122 ROOTDEMODIRS=
123 ROOTDEMOFILES= $(DEMOFILES:%=$(ROOTDEMODIRBASE)/%)
124 $(ROOTDEMODIRS) := DIRMODE = 755
125
126 LINTLIB= llib-l$(LIBNAME).ln
127 LINTFLAGS= -uaxm
128 LINTFLAGS64= -uaxm -m64
129 LINTSRC= $(LINTLIB:%.ln=%)
130 LINTOUT= lint.out
131 ARFLAGS= r
132 SONAME= $(DYNLIB)
133 # For most libraries, we should be able to resolve all symbols at link time,
134 # either within the library or as dependencies, all text should be pure, and
135 # combining relocations into one relocation table reduces startup costs.
136 # All options are tunable to allow overload/omission from lower makefiles.
137
138
139 HSONAME= -h$(SONAME)
140 DYNFLAGS= $(HSONAME) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
141 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
142
143 LDLIBS= $(LDLIBS.lib)
144
145 OBJS= $(OBJECTS:%=objs/%)
146 PICS= $(OBJECTS:%=pics/%)
147
148 # Declare that all library .o's can all be made in parallel.
149 # The DUMMY target is for those instances where OBJS and PICS
150 # are empty (to avoid an unconditional .PARALLEL declaration).
151 .PARALLEL: $(OBJS) $(PICS) DUMMY
152
153 # default value for "portable" source
154 SRCS= $(OBJECTS:%.o=$(SRCDIR)/%.c)
155
156 # default build of an archive and a shared object,
157 # overridden locally when extra processing is needed
158 BUILD.AR= $(AR) $(ARFLAGS) $@ $(AROBJS)
159 BUILD.SO= $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
160 $(PICS) $(EXTPICS) $(LDLIBS)
161 BUILDCCC.SO= $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
162 $(PICS) $(EXTPICS) $(LDLIBS)
163
164 # default dynamic library symlink
165 INS.liblink= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
166 INS.liblinkccc= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
167
168 # default 64-bit dynamic library symlink
169 INS.liblink64= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
170 INS.liblinkccc64= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
171
172 #
173 # If appropriate, augment POST_PROCESS_O and POST_PROCESS_SO to do CTF
174 # processing. We'd like to just conditionally append to POST_PROCESS_O and
175 # POST_PROCESS_SO, but ParallelMake has a bug which causes the same value to
176 # sometimes get appended more than once, which will cause ctfconvert to fail.
177 # So, instead we introduce CTFCONVERT_POST and CTFMERGE_POST, which are always
178 # appended to POST_PROCESS_O and POST_PROCESS_SO but are no-ops unless CTF
179 # processing should be done.
180 #
|
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
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21 # Copyright 2015 Gary Mills
22 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright (c) 2014, Joyent, Inc.
25 #
26 #
27 # Definitions common to libraries.
28 #
29 # include global definitions; SRC should be defined in the shell.
30 # SRC is needed until RFE 1026993 is implemented.
31
32 include $(SRC)/Makefile.master
33
34 LORDER= lorder
35 TSORT= tsort
36
37 #
38 # By default, we define the source directory for libraries to be
39 # one level up from the ISA-specific directory, where the code is
40 # actually built. Many libraries define a 'common' directory to
41 # contain the source. These libraries must redefine SRCDIR as:
42 # SRCDIR = ../common
43 # Other variations are possible (../port, ../src, etc).
44 #
119 # Demo rules
120 DEMOFILES=
121 DEMOFILESRCDIR= common
122 ROOTDEMODIRBASE= __nonexistent_directory__
123 ROOTDEMODIRS=
124 ROOTDEMOFILES= $(DEMOFILES:%=$(ROOTDEMODIRBASE)/%)
125 $(ROOTDEMODIRS) := DIRMODE = 755
126
127 LINTLIB= llib-l$(LIBNAME).ln
128 LINTFLAGS= -uaxm
129 LINTFLAGS64= -uaxm -m64
130 LINTSRC= $(LINTLIB:%.ln=%)
131 LINTOUT= lint.out
132 ARFLAGS= r
133 SONAME= $(DYNLIB)
134 # For most libraries, we should be able to resolve all symbols at link time,
135 # either within the library or as dependencies, all text should be pure, and
136 # combining relocations into one relocation table reduces startup costs.
137 # All options are tunable to allow overload/omission from lower makefiles.
138
139 #
140 # DTrace related rules
141 #
142 # These allow for multiple USDT providers to be specified by a library.
143 # If a library needs to break up the set of objects that are passed to
144 # the dtrace -G invocation, then they can place the following in heir
145 # Makefile.com:
146 #
147 # pics/<provider>.o := USDT_G_PICS = <files>
148 #
149 # <provider> should be replaced with the basename of one of the USDT
150 # providers specified in USDT_PROVIDERS in their Makefile.com.
151 #
152 USDT_HEADERS= $(USDT_PROVIDERS:%.d=%_impl.h)
153 USDT_PICS= $(USDT_PROVIDERS:%.d=pics/%.o)
154 USDT_G_PICS= $(PICS)
155
156
157 HSONAME= -h$(SONAME)
158 DYNFLAGS= $(HSONAME) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
159 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
160
161 LDLIBS= $(LDLIBS.lib)
162
163 OBJS= $(OBJECTS:%=objs/%)
164 PICS= $(OBJECTS:%=pics/%)
165
166 # Declare that all library .o's can all be made in parallel.
167 # The DUMMY target is for those instances where OBJS and PICS
168 # are empty (to avoid an unconditional .PARALLEL declaration).
169 .PARALLEL: $(OBJS) $(PICS) DUMMY
170
171 # default value for "portable" source
172 SRCS= $(OBJECTS:%.o=$(SRCDIR)/%.c)
173
174 # default build of an archive and a shared object,
175 # overridden locally when extra processing is needed
176 BUILD.AR= $(AR) $(ARFLAGS) $@ $(AROBJS)
177 BUILD.SO= $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
178 $(PICS) $(EXTPICS) $(USDT_PICS) $(LDLIBS)
179 BUILDCCC.SO= $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
180 $(PICS) $(EXTPICS) $(LDLIBS)
181
182 # default dynamic library symlink
183 INS.liblink= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
184 INS.liblinkccc= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
185
186 # default 64-bit dynamic library symlink
187 INS.liblink64= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
188 INS.liblinkccc64= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
189
190 #
191 # If appropriate, augment POST_PROCESS_O and POST_PROCESS_SO to do CTF
192 # processing. We'd like to just conditionally append to POST_PROCESS_O and
193 # POST_PROCESS_SO, but ParallelMake has a bug which causes the same value to
194 # sometimes get appended more than once, which will cause ctfconvert to fail.
195 # So, instead we introduce CTFCONVERT_POST and CTFMERGE_POST, which are always
196 # appended to POST_PROCESS_O and POST_PROCESS_SO but are no-ops unless CTF
197 # processing should be done.
198 #
|