src/uts/Makefile.targ
author Alasdair Lumsden <alasdairrr@gmail.com>
Mon, 15 Aug 2011 19:04:02 +0000
branchoi_151a
changeset 569 660c4109f92b
parent 0 542988ea726d
permissions -rw-r--r--
Creating branch oi_151a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     1
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     2
# CDDL HEADER START
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     3
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     7
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     8
# You can obtain a copy of the license at src/OPENSOLARIS.LICENSE
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    10
# See the License for the specific language governing permissions
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    11
# and limitations under the License.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    12
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    14
# file and include the License file at src/OPENSOLARIS.LICENSE.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    18
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    19
# CDDL HEADER END
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    20
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    21
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    22
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    23
#ident  "@(#)Makefile.targ 1.9     97/10/08 SMI"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    24
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    25
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    26
# Use is subject to license terms.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    27
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    28
# jos/uts/Makefile.targ
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    29
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    30
#	This Makefiles contains the common targets and definitions for
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    31
#	all kernels. It is to be included in the Makefiles for specific
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    32
#	implementation architectures and processor architecture dependent
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    33
#	modules: i.e.: all driving kernel Makefiles.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    34
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    35
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    36
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    37
#	Default rule for building the lint library directory:
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    38
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    39
$(LINT_LIB_DIR):
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    40
	-@mkdir $@ 2> /dev/null
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    41
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    42
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    43
#	All C objects depend on inline files. However, cc(1) doesn't generate
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    44
#	the correct dependency info. Also, these Makefiles don't contain a
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    45
#	separate list of C-derived object files (but it is light weight to
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    46
#	let the assembler files think they depend upon this when they don't).
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    47
#	Fortunately, the inline files won't change very often. So, for now,
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    48
#	all objects depend on the inline files. Remove this when the inliner
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    49
#	is fixed to drop correct dependency information.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    50
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    51
$(OBJECTS): $(INLINES)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    52
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    53
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    54
#	Partially link .o files to generate the kmod. The fake dependency
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    55
#	on modstubs simplifies things...
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    56
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    57
$(MODULE):		$(OBJECTS)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    58
	$(LD) -r -o $@ $(OBJECTS)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    59
	$(POST_PROCESS)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    60
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    61
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    62
#	This target checks each kmod undefined entry points. It does not
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    63
#	modify the kmod in any way.  XXX hacked to workaround bugid 1056988
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    64
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    65
$(MODULE).check:	$(MODULE) $(OBJECTS) $(UNIX_O) $(MODSTUBS_O)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    66
	$(LD) -o /dev/null $(OBJECTS) $(UNIX_O) $(MODSTUBS_O)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    67
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    68
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    69
#	Module lint library construction targets.
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    70
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    71
MOD_LINT_LIB	= $(LINT_LIB_DIR)/llib-l$(MODULE).ln
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    72
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    73
modlintlib:		$(MOD_LINT_LIB)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    74
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    75
$(MOD_LINT_LIB):	$(LINT_LIB_DIR) $(LINTS)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    76
	@-$(ECHO) "\n$(MODULE): (library construction):"
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    77
	@$(LINT) -o$(MODULE) -u $(LINTFLAGS) $(LINTS)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    78
	@$(MV) $(@F) $@
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    79
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    80
$(MODULE).lint:		$(MOD_LINT_LIB)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    81
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    82
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    83
#	Installation targets and rules:
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    84
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    85
$(ROOT_MOD_DIR) $(USR_MOD_DIR):
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    86
	-$(INS.dir)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    87
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    88
$(ROOT_STRMOD_DIR): $(ROOT_MOD_DIR)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    89
	-$(INS.dir)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    90
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    91
$(USR_STRMOD_DIR): $(USR_MOD_DIR)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    92
	-$(INS.dir)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    93
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    94
$(ROOT_STRMOD_DIR)/%:	% $(ROOT_STRMOD_DIR)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    95
	$(INS.file)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    96
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    97
$(USR_STRMOD_DIR)/%:	% $(USR_STRMOD_DIR)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    98
	$(INS.file)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
    99
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   100
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   101
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   102
#
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   103
clean.lint:
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   104
	$(RM) $(LINTS) $(CLEANLINTFILES)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   105
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   106
clean:	clean.lint
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   107
	$(RM) $(OBJECTS) $(CLEANFILES)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   108
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   109
clobber:	clean
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   110
	$(RM) $(CLOBBERFILES)
542988ea726d initial version of Nevada G11N repository
simford
parents:
diff changeset
   111