1494N/A#
1607N/A# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
1494N/A#
1494N/A# Permission is hereby granted, free of charge, to any person obtaining a
1494N/A# copy of this software and associated documentation files (the "Software"),
1494N/A# to deal in the Software without restriction, including without limitation
1494N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
1494N/A# and/or sell copies of the Software, and to permit persons to whom the
1494N/A# Software is furnished to do so, subject to the following conditions:
1494N/A#
1494N/A# The above copyright notice and this permission notice (including the next
1494N/A# paragraph) shall be included in all copies or substantial portions of the
1494N/A# Software.
1494N/A#
1494N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1494N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1494N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1494N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1494N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1494N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1494N/A# DEALINGS IN THE SOFTWARE.
1494N/A#
1494N/A#
1494N/A###############################################################################
1494N/A#
1494N/A# This Makefile builds mdb modules.
1494N/A# It is designed to build both kernel kmdb and mdb .so files
1494N/A#
1494N/A###############################################################################
1494N/A
1494N/A
1494N/ATOP:sh=hg root
1494N/AKERNEL = $(TOP)/open-src/kernel
1500N/ABUILD_TYPE = 64
1494N/Ainclude $(TOP)/open-src/common/Makefile.init
1494N/A# Need common defaults
1494N/Ainclude $(TOP)/open-src/common/Makefile.defs
1494N/Ainclude $(KERNEL)/Makefile.rules
1494N/A
1494N/AKMOD = i915
1494N/AMDBMOD = i915.so
1494N/AMODULES = $(KMOD) $(MDBMOD)
1494N/A
1611N/ACFLAGS += -v -xdebugformat=stabs -xildoff
1611N/ACFLAGS += -std=c11
1494N/ACFLAGS += -D_ELF64 -DMDB_DEBUG -D_KERNEL -D_KMDB -g -m64
1637N/ACPPFLAGS += -I$(KERNEL)
1637N/ACPPFLAGS += -I$(KERNEL)/sys/drm
1637N/ACPPFLAGS += -I$(KERNEL)/sys
1637N/ACPPFLAGS += -I$(PROTODIR)/usr/include
1637N/ACPPFLAGS += -I$(PROTODIR)/usr/include/drm
1637N/ACPPFLAGS += -I/usr/include
1611N/AKMOD_LDFLAGS = -ztype=kmod -znodefs -Nmisc/kmdbmod -Mmapfile
1611N/A$(MDBMOD):= CFLAGS += -KPIC
1611N/A$(KMOD):= CFLAGS += -xmodel=kernel
1500N/ASO_LDFLAGS = $(LDFLAGS) -Wl,-z,direct -Wl,-z,text -M mapfile
1494N/ASO_LDFLAGS += -Wl,-z,parent=/usr/bin$(ARCHLIBSUBDIR)/mdb
1607N/ACPPFLAGS += -xO3 -m64 -Ui386 -U__i386 -errtags=yes -errwarn=%all \
1494N/A -erroff=E_EMPTY_TRANSLATION_UNIT -erroff=E_STATEMENT_NOT_REACHED \
1494N/A -W0,-xglobalstatic -g -W0,-noglobal \
1494N/A -DTEXT_DOMAIN=\"SUNW_OST_OSCMD\" -D_ERRNO_VERIFY -DMDB_DEBUG \
1494N/A -D_KERNEL -D_ELF64
1494N/A
1494N/ASOURCES = i915.c
1494N/AOBJECTS = $(SOURCES:%.c=%.o)
1494N/ALINTFILES = $(SOURCES:%.c=%.ln)
1494N/ABC_OBJS = $(SOURCES:%.c=%.o.bc)
1494N/A
1494N/Aall: $(MODULES)
1494N/A
1494N/A.KEEP_STATE:
1494N/A
1494N/A.NO_PARALLEL:
1494N/A.PARALLEL: $(OBJECTS) $(LINTFILES)
1494N/A
1494N/A$(OBJECTS): $(SOURCES)
1494N/A @print CFLAGS=$(CFLAGS)
1494N/A $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
1494N/A $(CTFCONVERT) $(CTFCVTFLAGS) $@
1494N/A
1494N/A$(KMOD): $(OBJECTS)
1494N/A $(LD) -o $@ $(OBJECTS) $(KMOD_LDFLAGS) $(LIBS)
1494N/A $(CTFMERGE) $(CTFMERGE_LABEL) -o $@ $(OBJECTS)
1494N/A
1494N/A$(MDBMOD): $(OBJECTS)
1494N/A $(CC) $(CFLAGS) $(CPPFLAGS) -G -o $@ $(SOURCES) $(LDFLAGS) \
1494N/A $(SO_LDFLAGS) $(LIBS)
1494N/A
1494N/Ainstall: $(MODULES)
1494N/A @print Installing $(KMOD) in $(PROTODIR)$(ROOT_KMOD_DIR)
1494N/A @print Installing $(MDBMOD) in $(PROTODIR)$(ROOT_MDB_DIR)
1494N/A @mkdir -p $(PROTODIR)$(ROOT_KMOD_DIR)
1494N/A @mkdir -p $(PROTODIR)$(ROOT_MDB_DIR)
1496N/A @$(INSTALL_SCRIPT) -m 555 $(KMOD) $(PROTODIR)$(ROOT_KMOD_DIR)
1496N/A @$(INSTALL_SCRIPT) -m 555 $(MDBMOD) $(PROTODIR)$(ROOT_MDB_DIR)
1494N/A
1494N/Aclean:
1494N/A rm -f $(OBJECTS) $(BC_OBJS) $(MODULES)
1494N/A
1494N/Aclean.lint:
1494N/A rm -f $(LINTFILES)
1494N/A
1494N/Aclobber: clean clean.lint
1494N/A rm -f $(MODULES)
1494N/A
1494N/A%.ln:%.c
1494N/A $(LINT) $(LINTFLAGS) $(CPPFLAGS) -o $@ $<
1494N/A
1494N/Alint: $(LINTFILES)
1494N/A