Merge illumos-gate
[unleashed.git] / usr / src / lib / libsaveargs / Makefile.com
blobc2bb73d689d4b6b5f7aba3bb7a624b7eb1693a10
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
22 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23 # Use is subject to license terms.
25 # Copyright (c) 2018, Joyent, Inc.
28 # The build process for libsaveargs is sightly different from that used by other
29 # libraries, because libsaveargs must be built in two flavors - as a standalone
30 # for use by kmdb and as a normal library.  We use $(CURTYPE) to indicate the
31 # current flavor being built.
34 LIBRARY=        libsaveargs.a
35 STANDLIBRARY=   libstandsaveargs.so
36 VERS=           .1
38 # By default, we build the shared library.  Construction of the standalone
39 # is specifically requested by architecture-specific Makefiles.
40 TYPES=          library
41 CURTYPE=        library
43 COMDIR=         $(SRC)/lib/libsaveargs/common
45 OBJECTS_common_amd64    = saveargs.o
46 SRCS_common_amd64       = $(OBJECTS_common_amd64:%.o=../amd64/%.c)
48 OBJECTS= $(OBJECTS_common_$(MACH)) $(OBJECTS_common_$(MACH64)) $(OBJECTS_common_common)
50 include $(SRC)/lib/Makefile.lib
52 SRCS=   $(SRCS_common_$(MACH)) $(SRCS_common_$(MACH64)) $(SRC_common_common)
55 # Used to verify that the standalone doesn't have any unexpected external
56 # dependencies.
58 LINKTEST_OBJ = objs/linktest_stand.o
60 CLOBBERFILES_standalone = $(LINKTEST_OBJ)
61 CLOBBERFILES += $(CLOBBERFILES_$(CURTYPE))
63 LIBS_standalone = $(STANDLIBRARY)
64 LIBS_library = $(DYNLIB)
65 LIBS = $(LIBS_$(CURTYPE))
67 MAPFILES =      $(COMDIR)/mapfile-vers
69 LDLIBS +=       -lc -ldisasm
71 LDFLAGS_standalone = $(ZNOVERSION) $(BREDUCE) -dy -r
72 LDFLAGS = $(LDFLAGS_$(CURTYPE))
74 ASFLAGS_standalone = -DDIS_STANDALONE
75 ASFLAGS_library =
76 ASFLAGS += $(ASFLAGS_$(CURTYPE)) -D_ASM
78 CPPFLAGS_standalone = -DDIS_STANDALONE
79 CPPFLAGS_library =
80 CPPFLAGS +=     -I$(COMDIR) $(CPPFLAGS_$(CURTYPE))
82 CFLAGS_standalone = $(STAND_FLAGS_32)
83 CFLAGS_common =
84 CFLAGS += $(CFLAGS_$(CURTYPE)) $(CFLAGS_common)
86 CFLAGS64_standalone = $(STAND_FLAGS_64)
87 CFLAGS64 += $(CFLAGS64_$(CURTYPE)) $(CFLAGS64_common)
89 # not linted
90 SMATCH=off
92 DYNFLAGS +=     $(ZINTERPOSE)
94 .KEEP_STATE: