1 # $FreeBSD: src/tools/tools/ath/Makefile,v 1.3 2003/12/07 21:38:44 sam Exp $
3 # Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 # USER_CROSS_COMPILE is a string that is prepended to all toolchain
30 # executables, such as gcc, ld, as, objcopy etc. This is used for
31 # cross-compiling userspace binaries. If not defined, CROSS_COMPILE
33 USER_CROSS_COMPILE ?= $(CROSS_COMPILE)
34 STRIP ?= $(USER_CROSS_COMPILE)strip
35 CC = $(USER_CROSS_COMPILE)gcc
37 BINDIR ?= /usr/local/bin
38 MANDIR ?= /usr/local/man
40 ATH_HAL = $(TOP)/ath_hal
43 # Path to the HAL source code.
50 ALL= athstats 80211stats athkey athchans athctrl \
51 athdebug 80211debug wlanconfig ath_info
55 INCS= -I. -I$(HAL) -I$(TOP) -I$(ATH_HAL)
57 ALL_CFLAGS= $(CFLAGS) $(INCS)
63 $(CC) -o athstats $(ALL_CFLAGS) -I$(TOP)/ath $(LDFLAGS) athstats.c
64 80211stats: 80211stats.c
65 $(CC) -o 80211stats $(ALL_CFLAGS) $(LDFLAGS) 80211stats.c
67 $(CC) -o athkey $(ALL_CFLAGS) $(LDFLAGS) athkey.c
69 $(CC) -o athchans $(ALL_CFLAGS) $(LDFLAGS) athchans.c
71 $(CC) -o athctrl $(ALL_CFLAGS) $(LDFLAGS) athctrl.c
73 $(CC) -o athdebug $(ALL_CFLAGS) $(LDFLAGS) athdebug.c
74 wlanconfig: wlanconfig.c
75 $(CC) -o wlanconfig $(ALL_CFLAGS) $(LDFLAGS) wlanconfig.c
76 80211debug: 80211debug.c
77 $(CC) -o 80211debug $(ALL_CFLAGS) $(LDFLAGS) 80211debug.c
79 $(CC) -o ath_info $(CFLAGS) ath_info.c
83 install -d $(DESTDIR)$(BINDIR)
85 install $$i $(DESTDIR)$(BINDIR)/$$i; \
86 $(STRIP) $(DESTDIR)$(BINDIR)/$$i; \
88 install -d $(DESTDIR)$(MANDIR)/man8
89 install -m 0644 man/*.8 $(DESTDIR)$(MANDIR)/man8
90 install $(TOP)/scripts/madwifi-unload $(DESTDIR)$(BINDIR)/madwifi-unload
94 rm -f $(DESTDIR)$(BINDIR)/$$i; \
96 for i in $(ALL:=.8); do \
97 rm -f $(DESTDIR)$(MANDIR)/man8/$$i; \
101 rm -f $(ALL) core a.out