xref: /titanic_52/usr/src/uts/intel/genunix/Makefile (revision 1a7c1b724419d3cb5fa6eea75123c6b2060ba31b)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#ident	"%Z%%M%	%I%	%E% SMI"
27#
28#	This makefile drives the production of the generic
29#	unix kernel module.
30#
31#	x86 implementation architecture dependent
32#
33
34#
35#	Path to the base of the uts directory tree (usually /usr/src/uts).
36#
37UTSBASE	= ../..
38
39#
40#	Define the module and object file sets.
41#
42MODULE		= genunix
43GENUNIX		= $(OBJS_DIR)/$(MODULE)
44
45OBJECTS		= $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \
46		  $(NOT_YET_KMODS:%=$(OBJS_DIR)/%)
47
48LINTS		= $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \
49		  $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln)
50
51ROOTMODULE	= $(ROOT_KERN_DIR)/$(MODULE)
52
53LIBGEN		= $(OBJS_DIR)/libgenunix.so
54LIBSTUBS	= $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
55SONAME		= $(MODULE)
56
57#
58#	Include common rules.
59#
60include $(UTSBASE)/intel/Makefile.intel
61
62#
63#	Define targets
64#
65ALL_TARGET	= $(LIBGEN)
66LINT_TARGET	= $(MODULE).lint
67INSTALL_TARGET	= $(GENUNIX) $(ROOTMODULE)
68
69#
70#	Overrides
71#
72CLEANFILES	+= $(LIBSTUBS) $(LIBGEN)
73BINARY		=
74
75#
76# Non-patch genunix builds merge a version of the ip module called ipctf.  This
77# is to ensure that the common network-related types are included in genunix and
78# can thus be uniquified out of other modules.  We don't want to do this for
79# patch builds, since we can't guarantee that ip and genunix will be in the same
80# patch.
81#
82IPCTF_TARGET	= $(IPCTF)
83$(PATCH_BUILD)IPCTF_TARGET =
84
85CPPFLAGS	+= -I$(SRC)/common
86
87#
88#	Default build targets.
89#
90.KEEP_STATE:
91
92.PARALLEL:	$(LIBSTUBS)
93
94def:		$(DEF_DEPS)
95
96all:		$(ALL_DEPS)
97
98clean:		$(CLEAN_DEPS)
99
100clobber:	$(CLOBBER_DEPS)
101
102lint:		$(LINT_DEPS)
103
104modlintlib:	$(MODLINTLIB_DEPS)
105
106clean.lint:	$(CLEAN_LINT_DEPS)
107
108install:	$(INSTALL_DEPS)
109
110$(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
111	$(LD) -o $@ -G -h $(SONAME) $(GENUNIX) $(LIBSTUBS)
112
113$(IPCTF_TARGET) ipctf_target: FRC
114	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
115	@pwd
116
117$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
118	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
119	$(CTFMERGE_GENUNIX_MERGE)
120	$(POST_PROCESS)
121
122#
123#	Include common targets.
124#
125include $(UTSBASE)/intel/Makefile.targ
126
127#
128#	Software workarounds for hardware "features".
129#
130include	$(UTSBASE)/i86pc/Makefile.workarounds
131
132ALL_DEFS += $(WORKAROUND_DEFS)
133
134#
135# Override.
136#
137$(MODULE).lint := GEN_LINT_LIB =
138