Makefile.sparc.shared revision 3341:52e5b1750941
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# ----- TRANSITIONAL SECTION --------------------------------------------------
91#
92
93#
94#	Not everything which *should* be a module is a module yet. The
95#	following is a list of such objects which are currently part of
96#	genunix but which might someday become kmods.   This must be
97#	defined before we include Makefile.uts, or else genunix's build
98#	won't be as parallel as we might like.
99#
100NOT_YET_KMODS	 = $(OLDPTY_OBJS) $(PTY_OBJS) $(MOD_OBJS)
101
102#
103# ----- END OF TRANSITIONAL SECTION -------------------------------------------
104#
105#	Include machine independent rules. Note that this does not imply
106#	that the resulting module from rules in Makefile.uts is	machine
107#	independent. Only that the build rules are machine independent.
108#
109include $(UTSBASE)/Makefile.uts
110
111#
112#	machine specific optimization, override default in Makefile.master
113#
114XARCH_32	= -xarch=v8
115XARCH_64	= -xarch=v9
116XARCH		= $(XARCH_$(CLASS))
117
118COPTIMIZE_32	= -xO3
119COPTIMIZE_64	= -xO3
120COPTIMIZE	= $(COPTIMIZE_$(CLASS))
121
122CCMODE		= -Xa
123
124CFLAGS_32	= -xcg92
125CFLAGS_64	= -xchip=ultra $(CCABS32) $(CCREGSYM)
126CFLAGS		= $(CFLAGS_$(CLASS))
127
128CFLAGS		+= $(XARCH)
129CFLAGS		+= $(COPTIMIZE)
130CFLAGS		+= $(EXTRA_CFLAGS)
131CFLAGS		+= $(XAOPT)
132CFLAGS		+= $(INLINES) -D_ASM_INLINES
133CFLAGS		+= $(CCMODE)
134CFLAGS		+= $(SPACEFLAG)
135CFLAGS		+= $(CERRWARN)
136CFLAGS		+= $(CTF_FLAGS)
137CFLAGS		+= $(C99MODE)
138CFLAGS		+= $(CCUNBOUND)
139CFLAGS		+= $(CCSTATICSYM)
140CFLAGS		+= $(IROPTFLAG)
141CFLAGS		+= $(CGLOBALSTATIC)
142CFLAGS		+= -xregs=no%float
143
144ASFLAGS		+= $(XARCH)
145
146LINT_DEFS_32	=
147LINT_DEFS_64	= -Xarch=v9
148LINT_DEFS	+= $(LINT_DEFS_$(CLASS))
149
150#
151#	The following must be defined for all implementations:
152#
153#	MODSTUBS:	Module stubs source file.
154#
155MODSTUBS	 = $(UTSBASE)/sparc/ml/modstubs.s
156
157#
158#	Define the actual specific platforms - obviously none.
159#
160MACHINE_DEFS	 =
161
162#
163#	Debugging level
164#
165#	Special knowledge of which special debugging options effect which
166#	file is used to optimize the build if these flags are changed.
167#
168#	XXX: The above could possibly be done for more flags and files, but
169#	     is left as an experiment to the interested reader. Be forewarned,
170#	     that excessive use could lead to maintenance difficulties.
171#
172DEBUG_DEFS_OBJ32	=
173DEBUG_DEFS_DBG32	= -DDEBUG
174DEBUG_DEFS_OBJ64	=
175DEBUG_DEFS_DBG64	= -DDEBUG
176DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
177
178DEBUG_COND_OBJ32	:sh = echo \\043
179DEBUG_COND_DBG32	=
180DEBUG_COND_OBJ64	:sh = echo \\043
181DEBUG_COND_DBG64	=
182IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
183
184$(IF_DEBUG_OBJ)syscall.o	:=	DEBUG_DEFS	+= -DSYSCALLTRACE
185$(IF_DEBUG_OBJ)clock.o		:=	DEBUG_DEFS	+= -DKSLICE=1
186
187# Comment these out if you don't want dispatcher lock statistics.
188
189# $(IF_DEBUG_OBJ)disp_lock.o	:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
190
191#
192# This rather strange collection of definitions ensures that lint sees
193# 'struct cpu' containing a fully declared embedded 'struct machcpu'
194#
195# There's something deeply dissatisfying about this.
196#
197LINTMACHFLAGS = -D_MACHDEP -I../../sun4 -I../../$(PLATFORM) -I../../sfmmu
198$(LINTS_DIR)/kcpc.ln	:=	LINTFLAGS += $(LINTMACHFLAGS)
199$(LINTS_DIR)/kdi.ln	:=	LINTFLAGS += $(LINTMACHFLAGS)
200$(LINTS_DIR)/msacct.ln	:=	LINTFLAGS += $(LINTMACHFLAGS)
201$(LINTS_DIR)/thread.ln	:=	LINTFLAGS += $(LINTMACHFLAGS)
202
203#
204#	Build `options'. These are mostly historical and the need for these
205#	is largely removed by the module technology. However, the static
206#	build will continue to require these.
207#
208OPTION_DEFS	 = -DC2_AUDIT
209
210#
211#	Collect the preprocessor definitions to be associated with *all*
212#	files.
213#
214ALL_DEFS	 = $(MACHINE_DEFS) $(DEBUG_DEFS) $(OPTION_DEFS)
215#
216#
217#	The kernels modules which are "implementation architecture"
218#	specific for this machine are enumerated below. Note that most
219#	of these modules must exist (in one form or another) for each
220#	architecture.
221#
222#	Common Drivers (usually pseudo drivers) (/kernel/drv):
223#
224DRV_KMODS	+= aggr arp bl bofi clone cn conskbd consms cpuid
225DRV_KMODS	+= crypto cryptoadm devinfo dump
226DRV_KMODS	+= dtrace fasttrap fbt lockstat profile sdt systrace
227DRV_KMODS	+= fssnap icmp icmp6 ip ip6 ipsecah
228DRV_KMODS	+= ipsecesp iwscn keysock kmdb kstat ksyms llc1
229DRV_KMODS	+= lofi
230DRV_KMODS	+= log logindmux kssl mm nca physmem pm poll pool
231DRV_KMODS	+= pseudo ptc ptm pts ptsl ramdisk random rsm rts sad
232DRV_KMODS	+= sppp sppptun sy sysevent sysmsg 
233DRV_KMODS	+= spdsock
234DRV_KMODS	+= tcp tcp6 tl tnf ttymux udp udp6 wc winlock zcons
235DRV_KMODS	+= ippctl sctp sctp6
236DRV_KMODS	+= dld
237DRV_KMODS	+= ipf
238DRV_KMODS	+= rpcib
239DRV_KMODS	+= vni
240DRV_KMODS	+= xge
241DRV_KMODS	+= rds
242
243#
244# Don't build some of these for OpenSolaris, since they will be
245# replaced by binaries that are signed by Sun Release Engineering.
246#
247$(CLOSED_BUILD)DRV_KMODS	+= dca
248
249$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= glm
250$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= isp
251$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= llc2
252$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= mpt
253$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= se
254
255#
256#       Hardware Drivers in common space
257#
258
259DRV_KMODS	+= rge
260$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= ixgb
261
262#
263#	Machine Specific Driver Modules (/kernel/drv):
264#
265DRV_KMODS	+= audio1575 audio810 audiohd audiocs audiots
266DRV_KMODS	+= bge bpp eri esp fas hme
267DRV_KMODS	+= openeepr options sd ses st
268DRV_KMODS	+= ssd
269DRV_KMODS	+= ecpp
270DRV_KMODS	+= hid hubd ehci ohci uhci usb_mid usb_ia scsa2usb usbprn ugen
271DRV_KMODS	+= usbser usbsacm usbsksp usbsprl
272DRV_KMODS	+= usb_as usb_ac
273DRV_KMODS	+= usbskel
274DRV_KMODS	+= usbvc
275DRV_KMODS	+= hci1394 av1394 scsa1394 dcam1394
276DRV_KMODS	+= sbp2
277DRV_KMODS	+= ib ibd rdsib
278DRV_KMODS	+= pci_pci px_pci pxb_plx pxb_bcm pcie
279DRV_KMODS	+= i8042 kb8042 mouse8042
280DRV_KMODS	+= fcode
281DRV_KMODS	+= socal
282DRV_KMODS	+= sgen
283
284$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= audioens
285$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= audiovia823x
286$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= chxge
287$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= dad
288$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= ifp
289$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= scsi_vhci
290$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= uata
291$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= usbser_edge
292
293#
294#	I/O framework test drivers
295#
296DRV_KMODS	+= pshot
297DRV_KMODS	+= gen_drv
298DRV_KMODS	+= tvhci tphci tclient
299DRV_KMODS	+= emul64
300
301#
302# PCMCIA specific module(s)
303#
304DRV_KMODS	+= stp4020 pcs
305MISC_KMODS	+= busra cardbus dada pcmcia
306DRV_KMODS	+= pcata pcmem pcram
307DRV_KMODS	+= pcic
308DRV_KMODS	+= pem
309
310$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= pcelx
311$(CLOSED_BUILD)CLOSED_DRV_KMODS	+= pcser
312
313# Add lvm
314#
315DRV_KMODS       += md
316MISC_KMODS      += md_mirror md_stripe md_hotspares md_raid md_trans md_notify
317MISC_KMODS      += md_sp
318
319#
320#	Exec Class Modules (/kernel/exec):
321#
322EXEC_KMODS	+= aoutexec elfexec intpexec javaexec
323
324#
325#	Scheduling Class Modules (/kernel/sched):
326#
327SCHED_KMODS	+= RT TS RT_DPTBL TS_DPTBL IA FSS FX FX_DPTBL
328
329#
330#	File System Modules (/kernel/fs):
331#
332FS_KMODS	+= dev devfs fdfs fifofs hsfs lofs namefs nfs pcfs tmpfs zfs
333FS_KMODS	+= specfs udfs ufs autofs cachefs procfs sockfs mntfs
334FS_KMODS	+= ctfs objfs
335
336#
337#	Streams Modules (/kernel/strmod):
338#
339STRMOD_KMODS	+= 6to4tun atun bufmod connld dedump ldterm ms pckt pfmod
340STRMOD_KMODS	+= pipemod ptem redirmod rpcmod rlmod telmod timod
341STRMOD_KMODS	+= spppasyn spppcomp
342STRMOD_KMODS	+= tirdwr ttcompat tun
343STRMOD_KMODS	+= usbkbm usbms usb_ah
344STRMOD_KMODS	+= drcompat
345STRMOD_KMODS	+= nattymod
346STRMOD_KMODS	+= cryptmod
347STRMOD_KMODS	+= vuid3ps2
348
349#
350#	'System' Modules (/kernel/sys):
351#
352SYS_KMODS	+= c2audit
353SYS_KMODS	+= exacctsys
354SYS_KMODS	+= inst_sync kaio msgsys semsys shmsys sysacct pipe
355SYS_KMODS	+= doorfs pset acctctl portfs
356
357#
358#	'User' Modules (/kernel/misc):
359#
360MISC_KMODS	+= amsrc2 audiosup diaudio mixer
361MISC_KMODS	+= consconfig gld ipc nfs_dlboot nfssrv scsi
362MISC_KMODS	+= strplumb swapgeneric tlimod
363MISC_KMODS	+= krtld
364MISC_KMODS	+= rpcsec rpcsec_gss kgssapi kmech_dummy
365MISC_KMODS	+= kmech_krb5
366MISC_KMODS	+= fssnap_if
367MISC_KMODS	+= hidparser kbtrans usba usba10 usbs49_fw
368MISC_KMODS	+= s1394
369MISC_KMODS	+= hpcsvc pcihp pciehpc pcishpc
370MISC_KMODS	+= rsmops
371MISC_KMODS	+= kcf
372MISC_KMODS	+= ibcm
373MISC_KMODS	+= ibdm
374MISC_KMODS	+= ibmf
375MISC_KMODS	+= ibtl
376MISC_KMODS	+= hook
377MISC_KMODS	+= neti
378MISC_KMODS	+= ctf 
379MISC_KMODS	+= zmod
380MISC_KMODS	+= mac dls
381MISC_KMODS	+= cmlb
382MISC_KMODS	+= tem
383MISC_KMODS	+= pcicfg.e fcodem fcpci
384
385$(CLOSED_BUILD)CLOSED_MISC_KMODS	+= amsrc1
386$(CLOSED_BUILD)CLOSED_MISC_KMODS	+= klmmod klmops
387$(CLOSED_BUILD)CLOSED_MISC_KMODS	+= phx
388
389#
390#	Software Cryptographic Providers (/kernel/crypto):
391#
392# Don't build some of these for OpenSolaris, since they will be
393# replaced by binaries that are signed by Sun RE.
394#
395$(CLOSED_BUILD)CRYPTO_KMODS	+= aes
396$(CLOSED_BUILD)CRYPTO_KMODS	+= arcfour
397$(CLOSED_BUILD)CRYPTO_KMODS	+= blowfish
398$(CLOSED_BUILD)CRYPTO_KMODS	+= des
399CRYPTO_KMODS	+= md5
400CRYPTO_KMODS	+= rsa
401CRYPTO_KMODS	+= sha1
402CRYPTO_KMODS	+= sha2
403CRYPTO_KMODS	+= swrand
404
405#
406# IP Policy Modules (/kernel/ipp):
407#
408IPP_KMODS	+= dlcosmk
409IPP_KMODS	+= flowacct
410IPP_KMODS	+= ipgpc
411IPP_KMODS	+= dscpmk
412IPP_KMODS	+= tokenmt
413IPP_KMODS	+= tswtclmt
414
415#
416# 'Dacf' modules (/kernel/dacf)
417DACF_KMODS	+= consconfig_dacf
418
419#
420#	SVVS Testing Modules (/kernel/strmod):
421#
422#	These are streams and driver modules which are not to be
423#	delivered with a released system. However, during development
424#	it is convenient to build and install the SVVS kernel modules.
425#
426SVVS_KMODS	+= lmodb lmode lmodr lmodt lo tidg tivc tmux
427
428SVVS		+= svvs
429
430#
431#	Modules eXcluded from the product:
432#
433XMODS		+=
434$(CLOSED_BUILD)CLOSED_XMODS =		\
435	daplt		\
436	e1000g		\
437	tavor		\
438	wsdrv
439
440#
441#	'Dacf' Modules (/kernel/dacf):
442#
443DACF_KMODS	+= usb_ac_dacf
444
445#
446#	MAC-Type Plugin Modules (/kernel/mac)
447#
448MAC_KMODS	+= mac_ether
449
450#
451# 'Devname' Modules (kernel/devname)
452#
453DEVNAME_KMODS	+= sdev_nsconfig_mod
454