Files
Arquivotheca.Solaris-2.5/uts/Makefile.targ
seta75D 7c4988eac0 Init
2021-10-11 19:38:01 -03:00

231 lines
6.0 KiB
Makefile
Executable File

#
# uts/Makefile.targ
#
# Copyright (c) 1991 by Sun Microsystems, Inc.
#
#ident "@(#)Makefile.targ 1.27 94/10/06 SMI"
#
# 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.
#
#
# Default rule for building the lint library directory:
#
$(LINT_LIB_DIR):
-@mkdir $@ 2> /dev/null
#
# All C objects depend on inline files. However, cc(1) doesn't generate
# the correct dependency info. Also, these Makefiles don't contain a
# separate list of C-derived object files (but it is light weight to
# let the assembler files think they depend upon this when they don't).
# Fortunately, the inline files won't change very often. So, for now,
# all objects depend on the inline files. Remove this when the inliner
# is fixed to drop correct dependency information.
#
$(OBJECTS): $(INLINES)
#
# Partially link .o files to generate the kmod. The fake dependency
# on modstubs simplifies things...
#
$(MODULE): $(OBJECTS)
$(LD) -r -o $@ $(OBJECTS)
$(POST_PROCESS)
#
# This target checks each kmod undefined entry points. It does not
# modify the kmod in any way. XXX hacked to workaround bugid 1056988
# and bugid 1130593
#
$(MODULE).check: $(MODULE) $(OBJECTS) $(UNIX_O) $(MODSTUBS_O) $(GENLIB)
$(LD) -o /tmp/make.check $(OBJECTS) $(UNIX_O) $(MODSTUBS_O) $(GENLIB)
rm -f /tmp/make.check
#
# Module lint library construction targets.
#
MOD_LINT_LIB = $(LINT_LIB_DIR)/llib-l$(MODULE).ln
modlintlib: $(MOD_LINT_LIB)
$(MOD_LINT_LIB): $(LINT_LIB_DIR) $(LINTS)
@-$(ECHO) "\n$(MODULE): (library construction):"
@$(LINT) -o$(MODULE) -u $(LINTFLAGS) $(LINTS)
@$(MV) $(@F) $@
$(MODULE).lint: $(MOD_LINT_LIB) $(LINT_LIB) $(GEN_LINT_LIB)
@-$(ECHO) "\n$(MODULE): global crosschecks:"
@$(LINT) $(LINTFLAGS) -u $(MOD_LINT_LIB) $(LINT_LIB) $(GEN_LINT_LIB)
#
# Since assym.s is a derived file, the dependency must be explicit for
# all files including this file. (This is only actually required in the
# instance when the .nse_depinfo file does not exist.) It may seem that
# the lint targets should also have a similar dependency, but they don't
# since only C headers are included when #defined(lint) is true. The
# actual lists are defined in */Makefile.files.
#
$(ASSYM_DEPS:%=$(OBJS_DIR)/%): $(DSF_DIR)/assym.s
#
# Special rules for generating assym.s for inclusion in assembly files.
#
$(DSF_DIR)/assym.s: FRC
@cd $(DSF_DIR); $(MAKE) all
#
# Everybody need to know how to create a modstubs.o built with the
# appropriate flags and located in the appropriate location.
#
$(MODSTUBS_DIR)/modstubs.o: $(MODSTUBS)
$(COMPILE.s) -o $@ $(MODSTUBS)
$(MODSTUBS_DIR)/modstubs.ln: $(MODSTUBS)
@($(LHEAD) $(LINT.s) $(MODSTUBS) $(LTAIL))
#
# Generate vers.c to contain the current release and version. Specific
# dependencies are required for "*/vers.*" since vers.c is a derived
# file.
#
# system name: hardwired to SunOS
# node name: blank
# release: contents of $(RELEASE) (Spaces replaced by '_')
# version: contents of $(PATCHID) (Spaces replaced by '_')
# machine: hardwired to sun4c
#
# Build environment information is only contained in the comment section.
#
# The version string, normally the variable VERSION, is set to display
# environmental information temporarily while in development because
# it provides a little more useful information.
#
VERSION_STRING = ($(ECHO) $$LOGNAME [\`basename $$CODEMGR_WS\`] \\\c; date +%D)
$(INTERNAL_RELEASE_BUILD)VERSION_STRING = $(ECHO) $(PATCHID)
$(OBJS_DIR)/vers.c: $(OBJECTS)
@-$(ECHO) "rebuilding vers.c"
@-( \
$(ECHO) "/*" ; \
$(ECHO) " * This file is derived from uts/Makefile.targ" ; \
$(ECHO) " */\n" ; \
$(ECHO) "#pragma\tident\t\"@(#)vers.c\tDERIVED\t94/10/06 SMI\"\n" ; \
$(ECHO) "#include <sys/utsname.h>\n" ; \
$(ECHO) "struct utsname utsname = {" ; \
$(ECHO) "\t\"SunOS\"," ; \
$(ECHO) "\t\"\"," ; \
$(ECHO) "\t\"`$(ECHO) $(RELEASE) | sed -e \"s/ /_/g\"`\"," ; \
$(ECHO) "\t\"`$(VERSION_STRING) | sed -e \"s/ /_/g\"`\"," ; \
$(ECHO) "\t\"$(PLATFORM)\"" ; \
$(ECHO) "};" ) > $(OBJS_DIR)/vers.c
$(OBJS_DIR)/vers.o: $(OBJS_DIR)/vers.c
$(COMPILE.c) -o $@ $(OBJS_DIR)/vers.c
$(POST_PROCESS_O)
$(LINTS_DIR)/vers.ln: $(OBJS_DIR)/vers.c
@($(LHEAD) $(LINT.c) $(OBJS_DIR)/vers.c $(LTAIL))
#
# Installation targets and rules:
#
$(ROOT_MOD_DIR) $(USR_MOD_DIR):
-$(INS.dir.root.sys)
$(ROOT_MOD_DIRS): $(ROOT_MOD_DIR)
-$(INS.dir.root.sys)
$(USR_MOD_DIRS): $(USR_MOD_DIR)
-$(INS.dir.root.sys)
$(ROOT_MOD_DIR)/%: % $(ROOT_MOD_DIR)
$(INS.file)
$(ROOT_DRV_DIR)/%: % $(ROOT_DRV_DIR)
$(INS.file)
$(ROOT_EXEC_DIR)/%: % $(ROOT_EXEC_DIR)
$(INS.file)
$(ROOT_FS_DIR)/%: % $(ROOT_FS_DIR)
$(INS.file)
$(ROOT_SCHED_DIR)/%: % $(ROOT_SCHED_DIR)
$(INS.file)
$(ROOT_STRMOD_DIR)/%: % $(ROOT_STRMOD_DIR)
$(INS.file)
$(ROOT_SYS_DIR)/%: % $(ROOT_SYS_DIR)
$(INS.file)
$(ROOT_MISC_DIR)/%: % $(ROOT_MISC_DIR)
$(INS.file)
$(ROOT_MACH_DIR)/%: % $(ROOT_MACH_DIR)
$(INS.file)
$(USR_DRV_DIR)/%: % $(USR_DRV_DIR)
$(INS.file)
$(USR_EXEC_DIR)/%: % $(USR_EXEC_DIR)
$(INS.file)
$(USR_FS_DIR)/%: % $(USR_FS_DIR)
$(INS.file)
$(USR_SCHED_DIR)/%: % $(USR_SCHED_DIR)
$(INS.file)
$(USR_STRMOD_DIR)/%: % $(USR_STRMOD_DIR)
$(INS.file)
$(USR_SYS_DIR)/%: % $(USR_SYS_DIR)
$(INS.file)
$(USR_MISC_DIR)/%: % $(USR_MISC_DIR)
$(INS.file)
include $(SRC)/Makefile.psm.targ
#
# Targets for '.conf' file installation.
#
$(ROOT_CONFFILE): $(SRC_CONFFILE) $(ROOT_CONFFILE:%/$(CONFFILE)=%)
$(INS.conffile)
#
# Targets for creating links between common platforms. ROOT_PLAT_LINKS
# are are the /platform level while ROOT_PLAT_LINKS_2 are one level
# down (/platform/`uname -i`/{lib|sbin|kernel}.
#
$(ROOT_PLAT_LINKS):
$(INS.slink1)
$(ROOT_PLAT_LINKS_2):
$(INS.slink2)
$(USR_PLAT_LINKS):
$(INS.slink1)
$(USR_PLAT_LINKS_2):
$(INS.slink2)
#
# Cleanliness is next to ...
#
clean.lint:
-$(RM) $(LINTS) $(CLEANLINTFILES) Nothing_to_remove
clean: clean.lint
-$(RM) $(OBJECTS) $(CLEANFILES) Nothing_to_remove
clobber: clean
-$(RM) $(CLOBBERFILES) Nothing_to_remove
FRC: