2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# Permission is hereby granted, free of charge, to any person obtaining a
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# copy of this software and associated documentation files (the "Software"),
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# to deal in the Software without restriction, including without limitation
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# the rights to use, copy, modify, merge, publish, distribute, sublicense,
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# and/or sell copies of the Software, and to permit persons to whom the
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# Software is furnished to do so, subject to the following conditions:
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# The above copyright notice and this permission notice (including the next
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# paragraph) shall be included in all copies or substantial portions of the
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
ecc6aeb3d58e1a1089fec93c4acf1b99b10e7b2fJabiertxof# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# DEALINGS IN THE SOFTWARE.
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith###############################################################################
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# This Makefile builds mdb modules.
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith# It is designed to build both kernel kmdb and mdb .so files
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith###############################################################################
be0acd278c68b7331b0b83f8355aabeb44d98ca1Jabiertxof# Need common defaults
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn SmithCFLAGS += -D_ELF64 -DMDB_DEBUG -D_KERNEL -D_KMDB -g -m64
04815a0cf96245b9aeeb973e3ade866a4c124f44JazzyNicoKMOD_LDFLAGS = -ztype=kmod -znodefs -Nmisc/kmdbmod -Mmapfile
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn SmithSO_LDFLAGS = $(LDFLAGS) -Wl,-z,direct -Wl,-z,text -M mapfile
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn SmithSO_LDFLAGS += -Wl,-z,parent=/usr/bin$(ARCHLIBSUBDIR)/mdb
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn SmithCPPFLAGS += -xO3 -m64 -Ui386 -U__i386 -errtags=yes -errwarn=%all \
2f5f997e354e7f4a02b6818bdc68fbece5cb237dJohn Smith -erroff=E_EMPTY_TRANSLATION_UNIT -erroff=E_STATEMENT_NOT_REACHED \
f61c94c27c8fcea295c259f65d3142546072c2b0jabiertxof -DTEXT_DOMAIN=\"SUNW_OST_OSCMD\" -D_ERRNO_VERIFY -DMDB_DEBUG \
f61c94c27c8fcea295c259f65d3142546072c2b0jabiertxof $(CC) $(CFLAGS) $(CPPFLAGS) -G -o $@ $(SOURCES) $(LDFLAGS) \
f61c94c27c8fcea295c259f65d3142546072c2b0jabiertxof @print Installing $(KMOD) in $(PROTODIR)$(ROOT_KMOD_DIR)
f61c94c27c8fcea295c259f65d3142546072c2b0jabiertxof @print Installing $(MDBMOD) in $(PROTODIR)$(ROOT_MDB_DIR)
f61c94c27c8fcea295c259f65d3142546072c2b0jabiertxof @$(INSTALL_SCRIPT) -m 555 $(KMOD) $(PROTODIR)$(ROOT_KMOD_DIR)
f61c94c27c8fcea295c259f65d3142546072c2b0jabiertxof @$(INSTALL_SCRIPT) -m 555 $(MDBMOD) $(PROTODIR)$(ROOT_MDB_DIR)