Makefile revision ae115bc77f6fcde83175c75b4206dc2e50747966
5cd4555ad444fd391002ae32450572054369fd42Rob Austein# CDDL HEADER START
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# The contents of this file are subject to the terms of the
dde8659175c5798267fb0fdefd7576e4efe271b3Automatic Updater# Common Development and Distribution License (the "License").
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# You may not use this file except in compliance with the License.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# or http://www.opensolaris.org/os/licensing.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# See the License for the specific language governing permissions
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# and limitations under the License.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# CDDL HEADER END
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Use is subject to license terms.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington#ident "%Z%%M% %I% %E% SMI"
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# This makefile drives the production of unix (and unix.o).
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# i86pc implementation architecture dependent
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Path to the base of the uts directory tree (usually /usr/src/uts).
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Define the module and object file sets.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian WellingtonROOT_MULTIBOOT = $(ROOT_PSM_DIR)/$(MULTIBOOT)
0b062f4990db5cc6db2fe3398926f71b92a67407Brian WellingtonLIBOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
b843f577bbcd6660fbaa506d9e55b156c689a5a8Evan HuntDBOOT_OBJECTS = $(DBOOT_OBJS:%=$(DBOOT_OBJS_DIR)/%)
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntDBOOT_LINTS = $(DBOOT_OBJS:%.o=$(DBOOT_OBJS_DIR)/%.ln)
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Include common rules.
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# Define targets
0b062f4990db5cc6db2fe3398926f71b92a67407Brian WellingtonINSTALL_TARGET = $(UNIX_BIN) $(MULTIBOOT) $(ROOTMODULE) $(ROOT_MULTIBOOT) $(BOOT_KERNEL)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# This is UNIX_DIR. Use a short path.
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntCLOBBERFILES = $(CLEANFILES) $(UNIX_BIN) $(MULTIBOOT)
553ead32ff5b00284e574dcabc39115d4d74ec66Evan HuntCLEANLINTFILES += $(LINT_LIB) $(DBOOT_LINT_LIB) $(DBOOT_LINTS)
cc6cddfd94e8f0c58c290317b0853dac30b1b895Evan Hunt# instr_size needs a special header
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt$(OBJS_DIR)/instr_size.o := EXTRA_OPTIONS = -I$(SRC)/common/dis/i386
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt$(OBJS_DIR)/instr_size.ln := EXTRA_OPTIONS = -I$(SRC)/common/dis/i386
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# For now, disable these lint checks; maintainers should endeavor
cc6cddfd94e8f0c58c290317b0853dac30b1b895Evan Hunt# to investigate and remove these for maximum lint coverage.
cc6cddfd94e8f0c58c290317b0853dac30b1b895Evan Hunt# Please do not carry these forward to new Makefiles.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinLINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Default build targets.
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt$(UNIX_BIN): $(UNIX_O) $(MODSTUBS_O) $(MAPFILE_NAME) \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein $(LD) -dy -b -o $@ -e dboot_image -znointerp -M $(MAPFILE_NAME) \
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington $(UNIX_O) $(DBOOT_O) $(MODSTUBS_O) $(LIBOPTS) \
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington $(ELFEXTRACT) $(DBOOT_OBJS_DIR)/$(DBOOT) >> $(DBOOT_S)
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# dboot is built as an intermediate target in dboot.o, so just make
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# dboot.o the dependency here.
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# The boot kernel is a copy of the 32-bit kernel paired with the
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt$(BOOT_KERNEL): $(ROOTMODULE) $(ROOT_BOOT_PSM_KERN_DIR)
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt# Special rules for generating assym.h for inclusion in assembly files.
553ead32ff5b00284e574dcabc39115d4d74ec66Evan Hunt$(DSF_DIR)/$(OBJS_DIR)/assym.h $(DSF_DIR)/$(OBJS_DIR)/kdi_assym.h: FRC
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# The global lint target builds the kernel lint library (llib-lunix.ln)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# which is equivalent to a lint of /unix.o. Then all kernel modules for
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# this architecture are linted against the kernel lint library.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Note: lint errors in the kernel lint library will be repeated for
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# each module. It is important that the kernel lint library
0b062f4990db5cc6db2fe3398926f71b92a67407Brian Wellington# be clean to keep the textual output to a reasonable level.
8b78c993cb475cc94e88560941b28c37684789d9Francis Dupont @-$(ECHO) "\n$(UNIX): (library construction):"
8b78c993cb475cc94e88560941b28c37684789d9Francis Dupont$(DBOOT_LINT_LIB): $(LINT_LIB_DIR) $(DBOOT_LINTS)
8b78c993cb475cc94e88560941b28c37684789d9Francis Dupont @-$(ECHO) "\n$(DBOOT): (library construction):"
8b78c993cb475cc94e88560941b28c37684789d9Francis Dupont @$(LINT) -o$(DBOOT) $(DBOOT_LINTFLAGS) $(DBOOT_LINTS)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Include common targets.