Makefile revision 1500
80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankg# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavic# Permission is hereby granted, free of charge, to any person obtaining a
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavic# copy of this software and associated documentation files (the "Software"),
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavic# to deal in the Software without restriction, including without limitation
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavic# the rights to use, copy, modify, merge, publish, distribute, sublicense,
4da61833a1cbbca94094f9653fd970582b97a72etrawick# and/or sell copies of the Software, and to permit persons to whom the
4da61833a1cbbca94094f9653fd970582b97a72etrawick# Software is furnished to do so, subject to the following conditions:
4da61833a1cbbca94094f9653fd970582b97a72etrawick# The above copyright notice and this permission notice (including the next
4da61833a1cbbca94094f9653fd970582b97a72etrawick# paragraph) shall be included in all copies or substantial portions of the
4789804be088bcd86ae637a29cdb7fda25169521jailletc# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4789804be088bcd86ae637a29cdb7fda25169521jailletc# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
e50c3026198fd496f183cda4c32a202925476778covener# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
e50c3026198fd496f183cda4c32a202925476778covener# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
e50c3026198fd496f183cda4c32a202925476778covener# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5b88c8507d5ef6d0c4cfbc78230294968175b638minfrin# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
5b88c8507d5ef6d0c4cfbc78230294968175b638minfrin# DEALINGS IN THE SOFTWARE.
6c3b9cebb551140fbb25d58bae08b539b3802133ylavic###############################################################################
4f29b65ab4b547ad5dbe506e2d0ff5d12ead9247ylavic# This Makefile builds mdb modules.
0a0df13b7f1f4f1a74fe295253d89ca3911b301aylavic# It is designed to build both kernel kmdb and mdb .so files
0a0df13b7f1f4f1a74fe295253d89ca3911b301aylavic###############################################################################
506bfe33206b2fece40ef25f695af39dd4130facjkaluza# Need common defaults
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicCFLAGS += -v -K PIC -xc99=%all -xdebugformat=stabs -xildoff
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicCFLAGS += -D_ELF64 -DMDB_DEBUG -D_KERNEL -D_KMDB -g -m64
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicCPPFLAGS += -I$(KERNEL) -I$(KERNEL)/sys/drm -I/usr/include
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicSO_LDFLAGS = $(LDFLAGS) -Wl,-z,direct -Wl,-z,text -M mapfile
e8bd80a4bb88199d2f9a24a50345688e52d9c116ylavicSO_LDFLAGS += -Wl,-z,parent=/usr/bin$(ARCHLIBSUBDIR)/mdb
e8bd80a4bb88199d2f9a24a50345688e52d9c116ylavicCPPFLAGS += -xO3 -m64 -Ui386 -U__i386 -Xa -errtags=yes -errwarn=%all \
e8bd80a4bb88199d2f9a24a50345688e52d9c116ylavic -erroff=E_EMPTY_TRANSLATION_UNIT -erroff=E_STATEMENT_NOT_REACHED \
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavic -DTEXT_DOMAIN=\"SUNW_OST_OSCMD\" -D_ERRNO_VERIFY -DMDB_DEBUG \
caad2986f81ab263f7af41467dd622dc9add17f3ylavic $(CC) $(CFLAGS) $(CPPFLAGS) -G -o $@ $(SOURCES) $(LDFLAGS) \
2165214331e4afafca4048f66f303d0253d7b001covener @print Installing $(KMOD) in $(PROTODIR)$(ROOT_KMOD_DIR)
a34684a59b60a4173c25035d0c627ef17e6dc215rpluem @print Installing $(MDBMOD) in $(PROTODIR)$(ROOT_MDB_DIR)
1e2d421a36999d292042a5539971070d54aa6c63ylavic @$(INSTALL_SCRIPT) -m 555 $(KMOD) $(PROTODIR)$(ROOT_KMOD_DIR)
1e2d421a36999d292042a5539971070d54aa6c63ylavic @$(INSTALL_SCRIPT) -m 555 $(MDBMOD) $(PROTODIR)$(ROOT_MDB_DIR)