xref: /illumos-gate/usr/src/uts/intel/ath/Makefile (revision 82d0151a507442720a3aea34c8925041894ab173)
17a1306a7Sxc151355#
27a1306a7Sxc151355# CDDL HEADER START
37a1306a7Sxc151355#
47a1306a7Sxc151355# 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.
77a1306a7Sxc151355#
87a1306a7Sxc151355# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97a1306a7Sxc151355# or http://www.opensolaris.org/os/licensing.
107a1306a7Sxc151355# See the License for the specific language governing permissions
117a1306a7Sxc151355# and limitations under the License.
127a1306a7Sxc151355#
137a1306a7Sxc151355# When distributing Covered Code, include this CDDL HEADER in each
147a1306a7Sxc151355# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157a1306a7Sxc151355# If applicable, add the following below this CDDL HEADER, with the
167a1306a7Sxc151355# fields enclosed by brackets "[]" replaced with your own identifying
177a1306a7Sxc151355# information: Portions Copyright [yyyy] [name of copyright owner]
187a1306a7Sxc151355#
197a1306a7Sxc151355# CDDL HEADER END
207a1306a7Sxc151355#
217a1306a7Sxc151355#
22d444b03eSAli Bahrami# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
237a1306a7Sxc151355# Use is subject to license terms.
247a1306a7Sxc151355#
25b6b206fcSJohn Levon# Copyright (c) 2018, Joyent, Inc.
267a1306a7Sxc151355
277a1306a7Sxc151355#
287a1306a7Sxc151355#	This file makes the atheros driver for an intel system
297a1306a7Sxc151355#
307a1306a7Sxc151355#	intel architecture dependent
317a1306a7Sxc151355#
327a1306a7Sxc151355
337a1306a7Sxc151355#
347a1306a7Sxc151355#	Path to the base of the uts directory tree (usually /usr/src/uts).
357a1306a7Sxc151355#
367a1306a7Sxc151355UTSBASE	= ../..
377a1306a7Sxc151355#
387a1306a7Sxc151355#	Define the module and object file sets.
397a1306a7Sxc151355#
407a1306a7Sxc151355MODULE		= ath
417a1306a7Sxc151355OBJECTS		= $(ATH_OBJS:%=$(OBJS_DIR)/%) $(OBJS_DIR)/hal.o
427a1306a7Sxc151355
437a1306a7Sxc151355ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
447a1306a7Sxc151355
457a1306a7Sxc151355#
467a1306a7Sxc151355#	Include common rules.
477a1306a7Sxc151355#
487a1306a7Sxc151355include $(UTSBASE)/intel/Makefile.intel
497a1306a7Sxc151355
507a1306a7Sxc151355#
517a1306a7Sxc151355#	Define targets
527a1306a7Sxc151355#
537a1306a7Sxc151355ALL_TARGET	= $(BINARY)
547a1306a7Sxc151355INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
557a1306a7Sxc151355
567a1306a7Sxc151355#
570ba2cbe9Sxc151355#	Driver depends on GLDv3 & wifi kernel support module.
587a1306a7Sxc151355#
59*82d0151aSRichard LoweLDFLAGS		+= -Nmisc/mac -Nmisc/net80211
607a1306a7Sxc151355
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
687a1306a7Sxc151355#
697a1306a7Sxc151355#	Default build targets.
707a1306a7Sxc151355#
717a1306a7Sxc151355.KEEP_STATE:
727a1306a7Sxc151355
737a1306a7Sxc151355def:		$(DEF_DEPS)
747a1306a7Sxc151355
757a1306a7Sxc151355all:		$(ALL_DEPS)
767a1306a7Sxc151355
777a1306a7Sxc151355clean:		$(CLEAN_DEPS)
787a1306a7Sxc151355
797a1306a7Sxc151355clobber:	$(CLOBBER_DEPS)
807a1306a7Sxc151355
817a1306a7Sxc151355install:	$(INSTALL_DEPS)
827a1306a7Sxc151355
837a1306a7Sxc151355#
847a1306a7Sxc151355#	Include common targets.
857a1306a7Sxc151355#
867a1306a7Sxc151355include $(UTSBASE)/intel/Makefile.targ
877a1306a7Sxc151355
887a1306a7Sxc151355#
897a1306a7Sxc151355#	If you have any special case that general
907a1306a7Sxc151355#	Makefile rules don't serve for you, just do
917a1306a7Sxc151355#	it yourself.
927a1306a7Sxc151355#
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#
987a1306a7Sxc151355ATHEROS_HAL=$(UTSBASE)/common/io/ath/hal_x86_$(CLASS).o.uu
997a1306a7Sxc151355$(OBJS_DIR)/hal.o:     $(ATHEROS_HAL)
1007a1306a7Sxc151355	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