xref: /titanic_51/usr/src/uts/sparc/Makefile.sparc (revision 412db4e993a383395d7ff1add4bb97f97ca3d433)
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# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright (c) 2013 Andrew Stormont.  All rights reserved.
24# Copyright (c) 2015, Joyent, Inc. All rights reserved.
25# Copyright 2015 Nexenta Systems, Inc. All rights reserved.
26# Copyright 2016 Gary Mills
27
28
29#
30#	This makefile contains the common definitions for all sparc
31#	implementation architecture independent modules.
32#
33
34#
35#	Define supported builds
36#
37DEF_BUILDS	= $(DEF_BUILDS64)
38ALL_BUILDS	= $(ALL_BUILDS64)
39
40#
41#	Everybody needs to know how to build modstubs.o and to locate unix.o.
42#	Note that unix.o must currently be selected from among the possible
43#	"implementation architectures". Note further, that unix.o is only
44#	used as an optional error check for undefines so (theoretically)
45#	any "implementation architectures" could be used. We choose sun4u
46#	because it is the reference port.
47#
48UNIX_DIR	 = $(UTSBASE)/sun4u/unix
49GENLIB_DIR	 = $(UTSBASE)/sun4u/genunix
50IPDRV_DIR	 = $(UTSBASE)/sparc/ip
51MODSTUBS_DIR	 = $(UNIX_DIR)
52DSF_DIR		 = $(UNIX_DIR)
53LINTS_DIR	 = $(OBJS_DIR)
54LINT_LIB_DIR	 = $(UTSBASE)/sparc/lint-libs/$(OBJS_DIR)
55
56UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
57MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
58GENLIB		 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/libgenunix.so
59
60LINT_LIB_32	 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lunix.ln
61GEN_LINT_LIB_32	 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lgenunix.ln
62
63LINT_LIB_64	 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lunix.ln
64GEN_LINT_LIB_64	 = $(UTSBASE)/sun4u/lint-libs/$(OBJS_DIR)/llib-lgenunix.ln
65
66LINT_LIB	 = $(LINT_LIB_$(CLASS))
67GEN_LINT_LIB	 = $(GEN_LINT_LIB_$(CLASS))
68
69LINT32_DIRS	 = $(LINT32_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%)
70LINT32_FILES	 = $(LINT32_DIRS:%=%/llib-l$(MODULE).ln)
71
72LINT64_DIRS	 = $(LINT64_BUILDS:%=$(UTSBASE)/sparc/lint-libs/%)
73LINT64_FILES	 = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln)
74
75#
76#	Include the makefiles which define build rule templates, the
77#	collection of files per module, and a few specific flags. Note
78#	that order is significant, just as with an include path. The
79#	first build rule template which matches the files name will be
80#	used. By including these in order from most machine dependent
81#	to most machine independent, we allow a machine dependent file
82#	to be used in preference over a machine independent version
83#	(Such as a machine specific optimization, which preserves the
84#	interfaces.)
85#
86include $(UTSBASE)/sparc/Makefile.files
87include $(UTSBASE)/sparc/v9/Makefile.files
88include $(UTSBASE)/sun/Makefile.files
89include $(UTSBASE)/common/Makefile.files
90
91#
92# ----- TRANSITIONAL SECTION --------------------------------------------------
93#
94
95#
96#	Not everything which *should* be a module is a module yet. The
97#	following is a list of such objects which are currently part of
98#	genunix but which might someday become kmods.   This must be
99#	defined before we include Makefile.uts, or else genunix's build
100#	won't be as parallel as we might like.
101#
102NOT_YET_KMODS	 = $(OLDPTY_OBJS) $(PTY_OBJS) $(VCONS_CONF_OBJS) $(MOD_OBJS)
103
104#
105# ----- END OF TRANSITIONAL SECTION -------------------------------------------
106#
107#	Include machine independent rules. Note that this does not imply
108#	that the resulting module from rules in Makefile.uts is	machine
109#	independent. Only that the build rules are machine independent.
110#
111include $(UTSBASE)/Makefile.uts
112
113#
114#	machine specific optimization, override default in Makefile.master
115#
116XARCH_32	= -xarch=v8
117XARCH_64	= -m64
118XARCH		= $(XARCH_$(CLASS))
119
120COPTIMIZE_32	= -xO3
121COPTIMIZE_64	= -xO3
122COPTIMIZE	= $(COPTIMIZE_$(CLASS))
123
124CCMODE		= -Xa
125
126CFLAGS_32	= -xcg92
127CFLAGS_64	= -xchip=ultra $(CCABS32) $(CCREGSYM)
128CFLAGS		= $(CFLAGS_$(CLASS))
129
130CFLAGS		+= $(XARCH)
131CFLAGS		+= $(COPTIMIZE)
132CFLAGS		+= $(EXTRA_CFLAGS)
133CFLAGS		+= $(XAOPT)
134CFLAGS		+= $(INLINES) -D_ASM_INLINES
135CFLAGS		+= $(CCMODE)
136CFLAGS		+= $(SPACEFLAG)
137CFLAGS		+= $(CERRWARN)
138CFLAGS		+= $(CTF_FLAGS_$(CLASS))
139CFLAGS		+= $(C99MODE)
140CFLAGS		+= $(CCUNBOUND)
141CFLAGS		+= $(CCSTATICSYM)
142CFLAGS		+= $(CC32BITCALLERS)
143CFLAGS		+= $(CCNOAUTOINLINE)
144CFLAGS		+= $(IROPTFLAG)
145CFLAGS		+= $(CGLOBALSTATIC)
146CFLAGS		+= -xregs=no%float
147CFLAGS		+= -xstrconst
148CFLAGS		+= $(CSOURCEDEBUGFLAGS)
149CFLAGS		+= $(CUSERFLAGS)
150
151ASFLAGS		+= $(XARCH)
152
153LINT_DEFS_32	=
154LINT_DEFS_64	= -m64
155LINT_DEFS	+= $(LINT_DEFS_$(CLASS))
156
157#
158#	The following must be defined for all implementations:
159#
160#	MODSTUBS:	Module stubs source file.
161#
162MODSTUBS	 = $(UTSBASE)/sparc/ml/modstubs.s
163
164#
165#	Define the actual specific platforms - obviously none.
166#
167MACHINE_DEFS	 =
168
169#
170#	Debugging level
171#
172#	Special knowledge of which special debugging options effect which
173#	file is used to optimize the build if these flags are changed.
174#
175#	XXX: The above could possibly be done for more flags and files, but
176#	     is left as an experiment to the interested reader. Be forewarned,
177#	     that excessive use could lead to maintenance difficulties.
178#
179DEBUG_DEFS_OBJ32	=
180DEBUG_DEFS_DBG32	= -DDEBUG
181DEBUG_DEFS_OBJ64	=
182DEBUG_DEFS_DBG64	= -DDEBUG
183DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
184
185DEBUG_COND_OBJ32	= $(POUND_SIGN)
186DEBUG_COND_DBG32	=
187DEBUG_COND_OBJ64	= $(POUND_SIGN)
188DEBUG_COND_DBG64	=
189IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
190
191$(IF_DEBUG_OBJ)syscall.o	:=	DEBUG_DEFS	+= -DSYSCALLTRACE
192$(IF_DEBUG_OBJ)clock.o		:=	DEBUG_DEFS	+= -DKSLICE=1
193
194# Comment these out if you don't want dispatcher lock statistics.
195
196# $(IF_DEBUG_OBJ)disp_lock.o	:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
197
198#
199#	Collect the preprocessor definitions to be associated with *all*
200#	files.
201#
202ALL_DEFS	 = $(MACHINE_DEFS) $(DEBUG_DEFS) $(OPTION_DEFS)
203#
204#
205#	The kernels modules which are "implementation architecture"
206#	specific for this machine are enumerated below. Note that most
207#	of these modules must exist (in one form or another) for each
208#	architecture.
209#
210#	Common Drivers (usually pseudo drivers) (/kernel/drv):
211#
212DRV_KMODS	+= aggr arp audio bl blkdev bofi clone cn conskbd consms cpuid
213DRV_KMODS	+= crypto cryptoadm devinfo dump
214DRV_KMODS	+= dtrace fasttrap fbt lockstat profile sdt systrace dcpc
215DRV_KMODS	+= fssnap icmp icmp6 ip ip6 ipnet ipsecah
216DRV_KMODS	+= ipsecesp iptun iwscn keysock kmdb kstat ksyms llc1
217DRV_KMODS	+= lofi
218DRV_KMODS	+= log logindmux kssl mm nca physmem pm poll pool
219DRV_KMODS	+= pseudo ptc ptm pts ptsl ramdisk random rsm rts sad
220DRV_KMODS	+= simnet softmac sppp sppptun sy sysevent sysmsg
221DRV_KMODS	+= spdsock
222DRV_KMODS	+= tcp tcp6 timerfd tl tnf ttymux udp udp6 wc winlock zcons
223DRV_KMODS	+= ippctl
224DRV_KMODS	+= dld
225DRV_KMODS	+= ipd
226DRV_KMODS	+= ipf
227DRV_KMODS	+= rpcib
228DRV_KMODS	+= dlpistub
229DRV_KMODS	+= vnic
230DRV_KMODS	+= xge
231DRV_KMODS	+= rds
232DRV_KMODS	+= rdsv3
233DRV_KMODS	+= chxge
234DRV_KMODS	+= smbsrv
235DRV_KMODS	+= vscan
236DRV_KMODS	+= nsmb
237DRV_KMODS	+= fm
238DRV_KMODS	+= nulldriver
239DRV_KMODS	+= bridge trill
240DRV_KMODS	+= bpf
241DRV_KMODS	+= dca
242DRV_KMODS	+= eventfd
243DRV_KMODS	+= signalfd
244
245#
246#       Hardware Drivers in common space
247#
248
249DRV_KMODS	+= afe
250DRV_KMODS	+= audio1575
251DRV_KMODS	+= audioens
252DRV_KMODS	+= audiols
253DRV_KMODS	+= audiop16x
254DRV_KMODS	+= audiopci
255DRV_KMODS	+= audiots
256DRV_KMODS	+= bnxe
257DRV_KMODS	+= e1000g
258DRV_KMODS	+= efe
259DRV_KMODS	+= hxge
260DRV_KMODS	+= mxfe
261DRV_KMODS	+= rge
262DRV_KMODS	+= rtls
263DRV_KMODS	+= sfe
264DRV_KMODS	+= aac
265DRV_KMODS	+= igb
266DRV_KMODS	+= ixgbe
267DRV_KMODS	+= vr
268DRV_KMODS	+= mr_sas
269DRV_KMODS	+= yge
270
271#
272#	Machine Specific Driver Modules (/kernel/drv):
273#
274DRV_KMODS	+= audiocs
275DRV_KMODS	+= bge dmfe eri fas hme qfe
276DRV_KMODS	+= openeepr options sd ses st
277DRV_KMODS	+= ssd
278DRV_KMODS	+= ecpp
279DRV_KMODS	+= hid hubd ehci ohci uhci usb_mid usb_ia scsa2usb usbprn ugen
280DRV_KMODS	+= usbser usbsacm usbsksp usbsprl
281DRV_KMODS	+= usb_as usb_ac
282DRV_KMODS	+= usbskel
283DRV_KMODS	+= usbvc
284DRV_KMODS	+= usbftdi
285DRV_KMODS	+= usbecm
286DRV_KMODS	+= hci1394 av1394 scsa1394 dcam1394
287DRV_KMODS	+= sbp2
288DRV_KMODS	+= ib ibp eibnx eoib rdsib sdp iser daplt hermon tavor sol_ucma sol_uverbs
289DRV_KMODS	+= sol_umad
290DRV_KMODS	+= pci_pci pcieb pcieb_bcm
291DRV_KMODS	+= i8042 kb8042 mouse8042
292DRV_KMODS	+= fcode
293DRV_KMODS	+= mpt_sas
294DRV_KMODS	+= socal
295DRV_KMODS	+= sgen
296DRV_KMODS	+= myri10ge
297DRV_KMODS	+= smp
298DRV_KMODS	+= dad
299DRV_KMODS	+= scsi_vhci
300DRV_KMODS	+= fcp
301DRV_KMODS	+= fcip
302DRV_KMODS	+= fcsm
303DRV_KMODS	+= fp
304DRV_KMODS	+= qlc
305DRV_KMODS	+= qlge
306DRV_KMODS	+= stmf
307DRV_KMODS	+= stmf_sbd
308DRV_KMODS	+= fct
309DRV_KMODS	+= fcoe
310DRV_KMODS	+= fcoet
311DRV_KMODS	+= fcoei
312DRV_KMODS	+= qlt
313DRV_KMODS	+= iscsit
314DRV_KMODS	+= pppt
315DRV_KMODS	+= ncall nsctl sdbc nskern sv
316DRV_KMODS	+= ii rdc rdcsrv rdcstub
317DRV_KMODS	+= iscsi
318DRV_KMODS	+= emlxs
319DRV_KMODS	+= oce
320DRV_KMODS	+= srpt
321DRV_KMODS	+= pmcs
322DRV_KMODS	+= pmcs8001fw
323
324#
325#	I/O framework test drivers
326#
327DRV_KMODS	+= pshot
328DRV_KMODS	+= gen_drv
329DRV_KMODS	+= tvhci tphci tclient
330DRV_KMODS	+= emul64
331
332#
333# PCMCIA specific module(s)
334#
335DRV_KMODS	+= pcs
336MISC_KMODS	+= busra cardbus dada pcmcia
337DRV_KMODS	+= pcic
338
339# Add lvm
340#
341DRV_KMODS       += md
342MISC_KMODS      += md_mirror md_stripe md_hotspares md_raid md_trans md_notify
343MISC_KMODS      += md_sp
344
345#
346#	Exec Class Modules (/kernel/exec):
347#
348EXEC_KMODS	+= aoutexec elfexec intpexec shbinexec javaexec
349
350#
351#	Scheduling Class Modules (/kernel/sched):
352#
353SCHED_KMODS	+= RT TS RT_DPTBL TS_DPTBL IA FSS FX FX_DPTBL SDC
354
355#
356#	File System Modules (/kernel/fs):
357#
358FS_KMODS	+= dev devfs fdfs fifofs hsfs lofs namefs nfs pcfs tmpfs zfs
359FS_KMODS	+= zut specfs udfs ufs autofs procfs sockfs mntfs
360FS_KMODS	+= ctfs objfs sharefs dcfs smbfs bootfs
361
362#
363#	Streams Modules (/kernel/strmod):
364#
365STRMOD_KMODS	+= bufmod connld dedump ldterm ms pckt pfmod
366STRMOD_KMODS	+= pipemod ptem redirmod rpcmod rlmod telmod timod
367STRMOD_KMODS	+= spppasyn spppcomp
368STRMOD_KMODS	+= tirdwr ttcompat
369STRMOD_KMODS	+= usbkbm usbms usbwcm usb_ah
370STRMOD_KMODS	+= drcompat
371STRMOD_KMODS	+= cryptmod
372STRMOD_KMODS	+= vuid3ps2
373
374#
375#	'System' Modules (/kernel/sys):
376#
377SYS_KMODS	+= c2audit
378SYS_KMODS	+= exacctsys
379SYS_KMODS	+= inst_sync kaio msgsys semsys shmsys sysacct pipe
380SYS_KMODS	+= doorfs pset acctctl portfs
381
382#
383#	'User' Modules (/kernel/misc):
384#
385MISC_KMODS	+= ac97
386MISC_KMODS	+= bignum
387MISC_KMODS	+= consconfig gld ipc nfs_dlboot nfssrv scsi
388MISC_KMODS	+= strplumb swapgeneric tlimod
389MISC_KMODS	+= rpcsec rpcsec_gss kgssapi kmech_dummy
390MISC_KMODS	+= kmech_krb5
391MISC_KMODS	+= fssnap_if
392MISC_KMODS	+= hidparser kbtrans usba usba10 usbs49_fw
393MISC_KMODS	+= s1394
394MISC_KMODS	+= hpcsvc pcihp
395MISC_KMODS	+= rsmops
396MISC_KMODS	+= kcf
397MISC_KMODS	+= ksocket
398MISC_KMODS	+= ibcm
399MISC_KMODS	+= ibdm
400MISC_KMODS	+= ibdma
401MISC_KMODS	+= ibmf
402MISC_KMODS	+= ibtl
403MISC_KMODS	+= sol_ofs
404MISC_KMODS	+= idm
405MISC_KMODS	+= idmap
406MISC_KMODS	+= hook
407MISC_KMODS	+= neti
408MISC_KMODS	+= ctf
409MISC_KMODS	+= mac dls
410MISC_KMODS	+= cmlb
411MISC_KMODS	+= tem
412MISC_KMODS	+= pcicfg fcodem fcpci
413MISC_KMODS	+= scsi_vhci_f_sym scsi_vhci_f_tpgs scsi_vhci_f_asym_sun
414MISC_KMODS	+= scsi_vhci_f_sym_hds
415MISC_KMODS	+= scsi_vhci_f_tape scsi_vhci_f_tpgs_tape
416MISC_KMODS	+= fctl
417MISC_KMODS	+= emlxs_fw
418MISC_KMODS	+= qlc_fw_2200
419MISC_KMODS	+= qlc_fw_2300
420MISC_KMODS	+= qlc_fw_2400
421MISC_KMODS	+= qlc_fw_2500
422MISC_KMODS	+= qlc_fw_6322
423MISC_KMODS	+= qlc_fw_8100
424MISC_KMODS	+= spuni
425MISC_KMODS	+= mii
426
427MISC_KMODS	+= klmmod klmops
428
429#
430#	Software Cryptographic Providers (/kernel/crypto):
431#
432CRYPTO_KMODS	+= aes
433CRYPTO_KMODS	+= arcfour
434CRYPTO_KMODS	+= blowfish
435CRYPTO_KMODS	+= des
436CRYPTO_KMODS	+= ecc
437CRYPTO_KMODS	+= edonr
438CRYPTO_KMODS	+= md4
439CRYPTO_KMODS	+= md5
440CRYPTO_KMODS	+= rsa
441CRYPTO_KMODS	+= sha1
442CRYPTO_KMODS	+= sha2
443CRYPTO_KMODS	+= skein
444CRYPTO_KMODS	+= swrand
445
446#
447# IP Policy Modules (/kernel/ipp):
448#
449IPP_KMODS	+= dlcosmk
450IPP_KMODS	+= flowacct
451IPP_KMODS	+= ipgpc
452IPP_KMODS	+= dscpmk
453IPP_KMODS	+= tokenmt
454IPP_KMODS	+= tswtclmt
455
456#
457# 'Dacf' modules (/kernel/dacf)
458DACF_KMODS	+= consconfig_dacf
459
460#
461#	SVVS Testing Modules (/kernel/strmod):
462#
463#	These are streams and driver modules which are not to be
464#	delivered with a released system. However, during development
465#	it is convenient to build and install the SVVS kernel modules.
466#
467SVVS_KMODS	+= lmodb lmode lmodr lmodt svvslo tidg tivc tmux
468
469#
470#	Modules eXcluded from the product:
471#
472XMODS		+=
473
474#
475#	'Dacf' Modules (/kernel/dacf):
476#
477DACF_KMODS	+= net_dacf
478
479#
480#	MAC-Type Plugin Modules (/kernel/mac)
481#
482MAC_KMODS	+= mac_6to4
483MAC_KMODS	+= mac_ether
484MAC_KMODS	+= mac_ipv4
485MAC_KMODS	+= mac_ipv6
486MAC_KMODS	+= mac_wifi
487MAC_KMODS	+= mac_ib
488
489#
490# socketmod (kernel/socketmod)
491#
492SOCKET_KMODS	+= sockpfp
493SOCKET_KMODS	+= socksctp
494SOCKET_KMODS	+= socksdp
495SOCKET_KMODS	+= sockrds
496SOCKET_KMODS	+= ksslf
497
498#
499#	kiconv modules (/kernel/kiconv):
500#
501KICONV_KMODS	+= kiconv_emea kiconv_ja kiconv_ko kiconv_sc kiconv_tc
502
503#
504# Ensure that the variable member of the cpu_t (cpu_m) is defined
505# for the lint builds so as not to cause lint errors during the
506# global cross check.
507#
508$(LINTFLAGSUPPRESS)LINTFLAGS	+= -D_MACHDEP -I$(UTSBASE)/sun4 \
509				   -I$(UTSBASE)/sun4u -I$(UTSBASE)/sfmmu
510