Makefile revision 7014882c6a3672fd0e5d60200af8643ae53c5928
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# CDDL HEADER START
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# The contents of this file are subject to the terms of the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Common Development and Distribution License (the "License").
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# You may not use this file except in compliance with the License.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# See the License for the specific language governing permissions
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# and limitations under the License.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# When distributing Covered Code, include this CDDL HEADER in each
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# If applicable, add the following below this CDDL HEADER, with the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# fields enclosed by brackets "[]" replaced with your own identifying
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# information: Portions Copyright [yyyy] [name of copyright owner]
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# CDDL HEADER END
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Use is subject to license terms.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# This makefile drives the production of unix (and unix.o).
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# i86pc implementation architecture dependent
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Path to the base of the uts directory tree (usually /usr/src/uts).
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Define the module and object file sets.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLIBOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesDBOOT_OBJECTS = $(DBOOT_OBJS:%=$(DBOOT_OBJS_DIR)/%)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesDBOOT_LINTS = $(DBOOT_OBJS:%.o=$(DBOOT_OBJS_DIR)/%.ln)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Include common rules.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Define targets
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesINSTALL_TARGET = $(UNIX_BIN) $(MULTIBOOT) $(ROOTMODULE) $(ROOT_MULTIBOOT)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# This is UNIX_DIR. Use a short path.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCLOBBERFILES = $(CLEANFILES) $(UNIX_BIN) $(MULTIBOOT)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCLEANLINTFILES += $(LINT_LIB) $(DBOOT_LINT_LIB) $(DBOOT_LINTS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# instr_size needs a special header
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(OBJS_DIR)/instr_size.o := EXTRA_OPTIONS = -I$(SRC)/common/dis/i386
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(OBJS_DIR)/instr_size.ln := EXTRA_OPTIONS = -I$(SRC)/common/dis/i386
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# For now, disable these lint checks; maintainers should endeavor
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# to investigate and remove these for maximum lint coverage.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Please do not carry these forward to new Makefiles.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Ensure that lint sees 'struct cpu' containing a fully declared
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# embedded 'struct machcpu'
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Default build targets.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(UNIX_BIN): $(UNIX_O) $(MODSTUBS_O) $(MAPFILE_NAME) \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(LD) -dy -b -o $@ -e dboot_image -znointerp -M $(MAPFILE_NAME) \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(DBOOT_BIN): $(DBOOT_OBJS_DIR) $(DBOOT_OBJECTS) dboot/Mapfile.dboot
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# dboot is built as an intermediate target in dboot.o, so just make
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# dboot.o the dependency here.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Special rules for generating assym.h for inclusion in assembly files.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(DSF_DIR)/$(OBJS_DIR)/assym.h $(DSF_DIR)/$(OBJS_DIR)/kdi_assym.h: FRC
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# The global lint target builds the kernel lint library (llib-lunix.ln)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# which is equivalent to a lint of /unix.o. Then all kernel modules for
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# this architecture are linted against the kernel lint library.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Note: lint errors in the kernel lint library will be repeated for
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# each module. It is important that the kernel lint library
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# be clean to keep the textual output to a reasonable level.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @$(LINT) -o$(DBOOT) $(DBOOT_LINTFLAGS) $(DBOOT_LINTS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Include common targets.