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.
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.
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]
22 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # Copyright (c) 2012, Joyent, Inc. All rights reserved.
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.
36 STANDLIBRARY = libstandumem.so
39 # By default, we build the shared library. Construction of the standalone
40 # is specifically requested by architecture-specific Makefiles.
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
46 # replacement definitions.
48 # Files specific to the library version of libumem
51 umem_agent_support.o \
54 umem_update_thread.o \
58 SRCS_library = $(OBJECTS_library:%.o=../common/%.c)
60 # Files specific to the standalone version of libumem
61 OBJECTS_standalone = \
66 SRCS_standalone = $(OBJECTS_standalone:%.o=../common/%.c)
68 # Architecture-dependent files common to both versions of libumem
69 OBJECTS_common_isadep = \
73 SRCS_common_isadep = \
74 $(ISASRCDIR)/asm_subr.s \
75 $(ISASRCDIR)/umem_genasm.c
77 # Architecture-independent files common to both versions of libumem
78 OBJECTS_common_common = \
87 SRCS_common_common = $(OBJECTS_common_common:%.o=../common/%.c)
90 $(OBJECTS_$(CURTYPE)) \
91 $(OBJECTS_common_isadep) \
92 $(OBJECTS_common_common)
94 include ../../Makefile.lib
95 include ../../Makefile.rootfs
99 $(SRCS_common_isadep) \
100 $(SRCS_common_common)
105 # Used to verify that the standalone doesn't have any unexpected external
108 LINKTEST_OBJ = objs/linktest_stand.o
110 CLOBBERFILES_standalone = $(LINKTEST_OBJ)
111 CLOBBERFILES += $(CLOBBERFILES_$(CURTYPE))
113 LIBS_standalone = $(STANDLIBRARY)
114 LIBS_library = $(DYNLIB)
115 LIBS = $(LIBS_$(CURTYPE))
117 MAPFILE_SUPPLEMENTAL_standalone = ../common/stand_mapfile
118 MAPFILE_SUPPLEMENTAL = $(MAPFILE_SUPPLEMENTAL_$(CURTYPE))
122 LDFLAGS_standalone = $(ZNOVERSION) $(BREDUCE) -M../common/mapfile-vers \
123 -M$(MAPFILE_SUPPLEMENTAL) -dy -r
124 LDFLAGS = $(LDFLAGS_$(CURTYPE))
126 ASFLAGS_standalone = -DUMEM_STANDALONE
128 ASFLAGS += $(ASFLAGS_$(CURTYPE)) -D_ASM
130 CERRWARN += -Wno-switch
131 CERRWARN += -Wno-uninitialized
133 # We need to rename some standard functions so we can easily implement them
135 STAND_RENAMED_FUNCS= \
142 CPPFLAGS_standalone = -DUMEM_STANDALONE $(STAND_RENAMED_FUNCS:%=-D%=umem_%)
144 CPPFLAGS += -I../common -I../../common/inc $(CPPFLAGS_$(CURTYPE))
146 CFLAGS_standalone = $(STAND_FLAGS_32)
148 CFLAGS += $(CFLAGS_$(CURTYPE)) $(CFLAGS_common)
150 CFLAGS64_standalone = $(STAND_FLAGS_64)
151 CFLAGS64 += $(CFLAGS64_$(CURTYPE)) $(CFLAGS64_common)
153 INSTALL_DEPS_library = $(ROOTLINKS) $(ROOTLIBS)
155 DYNFLAGS += $(ZINTERPOSE)