Makefile revision ae115bc77f6fcde83175c75b4206dc2e50747966
867N/A#
369N/A# CDDL HEADER START
369N/A#
369N/A# The contents of this file are subject to the terms of the
369N/A# Common Development and Distribution License (the "License").
369N/A# You may not use this file except in compliance with the License.
369N/A#
369N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
369N/A# or http://www.opensolaris.org/os/licensing.
369N/A# See the License for the specific language governing permissions
369N/A# and limitations under the License.
369N/A#
369N/A# When distributing Covered Code, include this CDDL HEADER in each
369N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
369N/A# If applicable, add the following below this CDDL HEADER, with the
369N/A# fields enclosed by brackets "[]" replaced with your own identifying
369N/A# information: Portions Copyright [yyyy] [name of copyright owner]
369N/A#
369N/A# CDDL HEADER END
369N/A#
6320N/A
369N/A#
369N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
369N/A# Use is subject to license terms.
369N/A#
6320N/A#ident "%Z%%M% %I% %E% SMI"
369N/A#
6320N/A# This makefile drives the production of unix (and unix.o).
844N/A#
6320N/A# i86pc implementation architecture dependent
6320N/A#
369N/A
3996N/A#
3996N/A# Path to the base of the uts directory tree (usually /usr/src/uts).
369N/A#
369N/AUTSBASE = ../..
867N/A
867N/A#
1535N/A# Define the module and object file sets.
1535N/A#
1535N/AUNIX = unix
867N/ADBOOT = dboot
3996N/AMULTIBOOT = multiboot
867N/A
369N/AOBJECTS = $(SPECIAL_OBJS:%=$(OBJS_DIR)/%) \
6320N/A $(CORE_OBJS:%=$(OBJS_DIR)/%) \
6320N/A $(KRTLD_OBJS:%=$(OBJS_DIR)/%) \
369N/A $(MACH_NOT_YET_KMODS:%=$(OBJS_DIR)/%)
369N/A
369N/ALINTS = $(SPECIAL_OBJS:%.o=$(LINTS_DIR)/%.ln) \
4994N/A $(CORE_OBJS:%.o=$(LINTS_DIR)/%.ln) \
6320N/A $(KRTLD_OBJS:%.o=$(LINTS_DIR)/%.ln) \
4994N/A $(MACH_NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln) \
369N/A $(LINTS_DIR)/vers.ln \
369N/A $(LINTS_DIR)/modstubs.ln
369N/A
369N/AROOTMODULE = $(ROOT_PSM_KERN_DIR)/$(UNIX)
369N/AROOT_MULTIBOOT = $(ROOT_PSM_DIR)/$(MULTIBOOT)
369N/ABOOT_KERNEL = $(ROOT_BOOT_PSM_KERN_DIR)/$(UNIX)
369N/A
369N/AUNIX_BIN = $(OBJS_DIR)/$(UNIX)
369N/A
369N/ALIBS = $(GENLIB)
369N/A
4994N/AGENUNIX = genunix
369N/AGENUNIX_DIR = ../../intel/$(GENUNIX)
369N/A
369N/ALIBOPTS = -L $(GENUNIX_DIR)/$(OBJS_DIR) -l $(GENUNIX)
369N/A
369N/ACTFEXTRAOBJS = $(OBJS_DIR)/vers.o
369N/A
369N/ADBOOT_OBJS_DIR = dboot/$(OBJS_DIR)
369N/ADBOOT_OBJECTS = $(DBOOT_OBJS:%=$(DBOOT_OBJS_DIR)/%)
369N/ADBOOT_O = $(OBJS_DIR)/$(DBOOT).o
369N/ADBOOT_S = $(DBOOT_O:%.o=%.s)
369N/ADBOOT_LINTS = $(DBOOT_OBJS:%.o=$(DBOOT_OBJS_DIR)/%.ln)
369N/ADBOOT_LINT = $(i386_LINT)
867N/A
369N/A#
369N/A# Include common rules.
369N/A#
369N/Ainclude $(UTSBASE)/i86pc/Makefile.i86pc
#
# Define targets
#
ALL_TARGET = $(UNIX_BIN) $(MULTIBOOT)
LINT_TARGET = $(LINT_LIB) $(DBOOT_LINT_LIB)
INSTALL_TARGET = $(UNIX_BIN) $(MULTIBOOT) $(ROOTMODULE) $(ROOT_MULTIBOOT) $(BOOT_KERNEL)
#
# This is UNIX_DIR. Use a short path.
#
UNIX_DIR = .
#
# Overrides
#
CLEANFILES += \
$(UNIX_O) $(MODSTUBS_O) \
$(OBJS_DIR)/vers.c $(OBJS_DIR)/vers.o \
$(DTRACESTUBS_O) $(DTRACESTUBS)
CLEANFILES += \
$(DBOOT_O) $(DBOOT_S) \
$(DBOOT_OBJECTS) \
$(OBJS_DIR)/bios_call_src.o \
$(OBJS_DIR)/bios_call_src \
$(OBJS_DIR)/bios_call.s \
$(DBOOT_OBJS_DIR)/$(DBOOT)
CLOBBERFILES = $(CLEANFILES) $(UNIX_BIN) $(MULTIBOOT)
CLEANLINTFILES += $(LINT_LIB) $(DBOOT_LINT_LIB) $(DBOOT_LINTS)
# instr_size needs a special header
$(OBJS_DIR)/instr_size.o := EXTRA_OPTIONS = -I$(SRC)/common/dis/i386
$(OBJS_DIR)/instr_size.ln := EXTRA_OPTIONS = -I$(SRC)/common/dis/i386
CFLAGS += -DDIS_MEM
#
# For now, disable these lint checks; maintainers should endeavor
# to investigate and remove these for maximum lint coverage.
# Please do not carry these forward to new Makefiles.
#
LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
LINTTAGS += -erroff=E_STATIC_UNUSED
LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
#
# Default build targets.
#
.KEEP_STATE:
def: $(DEF_DEPS)
all: $(ALL_DEPS)
clean: $(CLEAN_DEPS)
clobber: $(CLOBBER_DEPS)
lint: $(LINT_DEPS)
clean.lint: $(CLEAN_LINT_DEPS)
install: $(INSTALL_DEPS)
MAPFILE_32 = $(MAPFILE)
MAPFILE_64 = $(MAPFILE).amd64
MAPFILE_NAME = $(MAPFILE_$(CLASS))
$(UNIX_BIN): $(UNIX_O) $(MODSTUBS_O) $(MAPFILE_NAME) \
$(GENLIB) $(DTRACESTUBS) $(DBOOT_O)
$(LD) -dy -b -o $@ -e dboot_image -znointerp -M $(MAPFILE_NAME) \
$(UNIX_O) $(DBOOT_O) $(MODSTUBS_O) $(LIBOPTS) \
$(DTRACESTUBS)
$(MBH_PATCH) $(UNIX_BIN)
$(CTFMERGE_UNIQUIFY_AGAINST_GENUNIX)
$(POST_PROCESS)
$(UNIX_O): $(OBJECTS) $(OBJS_DIR)/vers.o
$(LD) -r -o $@ $(OBJECTS) $(OBJS_DIR)/vers.o
$(DBOOT_O): $(DBOOT_OBJS_DIR) $(DBOOT_OBJECTS)
$(LD) -dn -M dboot/Mapfile.dboot \
-o $(DBOOT_OBJS_DIR)/$(DBOOT) $(DBOOT_OBJECTS)
@echo " .data" > $(DBOOT_S)
@echo " .globl dboot_image" >> $(DBOOT_S)
@echo "dboot_image:" >> $(DBOOT_S)
$(ELFEXTRACT) $(DBOOT_OBJS_DIR)/$(DBOOT) >> $(DBOOT_S)
$(COMPILE.s) -o $(DBOOT_O) $(DBOOT_S)
$(DBOOT_OBJS_DIR):
-@mkdir -p $@ 2> /dev/null
#
# dboot is built as an intermediate target in dboot.o, so just make
# dboot.o the dependency here.
#
$(MULTIBOOT): $(DBOOT_O)
$(CP) $(DBOOT_OBJS_DIR)/$(DBOOT) $(MULTIBOOT)
$(POST_PROCESS)
#
# The boot kernel is a copy of the 32-bit kernel paired with the
# install/failsafe miniroot
$(BOOT_KERNEL): $(ROOTMODULE) $(ROOT_BOOT_PSM_KERN_DIR)
$(CP) $(ROOTMODULE) $(BOOT_KERNEL)
$(POST_PROCESS)
#
# Special rules for generating assym.h for inclusion in assembly files.
#
$(DSF_DIR)/$(OBJS_DIR)/assym.h $(DSF_DIR)/$(OBJS_DIR)/kdi_assym.h: FRC
@cd $(DSF_DIR); $(MAKE) all.targ
$(GENLIB): FRC
@(cd $(GENLIB_DIR); pwd; $(MAKE) all.targ)
@pwd
#
# The global lint target builds the kernel lint library (llib-lunix.ln)
# which is equivalent to a lint of /unix.o. Then all kernel modules for
# this architecture are linted against the kernel lint library.
#
# Note: lint errors in the kernel lint library will be repeated for
# each module. It is important that the kernel lint library
# be clean to keep the textual output to a reasonable level.
#
$(LINT_LIB): $(LINT_LIB_DIR) $(LINTS)
@-$(ECHO) "\n$(UNIX): (library construction):"
@$(LINT) -o$(UNIX) $(LINTFLAGS) $(LINTS)
@$(MV) $(@F) $@
$(DBOOT_LINT_LIB): $(LINT_LIB_DIR) $(DBOOT_LINTS)
@-$(ECHO) "\n$(DBOOT): (library construction):"
@$(LINT) -o$(DBOOT) $(DBOOT_LINTFLAGS) $(DBOOT_LINTS)
@$(MV) $(@F) $@
lintlib: $(LINT_DEPS)
#
# Include common targets.
#
include $(UTSBASE)/i86pc/Makefile.targ