xref: /illumos-gate/usr/src/lib/libsaveargs/Makefile.com (revision 702941cd97e30d600c2c1275823bc58231b2c361)
1*702941cdSRichard Lowe#
2*702941cdSRichard Lowe# CDDL HEADER START
3*702941cdSRichard Lowe#
4*702941cdSRichard Lowe# The contents of this file are subject to the terms of the
5*702941cdSRichard Lowe# Common Development and Distribution License (the "License").
6*702941cdSRichard Lowe# You may not use this file except in compliance with the License.
7*702941cdSRichard Lowe#
8*702941cdSRichard Lowe# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*702941cdSRichard Lowe# or http://www.opensolaris.org/os/licensing.
10*702941cdSRichard Lowe# See the License for the specific language governing permissions
11*702941cdSRichard Lowe# and limitations under the License.
12*702941cdSRichard Lowe#
13*702941cdSRichard Lowe# When distributing Covered Code, include this CDDL HEADER in each
14*702941cdSRichard Lowe# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*702941cdSRichard Lowe# If applicable, add the following below this CDDL HEADER, with the
16*702941cdSRichard Lowe# fields enclosed by brackets "[]" replaced with your own identifying
17*702941cdSRichard Lowe# information: Portions Copyright [yyyy] [name of copyright owner]
18*702941cdSRichard Lowe#
19*702941cdSRichard Lowe# CDDL HEADER END
20*702941cdSRichard Lowe#
21*702941cdSRichard Lowe#
22*702941cdSRichard Lowe# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23*702941cdSRichard Lowe# Use is subject to license terms.
24*702941cdSRichard Lowe#
25*702941cdSRichard Lowe
26*702941cdSRichard Lowe#
27*702941cdSRichard Lowe# The build process for libsaveargs is sightly different from that used by other
28*702941cdSRichard Lowe# libraries, because libsaveargs must be built in two flavors - as a standalone
29*702941cdSRichard Lowe# for use by kmdb and as a normal library.  We use $(CURTYPE) to indicate the
30*702941cdSRichard Lowe# current flavor being built.
31*702941cdSRichard Lowe#
32*702941cdSRichard Lowe
33*702941cdSRichard LoweLIBRARY=	libsaveargs.a
34*702941cdSRichard LoweSTANDLIBRARY=	libstandsaveargs.so
35*702941cdSRichard LoweVERS=		.1
36*702941cdSRichard Lowe
37*702941cdSRichard Lowe# By default, we build the shared library.  Construction of the standalone
38*702941cdSRichard Lowe# is specifically requested by architecture-specific Makefiles.
39*702941cdSRichard LoweTYPES=		library
40*702941cdSRichard LoweCURTYPE=	library
41*702941cdSRichard Lowe
42*702941cdSRichard LoweCOMDIR=		$(SRC)/lib/libsaveargs/common
43*702941cdSRichard Lowe
44*702941cdSRichard LoweOBJECTS_common_amd64	= saveargs.o
45*702941cdSRichard LoweSRCS_common_amd64	= $(OBJECTS_common_amd64:%.o=../amd64/%.c)
46*702941cdSRichard Lowe
47*702941cdSRichard LoweOBJECTS= $(OBJECTS_common_$(MACH)) $(OBJECTS_common_$(MACH64)) $(OBJECTS_common_common)
48*702941cdSRichard Lowe
49*702941cdSRichard Loweinclude $(SRC)/lib/Makefile.lib
50*702941cdSRichard Lowe
51*702941cdSRichard LoweSRCS=	$(SRCS_common_$(MACH)) $(SRCS_common_$(MACH64)) $(SRC_common_common)
52*702941cdSRichard Lowe
53*702941cdSRichard Lowe#
54*702941cdSRichard Lowe# Used to verify that the standalone doesn't have any unexpected external
55*702941cdSRichard Lowe# dependencies.
56*702941cdSRichard Lowe#
57*702941cdSRichard LoweLINKTEST_OBJ = objs/linktest_stand.o
58*702941cdSRichard Lowe
59*702941cdSRichard LoweCLOBBERFILES_standalone = $(LINKTEST_OBJ)
60*702941cdSRichard LoweCLOBBERFILES += $(CLOBBERFILES_$(CURTYPE))
61*702941cdSRichard Lowe
62*702941cdSRichard LoweLIBS_standalone	= $(STANDLIBRARY)
63*702941cdSRichard LoweLIBS_library = $(DYNLIB) $(LINTLIB)
64*702941cdSRichard LoweLIBS = $(LIBS_$(CURTYPE))
65*702941cdSRichard Lowe
66*702941cdSRichard LoweMAPFILES =	$(COMDIR)/mapfile-vers
67*702941cdSRichard Lowe
68*702941cdSRichard LoweLDLIBS +=	-lc -ldisasm
69*702941cdSRichard Lowe
70*702941cdSRichard LoweLDFLAGS_standalone = $(ZNOVERSION) $(BREDUCE) -dy -r
71*702941cdSRichard LoweLDFLAGS = $(LDFLAGS_$(CURTYPE))
72*702941cdSRichard Lowe
73*702941cdSRichard LoweASFLAGS_standalone = -DDIS_STANDALONE
74*702941cdSRichard LoweASFLAGS_library =
75*702941cdSRichard LoweASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM
76*702941cdSRichard Lowe
77*702941cdSRichard Lowe$(LINTLIB) := SRCS = $(COMDIR)/$(LINTSRC)
78*702941cdSRichard Lowe
79*702941cdSRichard Lowe# We want the thread-specific errno in the library, but we don't want it in
80*702941cdSRichard Lowe# the standalone.  $(DTS_ERRNO) is designed to add -D_TS_ERRNO to $(CPPFLAGS),
81*702941cdSRichard Lowe# in order to enable this feature.  Conveniently, -D_REENTRANT does the same
82*702941cdSRichard Lowe# thing.  As such, we null out $(DTS_ERRNO) to ensure that the standalone
83*702941cdSRichard Lowe# doesn't get it.
84*702941cdSRichard LoweDTS_ERRNO=
85*702941cdSRichard Lowe
86*702941cdSRichard LoweCPPFLAGS_standalone = -DDIS_STANDALONE
87*702941cdSRichard LoweCPPFLAGS_library = -D_REENTRANT
88*702941cdSRichard LoweCPPFLAGS +=	-I$(COMDIR) $(CPPFLAGS_$(CURTYPE))
89*702941cdSRichard Lowe
90*702941cdSRichard LoweCFLAGS_standalone = $(STAND_FLAGS_32)
91*702941cdSRichard LoweCFLAGS_common =
92*702941cdSRichard LoweCFLAGS += $(CFLAGS_$(CURTYPE)) $(CFLAGS_common)
93*702941cdSRichard Lowe
94*702941cdSRichard LoweCFLAGS64_standalone = $(STAND_FLAGS_64)
95*702941cdSRichard LoweCFLAGS64 += $(CCVERBOSE) $(CFLAGS64_$(CURTYPE)) $(CFLAGS64_common)
96*702941cdSRichard Lowe
97*702941cdSRichard LoweDYNFLAGS +=     $(ZINTERPOSE)
98*702941cdSRichard Lowe
99*702941cdSRichard Lowe.KEEP_STATE:
100