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 #
22 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25 # Copyright (c) 2012, Joyent, Inc. All rights reserved.
26 #
27
28 #
29 # The build process for libumem is sightly different from that used by other
30 # libraries, because libumem must be built in two flavors - as a standalone
31 # for use by kmdb and as a normal library. We use $(CURTYPE) to indicate the
32 # current flavor being built.
33 #
34
35 LIBRARY = libumem.a
36 STANDLIBRARY = libstandumem.so
37 VERS = .1
38
39 # By default, we build the shared library. Construction of the standalone
40 # is specifically requested by architecture-specific Makefiles.
41 TYPES = library
42 CURTYPE = library
43
44 # This would be much prettier if a) Makefile.lib didn't reqire both $(SRCS) and
45 # $(OBJECTS) to be set or b) make gave us a nice way to do basename in pattern
113 LIBS_standalone = $(STANDLIBRARY)
114 LIBS_library = $(DYNLIB) $(LINTLIB)
115 LIBS = $(LIBS_$(CURTYPE))
116
117 MAPFILE_SUPPLEMENTAL_standalone = ../common/stand_mapfile
118 MAPFILE_SUPPLEMENTAL = $(MAPFILE_SUPPLEMENTAL_$(CURTYPE))
119
120 LDLIBS += -lc
121
122 LDFLAGS_standalone = $(ZNOVERSION) $(BREDUCE) -M../common/mapfile-vers \
123 -M$(MAPFILE_SUPPLEMENTAL) -dy -r
124 LDFLAGS = $(LDFLAGS_$(CURTYPE))
125
126 ASFLAGS_standalone = -DUMEM_STANDALONE
127 ASFLAGS_library =
128 ASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM
129
130 CERRWARN += -_gcc=-Wno-switch
131 CERRWARN += -_gcc=-Wno-uninitialized
132
133 $(LINTLIB) := SRCS = ../common/$(LINTSRC)
134
135 # We want the thread-specific errno in the library, but we don't want it in
136 # the standalone. $(DTS_ERRNO) is designed to add -D_TS_ERRNO to $(CPPFLAGS),
137 # in order to enable this feature. Conveniently, -D_REENTRANT does the same
138 # thing. As such, we null out $(DTS_ERRNO) to ensure that the standalone
139 # doesn't get it.
140 DTS_ERRNO=
141
142 # We need to rename some standard functions so we can easily implement them
143 # in consumers.
144 STAND_RENAMED_FUNCS= \
145 atomic_add_64 \
146 atomic_add_32_nv \
147 atomic_swap_64 \
148 snprintf \
149 vsnprintf
150
151 CPPFLAGS_standalone = -DUMEM_STANDALONE $(STAND_RENAMED_FUNCS:%=-D%=umem_%)
152 CPPFLAGS_library = -D_REENTRANT
|
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 #
22 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25 # Copyright (c) 2018, Joyent, Inc.
26 #
27
28 #
29 # The build process for libumem is sightly different from that used by other
30 # libraries, because libumem must be built in two flavors - as a standalone
31 # for use by kmdb and as a normal library. We use $(CURTYPE) to indicate the
32 # current flavor being built.
33 #
34
35 LIBRARY = libumem.a
36 STANDLIBRARY = libstandumem.so
37 VERS = .1
38
39 # By default, we build the shared library. Construction of the standalone
40 # is specifically requested by architecture-specific Makefiles.
41 TYPES = library
42 CURTYPE = library
43
44 # This would be much prettier if a) Makefile.lib didn't reqire both $(SRCS) and
45 # $(OBJECTS) to be set or b) make gave us a nice way to do basename in pattern
113 LIBS_standalone = $(STANDLIBRARY)
114 LIBS_library = $(DYNLIB) $(LINTLIB)
115 LIBS = $(LIBS_$(CURTYPE))
116
117 MAPFILE_SUPPLEMENTAL_standalone = ../common/stand_mapfile
118 MAPFILE_SUPPLEMENTAL = $(MAPFILE_SUPPLEMENTAL_$(CURTYPE))
119
120 LDLIBS += -lc
121
122 LDFLAGS_standalone = $(ZNOVERSION) $(BREDUCE) -M../common/mapfile-vers \
123 -M$(MAPFILE_SUPPLEMENTAL) -dy -r
124 LDFLAGS = $(LDFLAGS_$(CURTYPE))
125
126 ASFLAGS_standalone = -DUMEM_STANDALONE
127 ASFLAGS_library =
128 ASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM
129
130 CERRWARN += -_gcc=-Wno-switch
131 CERRWARN += -_gcc=-Wno-uninitialized
132
133 SMOFF += deref_check
134
135 $(LINTLIB) := SRCS = ../common/$(LINTSRC)
136
137 # We want the thread-specific errno in the library, but we don't want it in
138 # the standalone. $(DTS_ERRNO) is designed to add -D_TS_ERRNO to $(CPPFLAGS),
139 # in order to enable this feature. Conveniently, -D_REENTRANT does the same
140 # thing. As such, we null out $(DTS_ERRNO) to ensure that the standalone
141 # doesn't get it.
142 DTS_ERRNO=
143
144 # We need to rename some standard functions so we can easily implement them
145 # in consumers.
146 STAND_RENAMED_FUNCS= \
147 atomic_add_64 \
148 atomic_add_32_nv \
149 atomic_swap_64 \
150 snprintf \
151 vsnprintf
152
153 CPPFLAGS_standalone = -DUMEM_STANDALONE $(STAND_RENAMED_FUNCS:%=-D%=umem_%)
154 CPPFLAGS_library = -D_REENTRANT
|