2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/A
2N/A#
2N/A# The build process for libdisasm is sightly different from that used by other
2N/A# libraries, because libdisasm must be built in two flavors - as a standalone
2N/A# for use by kmdb and as a normal library. We use $(CURTYPE) to indicate the
2N/A# current flavor being built.
2N/A#
2N/A# The SPARC library is built from the closed gate. This Makefile is shared
2N/A# between both environments, so all paths must be absolute.
2N/A#
2N/A
2N/ALIBRARY= libdisasm.a
2N/ASTANDLIBRARY= libstanddisasm.so
2N/AVERS= .1
2N/A
2N/A# By default, we build the shared library. Construction of the standalone
2N/A# is specifically requested by architecture-specific Makefiles.
2N/ATYPES= library
2N/ACURTYPE= library
2N/A
2N/ACOMDIR= $(SRC)/lib/libdisasm/common
2N/A
2N/A#
2N/A# Architecture-dependent files common to both versions of libdisasm
2N/A#
2N/AOBJECTS_common_i386 = dis_i386.o dis_tables.o
2N/AOBJECTS_common_sparc = dis_sparc.o instr.o dis_sparc_fmt.o
2N/A
2N/ASRCS_common_i386 = $(ISASRCDIR)/dis_i386.c $(SRC)/common/dis/i386/dis_tables.c
2N/ASRCS_common_sparc = $(ISASRCDIR)/dis_sparc.c $(ISASRCDIR)/instr.c \
2N/A $(ISASRCDIR)/dis_sparc_fmt.c
2N/A
2N/A#
2N/A# Architecture-independent files common to both version of libdisasm
2N/A#
2N/AOBJECTS_common_common = libdisasm.o
2N/ASRC_common_common = $(OBJECTS_common_common:%.o=$(COMDIR)/%.c)
2N/A
2N/A
2N/AOBJECTS= \
2N/A $(OBJECTS_common_$(MACH)) \
2N/A $(OBJECTS_common_common)
2N/A
2N/Ainclude $(SRC)/lib/Makefile.lib
2N/A
2N/ASRCS= \
2N/A $(SRCS_$(CURTYPE)) \
2N/A $(SRCS_common_$(MACH)) \
2N/A $(SRCS_common_common)
2N/A
2N/A#
2N/A# Used to verify that the standalone doesn't have any unexpected external
2N/A# dependencies.
2N/A#
2N/ALINKTEST_OBJ = objs/linktest_stand.o
2N/A
2N/ACLOBBERFILES_standalone = $(LINKTEST_OBJ)
2N/ACLOBBERFILES += $(CLOBBERFILES_$(CURTYPE))
2N/A
2N/ALIBS_standalone = $(STANDLIBRARY)
2N/ALIBS_library = $(DYNLIB) $(LINTLIB)
2N/ALIBS = $(LIBS_$(CURTYPE))
2N/A
2N/AMAPFILES = $(COMDIR)/mapfile-vers
2N/A
2N/ALDLIBS += -lc
2N/A
2N/ALDFLAGS_standalone = $(ZNOVERSION) -dy -r
2N/ALDFLAGS = $(LDFLAGS_$(CURTYPE))
2N/A
2N/AASFLAGS_standalone = -DDIS_STANDALONE
2N/AASFLAGS_library =
2N/AASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM
2N/A
2N/A$(LINTLIB) := SRCS = $(COMDIR)/$(LINTSRC)
2N/A
2N/A# We want the thread-specific errno in the library, but we don't want it in
2N/A# the standalone. $(DTS_ERRNO) is designed to add -D_TS_ERRNO to $(CPPFLAGS),
2N/A# in order to enable this feature. Conveniently, -D_REENTRANT does the same
2N/A# thing. As such, we null out $(DTS_ERRNO) to ensure that the standalone
2N/A# doesn't get it.
2N/ADTS_ERRNO=
2N/A
2N/A# We need to rename some standard functions so we can easily implement them
2N/A# in consumers.
2N/ASTAND_RENAMED_FUNCS= \
2N/A snprintf
2N/A
2N/ACPPFLAGS_standalone = -DDIS_STANDALONE $(STAND_RENAMED_FUNCS:%=-D%=mdb_%) \
2N/A -Dvsnprintf=mdb_iob_vsnprintf -I$(SRC)/cmd/mdb/common
2N/ACPPFLAGS_library = -D_REENTRANT
2N/ACPPFLAGS += -I$(COMDIR) $(CPPFLAGS_$(CURTYPE))
2N/A
2N/A#
2N/A# For x86, we have to link to sources in usr/src/common
2N/A#
2N/ACPPFLAGS_dis_i386 = -I$(SRC)/common/dis/i386 -DDIS_TEXT
2N/ACPPFLAGS_dis_sparc =
2N/ACPPFLAGS += $(CPPFLAGS_dis_$(MACH))
2N/A
2N/ACFLAGS_standalone = $(STAND_FLAGS_32)
2N/ACFLAGS_common =
2N/ACFLAGS += $(CFLAGS_$(CURTYPE)) $(CFLAGS_common)
2N/A
2N/ACFLAGS64_standalone = $(STAND_FLAGS_64)
2N/ACFLAGS64 += $(CCVERBOSE) $(CFLAGS64_$(CURTYPE)) $(CFLAGS64_common)
2N/A
2N/ADYNFLAGS += $(ZINTERPOSE)
2N/A
2N/A.KEEP_STATE: