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