205 lines
5.5 KiB
Makefile
Executable File
205 lines
5.5 KiB
Makefile
Executable File
#
|
|
# uts/Makefile.uts
|
|
#
|
|
#ident "@(#)Makefile.uts 1.34 95/01/27 SMI"
|
|
#
|
|
# Copyright (c) 1993 by Sun Microsystems, Inc.
|
|
#
|
|
# This Makefiles contains the common targets and definitions for
|
|
# all kernels. It is to be included in the Makefiles for specific
|
|
# implementation architectures and processor architecture dependent
|
|
# modules: i.e.: all driving kernel Makefiles.
|
|
#
|
|
# Include global definitions:
|
|
#
|
|
include $(SRC)/Makefile.master
|
|
|
|
#
|
|
# No text domain in the kernel.
|
|
#
|
|
DTEXTDOM =
|
|
|
|
#
|
|
# Build rules for linting the kernel.
|
|
#
|
|
# Note of exceptional make brain death. This used to read:
|
|
#
|
|
# LTAIL = ) | grep -v "warning: pointer cast may result in improper alignment"
|
|
#
|
|
# Observe the `:'. Observe the quoted `:'. Somehow this poor innocent
|
|
# little `:' causes make (when run with the appropriate options,
|
|
# such as for reconcile -n) to report an error:
|
|
#
|
|
# = missing in := transformation
|
|
#
|
|
# Oh wow! What a wonderful parser!
|
|
#
|
|
LHEAD = ( $(ECHO) "\n$@";
|
|
|
|
LTAIL = ) | grep -v "pointer cast may result in improper alignment"
|
|
|
|
LINT.c = $(LINT) -cu $(LINTFLAGS) $(LINT_DEFS) $(CPPFLAGS)
|
|
|
|
LINT.s = $(LINT.c)
|
|
|
|
#
|
|
# Build the compile/assemble lines:
|
|
#
|
|
EXTRA_OPTIONS =
|
|
ALWAYS_DEFS = -D_KERNEL
|
|
AS_DEFS = -D_ASM -D__STDC__=0
|
|
|
|
#
|
|
# CPPFLAGS is deliberatly set with a "=" and not a "+=". For the kernel
|
|
# the header include path should not look for header files outside of
|
|
# the kernel code. This "=" removes the search path built in
|
|
# Makefile.master inside CPPFLAGS. Ditto for AS_CPPFLAGS.
|
|
#
|
|
CPPFLAGS = $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) \
|
|
$(INCLUDE_PATH) $(EXTRA_OPTIONS)
|
|
ASFLAGS += -P
|
|
AS_CPPFLAGS = $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) $(AS_DEFS) \
|
|
$(AS_INC_PATH) $(EXTRA_OPTIONS)
|
|
LINTFLAGS = -nsxm
|
|
CFLAGS += $(EXTRA_CFLAGS)
|
|
CFLAGS += $(XAOPT)
|
|
CFLAGS += $(INLINES)
|
|
|
|
#
|
|
# Declare that $(OBJECTS) and $(LINTS) can be compiled in parallel.
|
|
# The DUMMY target is for those instances where OBJECTS and LINTS
|
|
# are empty (to avoid an unconditional .PARALLEL).
|
|
.PARALLEL: $(OBJECTS) $(LINTS) DUMMY
|
|
|
|
#
|
|
# Default cleanup definition
|
|
#
|
|
CLEANLINTFILES = $(MOD_LINT_LIB)
|
|
|
|
#
|
|
# Installation constants:
|
|
#
|
|
# FILEMODE is the mode given to the kernel modules
|
|
# CFILEMODE is the mode given to the '.conf' files
|
|
#
|
|
FILEMODE = 755
|
|
DIRMODE = 755
|
|
OWNER = root
|
|
GROUP = sys
|
|
CFILEMODE = 644
|
|
|
|
#
|
|
# Special Installation Macros for the installation of '.conf' files.
|
|
#
|
|
# These are unique because they are not installed from the current
|
|
# working directory.
|
|
#
|
|
CONFFILE = $(MODULE).conf
|
|
SRC_CONFILE = $(CONF_SRCDIR)/$(CONFFILE)
|
|
ROOT_CONFFILE = $(ROOTMODULE).conf
|
|
|
|
INS.conffile= \
|
|
$(RM) $@; $(INS) -s -m $(CFILEMODE) -f $(@D) $(SRC_CONFILE)
|
|
$(CH)INS.conffile= \
|
|
$(INS) -s -m $(CFILEMODE) -u $(OWNER) -g $(GROUP) -f $(@D) $(SRC_CONFILE)
|
|
|
|
#
|
|
# Installation directories
|
|
#
|
|
ROOT_MOD_DIR = $(ROOT)/kernel
|
|
|
|
ROOT_DRV_DIR = $(ROOT_MOD_DIR)/drv
|
|
ROOT_EXEC_DIR = $(ROOT_MOD_DIR)/exec
|
|
ROOT_FS_DIR = $(ROOT_MOD_DIR)/fs
|
|
ROOT_SCHED_DIR = $(ROOT_MOD_DIR)/sched
|
|
ROOT_STRMOD_DIR = $(ROOT_MOD_DIR)/strmod
|
|
ROOT_SYS_DIR = $(ROOT_MOD_DIR)/sys
|
|
ROOT_MISC_DIR = $(ROOT_MOD_DIR)/misc
|
|
ROOT_MACH_DIR = $(ROOT_MOD_DIR)/mach
|
|
|
|
ROOT_MOD_DIRS = $(ROOT_DRV_DIR) $(ROOT_EXEC_DIR)
|
|
ROOT_MOD_DIRS += $(ROOT_FS_DIR) $(ROOT_SCHED_DIR) $(ROOT_STRMOD_DIR)
|
|
ROOT_MOD_DIRS += $(ROOT_SYS_DIR) $(ROOT_MISC_DIR) $(ROOT_MACH_DIR)
|
|
|
|
USR_MOD_DIR = $(ROOT)/usr/kernel
|
|
|
|
USR_DRV_DIR = $(USR_MOD_DIR)/drv
|
|
USR_EXEC_DIR = $(USR_MOD_DIR)/exec
|
|
USR_FS_DIR = $(USR_MOD_DIR)/fs
|
|
USR_SCHED_DIR = $(USR_MOD_DIR)/sched
|
|
USR_STRMOD_DIR = $(USR_MOD_DIR)/strmod
|
|
USR_SYS_DIR = $(USR_MOD_DIR)/sys
|
|
USR_MISC_DIR = $(USR_MOD_DIR)/misc
|
|
|
|
USR_MOD_DIRS = $(USR_DRV_DIR) $(USR_EXEC_DIR)
|
|
USR_MOD_DIRS += $(USR_FS_DIR) $(USR_SCHED_DIR) $(USR_STRMOD_DIR)
|
|
USR_MOD_DIRS += $(USR_SYS_DIR) $(USR_MISC_DIR)
|
|
|
|
#
|
|
#
|
|
#
|
|
include $(SRC)/Makefile.psm
|
|
|
|
#
|
|
# Set ownership on links.
|
|
#
|
|
CHOWNLINK=
|
|
$(CH)CHOWNLINK= ; $(CHOWN) $(OWNER) $@
|
|
CHGRPLINK=
|
|
$(CH)CHGRPLINK= ; $(CHGRP) $(GROUP) $@
|
|
|
|
#
|
|
# The "-r" on the remove may be considered temporary, but is required
|
|
# while the replacement of the SUNW,SPARCstation-10,SX directory by
|
|
# a symbolic link is being propagated.
|
|
#
|
|
INS.slink1= $(RM) -r $@; $(SYMLINK) $(PLATFORM) $@ $(CHOWNLINK) $(CHGRPLINK)
|
|
INS.slink2= $(RM) -r $@; $(SYMLINK) ../$(PLATFORM)/$(@F) $@ $(CHOWNLINK) $(CHGRPLINK)
|
|
|
|
ROOT_PLAT_LINKS = $(PLAT_LINKS:%=$(ROOT_PLAT_DIR)/%)
|
|
ROOT_PLAT_LINKS_2 = $(PLAT_LINKS_2:%=$(ROOT_PLAT_DIR)/%)
|
|
USR_PLAT_LINKS = $(PLAT_LINKS:%=$(USR_PLAT_DIR)/%)
|
|
USR_PLAT_LINKS_2 = $(PLAT_LINKS_2:%=$(USR_PLAT_DIR)/%)
|
|
|
|
#
|
|
# Collection of all relevant, delivered kernel modules.
|
|
#
|
|
KMODS = $(DRV_KMODS) $(EXEC_KMODS) $(FS_KMODS) $(SCHED_KMODS) \
|
|
$(STRMOD_KMODS) $(SYS_KMODS) $(MISC_KMODS) $(MACH_KMODS) \
|
|
$(GENUNIX_KMODS)
|
|
|
|
#
|
|
# Files to be compiled with -xa, to generate basic block execution
|
|
# count data.
|
|
#
|
|
# There are several ways to compile parts of the kernel for kcov:
|
|
# 1) Add things to BB_FILES here or in other Makefiles
|
|
# 2) setenv BB_FILES '$(XXXX_OBJS)'
|
|
# 3) setenv BB_FILES '$(OBJECTS)'
|
|
#
|
|
# Do NOT setenv CFLAGS -xa, as that will cause infinite recursion
|
|
# in unix_bb.o
|
|
#
|
|
BB_FILES =
|
|
$(BB_FILES) := XAOPT = -xa
|
|
|
|
#
|
|
# The idea here is for unix_bb.o to be in all kernels except the
|
|
# kernel which actually gets shipped to customers. In practice,
|
|
# $(RELEASE_BUILD) is on for a number of the late beta and fcs builds.
|
|
#
|
|
CODE_COVERAGE=
|
|
$(RELEASE_BUILD)CODE_COVERAGE:sh= echo \\043
|
|
$(CODE_COVERAGE)unix_bb.o := CPPFLAGS += -DKCOV
|
|
$(CODE_COVERAGE)unix_bb.ln := CPPFLAGS += -DKCOV
|
|
|
|
#
|
|
# Do not let unix_bb.o get compiled with -xa!
|
|
#
|
|
$(OBJS_DIR)/unix_bb.o := XAOPT =
|
|
|
|
#
|
|
# MPSAS support
|
|
#
|
|
MPSAS_BUILD:sh= echo \\043
|