Remove struct ath_ahb_softc, it's pointless for supported kernels
[madwifi/.git] / tools / Makefile
1 #       $FreeBSD: src/tools/tools/ath/Makefile,v 1.3 2003/12/07 21:38:44 sam Exp $
2 #
3 # Copyright (c) 2002-2005       Sam Leffler, Errno Consulting
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
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.
14 #
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
25 # SUCH DAMAGE.
26 #
27 TOP = ..
28
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
32 # is used.
33 USER_CROSS_COMPILE ?= $(CROSS_COMPILE)
34 STRIP ?= $(USER_CROSS_COMPILE)strip
35 CC = $(USER_CROSS_COMPILE)gcc
36
37 BINDIR ?= /usr/local/bin
38 MANDIR ?= /usr/local/man
39
40 #
41 # Path to the HAL source code.
42 #
43 ifeq ($(HAL),)
44 HAL = $(TOP)/ath_hal
45 endif
46
47
48 PROGRAMS = athstats 80211stats athkey athchans athctrl \
49         athdebug 80211debug wlanconfig wpakey
50
51 INCS = -I. -I$(HAL) -I$(TOP)
52 CFLAGS = -g -O2 -Wall
53 ALL_CFLAGS = $(CFLAGS) $(INCS)
54 LDFLAGS =
55
56 all: $(PROGRAMS)
57
58 athstats: athstats.c
59         $(CC) -o athstats $(ALL_CFLAGS) -I$(TOP)/ath $(LDFLAGS) athstats.c
60 80211stats: 80211stats.c
61         $(CC) -o 80211stats $(ALL_CFLAGS) $(LDFLAGS) 80211stats.c
62 athkey: athkey.c
63         $(CC) -o athkey $(ALL_CFLAGS) $(LDFLAGS) athkey.c
64 athchans: athchans.c
65         $(CC) -o athchans $(ALL_CFLAGS) $(LDFLAGS) athchans.c
66 athctrl: athctrl.c
67         $(CC) -o athctrl $(ALL_CFLAGS) $(LDFLAGS) athctrl.c
68 athdebug: athdebug.c
69         $(CC) -o athdebug $(ALL_CFLAGS) $(LDFLAGS) athdebug.c
70 wlanconfig: wlanconfig.c
71         $(CC) -o wlanconfig $(ALL_CFLAGS) $(LDFLAGS) wlanconfig.c
72 80211debug: 80211debug.c
73         $(CC) -o 80211debug $(ALL_CFLAGS) $(LDFLAGS) 80211debug.c
74 wpakey: wpakey.c
75         $(CC) -o wpakey $(ALL_CFLAGS) $(LDFLAGS) wpakey.c
76
77 install: all
78         install -d $(DESTDIR)$(BINDIR)
79         for i in $(PROGRAMS); do \
80                 install $$i $(DESTDIR)$(BINDIR)/$$i; \
81                 $(STRIP) $(DESTDIR)$(BINDIR)/$$i; \
82         done
83         install -d $(DESTDIR)$(MANDIR)/man8
84         install -m 0644 man/*.8 $(DESTDIR)$(MANDIR)/man8
85         install $(TOP)/scripts/madwifi-unload $(DESTDIR)$(BINDIR)/madwifi-unload
86
87 uninstall:
88         for i in $(PROGRAMS); do \
89                 rm -f $(DESTDIR)$(BINDIR)/$$i; \
90         done
91         for i in $(PROGRAMS:=.8); do \
92                 rm -f $(DESTDIR)$(MANDIR)/man8/$$i; \
93         done
94
95 clean:
96         rm -f $(PROGRAMS) core a.out
97
98 .PHONY: all clean install uninstall