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) 2019, 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
95
96 include ../../Makefile.lib
97 include ../../Makefile.rootfs
98
99 SRCS = \
100 $(SRCS_$(CURTYPE)) \
101 $(SRCS_common_common)
102
103 SRCDIR = ../common
104
105 #
106 # Used to verify that the standalone doesn't have any unexpected external
107 # dependencies.
108 #
109 LINKTEST_OBJ = objs/linktest_stand.o
110
111 CLOBBERFILES_standalone = $(LINKTEST_OBJ)
112 CLOBBERFILES += $(CLOBBERFILES_$(CURTYPE))
113
114 LIBS_standalone = $(STANDLIBRARY)
115 LIBS_library = $(DYNLIB) $(LINTLIB)
116 LIBS = $(LIBS_$(CURTYPE))
117
118 MAPFILE_SUPPLEMENTAL_standalone = ../common/stand_mapfile
119 MAPFILE_SUPPLEMENTAL = $(MAPFILE_SUPPLEMENTAL_$(CURTYPE))
120
121 LDLIBS += -lc
122
123 LDFLAGS_standalone = $(ZNOVERSION) $(BREDUCE) -M../common/mapfile-vers \
124 -M$(MAPFILE_SUPPLEMENTAL) -dy -r
125 LDFLAGS = $(LDFLAGS_$(CURTYPE))
126
127 ASFLAGS_standalone = -DUMEM_STANDALONE
128 ASFLAGS_library =
129 ASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM
130
131 $(LINTLIB) := SRCS = ../common/$(LINTSRC)
132
133 # We want the thread-specific errno in the library, but we don't want it in
134 # the standalone. $(DTS_ERRNO) is designed to add -D_TS_ERRNO to $(CPPFLAGS),
135 # in order to enable this feature. Conveniently, -D_REENTRANT does the same
136 # thing. As such, we null out $(DTS_ERRNO) to ensure that the standalone
137 # doesn't get it.
138 DTS_ERRNO=
139
140 # We need to rename some standard functions so we can easily implement them
141 # in consumers.
142 STAND_RENAMED_FUNCS= \
143 atomic_add_64 \
144 atomic_add_32_nv \
145 atomic_swap_64 \
146 snprintf \
147 vsnprintf
148
149 CPPFLAGS_standalone = -DUMEM_STANDALONE $(STAND_RENAMED_FUNCS:%=-D%=umem_%)
150 CPPFLAGS_library = -D_REENTRANT
151 CPPFLAGS += -I../common -I../../common/inc $(CPPFLAGS_$(CURTYPE))
152
153 CFLAGS_standalone = $(STAND_FLAGS_32)
154 CFLAGS_common =
155 CFLAGS += $(CFLAGS_$(CURTYPE)) $(CFLAGS_common)
156
157 CFLAGS64_standalone = $(STAND_FLAGS_64)
158 CFLAGS64 += $(CCVERBOSE) $(CFLAGS64_$(CURTYPE)) $(CFLAGS64_common)
159
160 INSTALL_DEPS_library = $(ROOTLINKS) $(ROOTLINT) $(ROOTLIBS)
161
162 #
163 # turn off ptr-cast warnings, since we do them all the time
164 #
165 LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN
166 LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN
167
168 DYNFLAGS += $(ZINTERPOSE)
169
170 .KEEP_STATE:
|
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 2019 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
95
96 include ../../Makefile.lib
97 include ../../Makefile.rootfs
98
99 SRCS = \
100 $(SRCS_$(CURTYPE)) \
101 $(SRCS_common_common)
102
103 SRCDIR = ../common
104
105 #
106 # Used to verify that the standalone doesn't have any unexpected external
107 # dependencies.
108 #
109 LINKTEST_OBJ = objs/linktest_stand.o
110
111 CLOBBERFILES_standalone = $(LINKTEST_OBJ)
112 CLOBBERFILES += $(CLOBBERFILES_$(CURTYPE))
113
114 LIBS_standalone = $(STANDLIBRARY)
115 LIBS_library = $(DYNLIB)
116 LIBS = $(LIBS_$(CURTYPE))
117
118 MAPFILE_SUPPLEMENTAL_standalone = ../common/stand_mapfile
119 MAPFILE_SUPPLEMENTAL = $(MAPFILE_SUPPLEMENTAL_$(CURTYPE))
120
121 LDLIBS += -lc
122
123 LDFLAGS_standalone = $(ZNOVERSION) $(BREDUCE) -M../common/mapfile-vers \
124 -M$(MAPFILE_SUPPLEMENTAL) -dy -r
125 LDFLAGS = $(LDFLAGS_$(CURTYPE))
126
127 ASFLAGS_standalone = -DUMEM_STANDALONE
128 ASFLAGS_library =
129 ASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM
130
131 # We want the thread-specific errno in the library, but we don't want it in
132 # the standalone. $(DTS_ERRNO) is designed to add -D_TS_ERRNO to $(CPPFLAGS),
133 # in order to enable this feature. Conveniently, -D_REENTRANT does the same
134 # thing. As such, we null out $(DTS_ERRNO) to ensure that the standalone
135 # doesn't get it.
136 DTS_ERRNO=
137
138 # We need to rename some standard functions so we can easily implement them
139 # in consumers.
140 STAND_RENAMED_FUNCS= \
141 atomic_add_64 \
142 atomic_add_32_nv \
143 atomic_swap_64 \
144 snprintf \
145 vsnprintf
146
147 CPPFLAGS_standalone = -DUMEM_STANDALONE $(STAND_RENAMED_FUNCS:%=-D%=umem_%)
148 CPPFLAGS_library = -D_REENTRANT
149 CPPFLAGS += -I../common -I../../common/inc $(CPPFLAGS_$(CURTYPE))
150
151 CFLAGS_standalone = $(STAND_FLAGS_32)
152 CFLAGS_common =
153 CFLAGS += $(CFLAGS_$(CURTYPE)) $(CFLAGS_common)
154
155 CFLAGS64_standalone = $(STAND_FLAGS_64)
156 CFLAGS64 += $(CCVERBOSE) $(CFLAGS64_$(CURTYPE)) $(CFLAGS64_common)
157
158 # false positive for umem_alloc_sizes_add()
159 pics/umem.o := SMOFF += index_overflow
160 objs/umem.o := SMOFF += index_overflow
161
162 INSTALL_DEPS_library = $(ROOTLINKS) $(ROOTLIBS)
163
164 DYNFLAGS += $(ZINTERPOSE)
165
166 .KEEP_STATE:
|