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