Makefile.sparc revision 903:a9ef93192894
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 2005 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 contains the common definitions for all sparc
29#	implementation architecture independent modules.
30#
31
32
33#
34#	Define supported builds
35#
36DEF_BUILDS	= $(DEF_BUILDS64)
37ALL_BUILDS	= $(ALL_BUILDS64)
38
39#
40#	Everybody needs to know how to build modstubs.o and to locate unix.o.
41#	Note that unix.o must currently be selected from among the possible
42#	"implementation architectures". Note further, that unix.o is only
43#	used as an optional error check for undefines so (theoretically)
44#	any "implementation architectures" could be used. We choose sun4u
45#	because it is the reference port.
46#
47UNIX_DIR	 = $(UTSBASE)/sun4u/unix
48GENLIB_DIR	 = $(UTSBASE)/sun4u/genunix
49IPDRV_DIR	 = $(UTSBASE)/sparc/ip
50MODSTUBS_DIR	 = $(UNIX_DIR)
51DSF_DIR		 = $(UNIX_DIR)
52LINTS_DIR	 = $(OBJS_DIR)
53LINT_LIB_DIR	 = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR)
54
55UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
56MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
57GENLIB		 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/libgenunix.so
58
59LINT_LIB_32	 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lunix.ln
60GEN_LINT_LIB_32	 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lgenunix.ln
61
62LINT_LIB_64	 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lunix.ln
63GEN_LINT_LIB_64	 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lgenunix.ln
64
65LINT_LIB	 = $(LINT_LIB_$(CLASS))
66GEN_LINT_LIB	 = $(GEN_LINT_LIB_$(CLASS))
67
68LINT32_DIRS	 = $(LINT32_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%)
69LINT32_FILES	 = $(LINT32_DIRS:%=%/llib-l$(MODULE).ln)
70
71LINT64_DIRS	 = $(LINT64_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%)
72LINT64_FILES	 = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln)
73
74#
75#	Include the makefiles which define build rule templates, the
76#	collection of files per module, and a few specific flags. Note
77#	that order is significant, just as with an include path. The
78#	first build rule template which matches the files name will be
79#	used. By including these in order from most machine dependent
80#	to most machine independent, we allow a machine dependent file
81#	to be used in preference over a machine independent version
82#	(Such as a machine specific optimization, which preserves the
83#	interfaces.)
84#
85include $(UTSBASE)/sparc/Makefile.files
86include $(UTSBASE)/sparc/v9/Makefile.files
87include $(UTSBASE)/sun/Makefile.files
88include $(UTSBASE)/common/Makefile.files
89
90#
91#	Include machine independent rules. Note that this does not imply
92#	that the resulting module from rules in Makefile.uts is	machine
93#	independent. Only that the build rules are machine independent.
94#
95include $(UTSBASE)/Makefile.uts
96
97#
98#	machine specific optimization, override default in Makefile.master
99#
100XARCH_32	= -xarch=v8
101XARCH_64	= -xarch=v9
102XARCH		= $(XARCH_$(CLASS))
103
104COPTIMIZE_32	= -xO3
105COPTIMIZE_64	= -xO3
106COPTIMIZE	= $(COPTIMIZE_$(CLASS))
107
108CCMODE		= -Xa
109
110CFLAGS_32	= -xcg92
111CFLAGS_64	= -xchip=ultra $(CCABS32) $(CCREGSYM)
112CFLAGS		= $(CFLAGS_$(CLASS))
113
114CFLAGS		+= $(XARCH)
115CFLAGS		+= $(COPTIMIZE)
116CFLAGS		+= $(EXTRA_CFLAGS)
117CFLAGS		+= $(XAOPT)
118CFLAGS		+= $(INLINES) -D_ASM_INLINES
119CFLAGS		+= $(CCMODE)
120CFLAGS		+= $(SPACEFLAG)
121CFLAGS		+= $(CERRWARN)
122CFLAGS		+= $(CTF_FLAGS)
123CFLAGS		+= $(C99MODE)
124CFLAGS		+= $(CCUNBOUND)
125CFLAGS		+= -xregs=no%float
126
127ASFLAGS		+= $(XARCH)
128
129LINT_DEFS_32	=
130LINT_DEFS_64	= -Xarch=v9
131LINT_DEFS	+= $(LINT_DEFS_$(CLASS))
132
133#
134#	The following must be defined for all implementations:
135#
136#	MODSTUBS:	Module stubs source file.
137#
138MODSTUBS	 = $(UTSBASE)/sparc/ml/modstubs.s
139
140#
141#	Define the actual specific platforms - obviously none.
142#
143MACHINE_DEFS	 =
144
145#
146#	Debugging level
147#
148#	Special knowledge of which special debugging options effect which
149#	file is used to optimize the build if these flags are changed.
150#
151#	XXX: The above could possibly be done for more flags and files, but
152#	     is left as an experiment to the interested reader. Be forewarned,
153#	     that excessive use could lead to maintenance difficulties.
154#
155DEBUG_DEFS_OBJ32	=
156DEBUG_DEFS_DBG32	= -DDEBUG
157DEBUG_DEFS_OBJ64	=
158DEBUG_DEFS_DBG64	= -DDEBUG
159DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
160
161DEBUG_COND_OBJ32	:sh = echo \\043
162DEBUG_COND_DBG32	=
163DEBUG_COND_OBJ64	:sh = echo \\043
164DEBUG_COND_DBG64	=
165IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
166
167$(IF_DEBUG_OBJ)syscall.o	:=	DEBUG_DEFS	+= -DSYSCALLTRACE
168$(IF_DEBUG_OBJ)clock.o		:=	DEBUG_DEFS	+= -DKSLICE=1
169
170# Comment these out if you don't want dispatcher lock statistics.
171
172# $(IF_DEBUG_OBJ)disp_lock.o	:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
173
174#
175# This rather strange collection of definitions ensures that lint sees
176# 'struct cpu' containing a fully declared embedded 'struct machcpu'
177#
178# There's something deeply dissatisfying about this.
179#
180LINTMACHFLAGS = -D_MACHDEP -I../../sun4 -I../../$(PLATFORM) -I../../sfmmu
181$(LINTS_DIR)/kcpc.ln	:=	LINTFLAGS += $(LINTMACHFLAGS)
182$(LINTS_DIR)/kdi.ln	:=	LINTFLAGS += $(LINTMACHFLAGS)
183$(LINTS_DIR)/msacct.ln	:=	LINTFLAGS += $(LINTMACHFLAGS)
184$(LINTS_DIR)/thread.ln	:=	LINTFLAGS += $(LINTMACHFLAGS)
185
186#
187#	Build `options'. These are mostly historical and the need for these
188#	is largely removed by the module technology. However, the static
189#	build will continue to require these.
190#
191OPTION_DEFS	 = -DC2_AUDIT
192
193#
194#	Collect the preprocessor definitions to be associated with *all*
195#	files.
196#
197ALL_DEFS	 = $(MACHINE_DEFS) $(DEBUG_DEFS) $(OPTION_DEFS)
198#
199# ----- TRANSITIONAL SECTION --------------------------------------------------
200#
201
202#
203#	Not everything which *should* be a module is a module yet. The
204#	following is a list of such objects which are currently part of
205#	the base kernel but should soon become kmods.
206#
207NOT_YET_KMODS	 = $(OLDPTY_OBJS) $(PTY_OBJS) $(MOD_OBJS)
208
209#
210# ----- END OF TRANSITIONAL SECTION -------------------------------------------
211
212#
213#	The kernels modules which are "implementation architecture"
214#	specific for this machine are enumerated below. Note that most
215#	of these modules must exist (in one form or another) for each
216#	architecture.
217#
218#	Common Drivers (usually pseudo drivers) (/kernel/drv):
219#
220DRV_KMODS	+= aggr arp bl bofi clone cn conskbd consms cpuid
221DRV_KMODS	+= crypto cryptoadm devinfo dump
222DRV_KMODS	+= dtrace fasttrap fbt lockstat profile sdt systrace
223DRV_KMODS	+= fssnap glm icmp icmp6 ip ip6 ipsecah
224DRV_KMODS	+= ipsecesp isp iwscn keysock kmdb kstat ksyms llc1 llc2
225DRV_KMODS	+= lofi
226DRV_KMODS	+= log logindmux kssl mm mpt nca pm poll pool
227DRV_KMODS	+= pseudo ptc ptm pts ptsl ramdisk random rsm rts sad se 
228DRV_KMODS	+= spdsock sppp sppptun sy sysevent sysmsg 
229DRV_KMODS	+= tcp tcp6 tl tnf ttymux udp udp6 vol wc winlock zcons
230DRV_KMODS	+= ippctl sctp sctp6
231DRV_KMODS	+= dld
232DRV_KMODS	+= ipf pfil
233DRV_KMODS	+= rpcib
234DRV_KMODS	+= vni
235
236#
237#       Hardware Drivers in common space
238#
239DRV_KMODS       += ixgb
240DRV_KMODS	+= rge
241
242#
243#	Machine Specific Driver Modules (/kernel/drv):
244#
245DRV_KMODS	+= audiovia823x audio810 audiocs audioens audiots dbri
246DRV_KMODS	+= bge bpp eri esp fas hme
247DRV_KMODS	+= openeepr options sd ses sgen st
248DRV_KMODS	+= ssd socal
249DRV_KMODS	+= ecpp
250DRV_KMODS	+= uata dad ifp
251DRV_KMODS	+= hid hubd ehci ohci uhci usb_mid scsa2usb usbprn ugen
252DRV_KMODS	+= usbser usbser_edge usbsksp usbsprl
253DRV_KMODS	+= usb_as usb_ac
254DRV_KMODS	+= usbskel
255DRV_KMODS	+= hci1394 av1394 scsa1394 dcam1394
256DRV_KMODS	+= sbp2
257DRV_KMODS	+= scsi_vhci
258DRV_KMODS	+= ib ibd
259DRV_KMODS	+= xge
260DRV_KMODS	+= chxge
261DRV_KMODS	+= pci_pci px_pci pcie
262DRV_KMODS	+= i8042 kb8042 mouse8042
263
264#
265#	I/O framework test drivers
266#
267DRV_KMODS	+= pshot
268DRV_KMODS	+= gen_drv
269DRV_KMODS	+= tvhci tphci tclient
270DRV_KMODS	+= emul64
271
272#
273# PCMCIA specific module(s)
274#
275DRV_KMODS	+= pem stp4020 pcs pcic
276MISC_KMODS	+= busra dada pcmcia
277DRV_KMODS	+= pcata pcelx pcmem pcram pcser
278
279# Add lvm
280#
281DRV_KMODS       += md
282MISC_KMODS      += md_mirror md_stripe md_hotspares md_raid md_trans md_notify
283MISC_KMODS      += md_sp
284
285#
286#	Exec Class Modules (/kernel/exec):
287#
288EXEC_KMODS	+= aoutexec elfexec intpexec javaexec
289
290#
291#	Scheduling Class Modules (/kernel/sched):
292#
293SCHED_KMODS	+= RT TS RT_DPTBL TS_DPTBL IA FSS FX FX_DPTBL
294
295#
296#	File System Modules (/kernel/fs):
297#
298FS_KMODS	+= devfs fdfs fifofs hsfs lofs namefs nfs pcfs tmpfs zfs
299FS_KMODS	+= specfs udfs ufs autofs cachefs procfs sockfs mntfs
300FS_KMODS	+= ctfs objfs
301
302#
303#	Streams Modules (/kernel/strmod):
304#
305STRMOD_KMODS	+= 6to4tun atun bufmod connld dedump ldterm ms pckt pfmod
306STRMOD_KMODS	+= pipemod ptem redirmod rpcmod rlmod telmod timod
307STRMOD_KMODS	+= spppasyn spppcomp
308STRMOD_KMODS	+= tirdwr ttcompat tun
309STRMOD_KMODS	+= usbkbm usbms usb_ah
310STRMOD_KMODS	+= drcompat
311STRMOD_KMODS	+= nattymod
312STRMOD_KMODS	+= cryptmod
313STRMOD_KMODS	+= vuid3ps2
314
315#
316#	'System' Modules (/kernel/sys):
317#
318SYS_KMODS	+= c2audit
319SYS_KMODS	+= exacctsys
320SYS_KMODS	+= inst_sync kaio msgsys semsys shmsys sysacct pipe
321SYS_KMODS	+= doorfs pset acctctl portfs
322
323#
324#	'User' Modules (/kernel/misc):
325#
326MISC_KMODS	+= amsrc1 amsrc2 audiosup diaudio mixer
327MISC_KMODS	+= consconfig gld ipc nfs_dlboot nfssrv scsi
328MISC_KMODS	+= strplumb swapgeneric klmmod klmops tlimod
329MISC_KMODS	+= krtld
330MISC_KMODS	+= rpcsec rpcsec_gss kgssapi kmech_dummy
331MISC_KMODS	+= kmech_krb5
332MISC_KMODS	+= fssnap_if
333MISC_KMODS	+= hidparser kbtrans usba usba10
334MISC_KMODS	+= s1394
335MISC_KMODS	+= hpcsvc pcicfg pcihp
336MISC_KMODS	+= rsmops
337MISC_KMODS	+= phx
338MISC_KMODS	+= kcf
339MISC_KMODS	+= ibcm
340MISC_KMODS	+= ibdm
341MISC_KMODS	+= ibmf
342MISC_KMODS	+= ibtl
343MISC_KMODS	+= ctf 
344MISC_KMODS	+= zmod
345MISC_KMODS	+= mac dls
346MISC_KMODS	+= cmlb
347
348#
349#	Software Cryptographic Providers (/kernel/crypto):
350#
351CRYPTO_KMODS	+= aes
352CRYPTO_KMODS	+= arcfour
353CRYPTO_KMODS	+= blowfish
354CRYPTO_KMODS	+= des
355CRYPTO_KMODS	+= md5
356CRYPTO_KMODS	+= rsa
357CRYPTO_KMODS	+= sha1
358CRYPTO_KMODS	+= sha2
359CRYPTO_KMODS	+= swrand
360
361#
362# IP Policy Modules (/kernel/ipp):
363#
364IPP_KMODS	+= dlcosmk
365IPP_KMODS	+= flowacct
366IPP_KMODS	+= ipgpc
367IPP_KMODS	+= dscpmk
368IPP_KMODS	+= tokenmt
369IPP_KMODS	+= tswtclmt
370
371#
372# 'Dacf' modules (/kernel/dacf)
373DACF_KMODS	+= consconfig_dacf
374
375#
376#	SVVS Testing Modules (/kernel/strmod):
377#
378#	These are streams and driver modules which are not to be
379#	delivered with a released system. However, during development
380#	it is convenient to build and install the SVVS kernel modules.
381#
382SVVS_KMODS	+= lmodb lmode lmodr lmodt lo tidg tivc tmux
383
384SVVS		+= svvs
385
386#
387#	Modules eXcluded from the product:
388#
389XMODS		+= wsdrv tavor daplt e1000g
390
391#
392#	'Dacf' Modules (/kernel/dacf):
393#
394DACF_KMODS	+= usb_ac_dacf
395