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