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 2007 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
27 # The build process for libsaveargs is sightly different from that used by other
28 # libraries, because libsaveargs must be built in two flavors - as a standalone
29 # for use by kmdb and as a normal library. We use $(CURTYPE) to indicate the
30 # current flavor being built.
33 LIBRARY= libsaveargs.a
34 STANDLIBRARY= libstandsaveargs.so
37 # By default, we build the shared library. Construction of the standalone
38 # is specifically requested by architecture-specific Makefiles.
42 COMDIR= $(SRC)/lib/libsaveargs/common
44 OBJECTS_common_amd64 = saveargs.o
45 SRCS_common_amd64 = $(OBJECTS_common_amd64:%.o=../amd64/%.c)
47 OBJECTS= $(OBJECTS_common_$(MACH)) $(OBJECTS_common_$(MACH64)) $(OBJECTS_common_common)
49 include $(SRC)/lib/Makefile.lib
51 SRCS= $(SRCS_common_$(MACH)) $(SRCS_common_$(MACH64)) $(SRC_common_common)
54 # Used to verify that the standalone doesn't have any unexpected external
57 LINKTEST_OBJ = objs/linktest_stand.o
59 CLOBBERFILES_standalone = $(LINKTEST_OBJ)
60 CLOBBERFILES += $(CLOBBERFILES_$(CURTYPE))
62 LIBS_standalone = $(STANDLIBRARY)
63 LIBS_library = $(DYNLIB)
64 LIBS = $(LIBS_$(CURTYPE))
66 MAPFILES = $(COMDIR)/mapfile-vers
68 LDLIBS += -lc -ldisasm
70 LDFLAGS_standalone = $(ZNOVERSION) $(BREDUCE) -dy -r
71 LDFLAGS = $(LDFLAGS_$(CURTYPE))
73 ASFLAGS_standalone = -DDIS_STANDALONE
75 ASFLAGS += $(ASFLAGS_$(CURTYPE)) -D_ASM
77 CPPFLAGS_standalone = -DDIS_STANDALONE
79 CPPFLAGS += -I$(COMDIR) $(CPPFLAGS_$(CURTYPE))
81 CFLAGS_standalone = $(STAND_FLAGS_32)
83 CFLAGS += $(CFLAGS_$(CURTYPE)) $(CFLAGS_common)
85 CFLAGS64_standalone = $(STAND_FLAGS_64)
86 CFLAGS64 += $(CFLAGS64_$(CURTYPE)) $(CFLAGS64_common)
88 DYNFLAGS += $(ZINTERPOSE)