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