xref: /illumos-gate/usr/src/uts/intel/ath/Makefile (revision 82d0151a)
17a1306a7Sxc#
27a1306a7Sxc# CDDL HEADER START
37a1306a7Sxc#
47a1306a7Sxc# The contents of this file are subject to the terms of the
5bb25c06cSjg# Common Development and Distribution License (the "License").
6bb25c06cSjg# You may not use this file except in compliance with the License.
77a1306a7Sxc#
87a1306a7Sxc# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97a1306a7Sxc# or http://www.opensolaris.org/os/licensing.
107a1306a7Sxc# See the License for the specific language governing permissions
117a1306a7Sxc# and limitations under the License.
127a1306a7Sxc#
137a1306a7Sxc# When distributing Covered Code, include this CDDL HEADER in each
147a1306a7Sxc# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157a1306a7Sxc# If applicable, add the following below this CDDL HEADER, with the
167a1306a7Sxc# fields enclosed by brackets "[]" replaced with your own identifying
177a1306a7Sxc# information: Portions Copyright [yyyy] [name of copyright owner]
187a1306a7Sxc#
197a1306a7Sxc# CDDL HEADER END
207a1306a7Sxc#
217a1306a7Sxc#
22d444b03eSAli Bahrami# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
237a1306a7Sxc# Use is subject to license terms.
247a1306a7Sxc#
25b6b206fcSJohn Levon# Copyright (c) 2018, Joyent, Inc.
267a1306a7Sxc
277a1306a7Sxc#
287a1306a7Sxc#	This file makes the atheros driver for an intel system
297a1306a7Sxc#
307a1306a7Sxc#	intel architecture dependent
317a1306a7Sxc#
327a1306a7Sxc
337a1306a7Sxc#
347a1306a7Sxc#	Path to the base of the uts directory tree (usually /usr/src/uts).
357a1306a7Sxc#
367a1306a7SxcUTSBASE	= ../..
377a1306a7Sxc#
387a1306a7Sxc#	Define the module and object file sets.
397a1306a7Sxc#
407a1306a7SxcMODULE		= ath
417a1306a7SxcOBJECTS		= $(ATH_OBJS:%=$(OBJS_DIR)/%) $(OBJS_DIR)/hal.o
427a1306a7Sxc
437a1306a7SxcROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
447a1306a7Sxc
457a1306a7Sxc#
467a1306a7Sxc#	Include common rules.
477a1306a7Sxc#
487a1306a7Sxcinclude $(UTSBASE)/intel/Makefile.intel
497a1306a7Sxc
507a1306a7Sxc#
517a1306a7Sxc#	Define targets
527a1306a7Sxc#
537a1306a7SxcALL_TARGET	= $(BINARY)
547a1306a7SxcINSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
557a1306a7Sxc
567a1306a7Sxc#
570ba2cbe9Sxc#	Driver depends on GLDv3 & wifi kernel support module.
587a1306a7Sxc#
59*82d0151aSRichard LoweLDFLAGS		+= -Nmisc/mac -Nmisc/net80211
607a1306a7Sxc
617014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-type-limits
627014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-unused-variable
637014882cSRichard LoweCERRWARN	+= -_gcc=-Wno-empty-body
647014882cSRichard Lowe
65b6b206fcSJohn Levon# needs work
66b6b206fcSJohn Levon$(OBJS_DIR)/ath_rate.o := SMOFF += index_overflow
67b6b206fcSJohn Levon
687a1306a7Sxc#
697a1306a7Sxc#	Default build targets.
707a1306a7Sxc#
717a1306a7Sxc.KEEP_STATE:
727a1306a7Sxc
737a1306a7Sxcdef:		$(DEF_DEPS)
747a1306a7Sxc
757a1306a7Sxcall:		$(ALL_DEPS)
767a1306a7Sxc
777a1306a7Sxcclean:		$(CLEAN_DEPS)
787a1306a7Sxc
797a1306a7Sxcclobber:	$(CLOBBER_DEPS)
807a1306a7Sxc
817a1306a7Sxcinstall:	$(INSTALL_DEPS)
827a1306a7Sxc
837a1306a7Sxc#
847a1306a7Sxc#	Include common targets.
857a1306a7Sxc#
867a1306a7Sxcinclude $(UTSBASE)/intel/Makefile.targ
877a1306a7Sxc
887a1306a7Sxc#
897a1306a7Sxc#	If you have any special case that general
907a1306a7Sxc#	Makefile rules don't serve for you, just do
917a1306a7Sxc#	it yourself.
927a1306a7Sxc#
93d444b03eSAli Bahrami#	The amd64 version of this object has the .eh_frame section tagged
94d444b03eSAli Bahrami#	as SHT_PROGBITS, while the ABI requires SHT_AMD64_UNWIND. The Solaris
95d444b03eSAli Bahrami#	ld enforces this, so use elfedit to bring the object in line with
96d444b03eSAli Bahrami#	this requirement.
97d444b03eSAli Bahrami#
987a1306a7SxcATHEROS_HAL=$(UTSBASE)/common/io/ath/hal_x86_$(CLASS).o.uu
997a1306a7Sxc$(OBJS_DIR)/hal.o:     $(ATHEROS_HAL)
1007a1306a7Sxc	uudecode -o $@ $(ATHEROS_HAL)
101d444b03eSAli Bahrami	if [ `elfedit -r -e 'ehdr:e_machine' $@` = EM_AMD64 ]; \
102d444b03eSAli Bahrami		then elfedit -e 'shdr:sh_type .eh_frame SHT_AMD64_UNWIND' $@; fi
103