OSDN Git Service

v21
[android-x86/external-wireless-tools.git] / wireless_tools / Makefile
1 #
2 # Basic and crude Makefile...
3 #
4
5 # Targets to build
6 PROGS= iwconfig iwlist iwpriv iwspy iwgetid
7
8 # Installation directory. By default, go in local.
9 # Distributions should probably use /usr/sbin, but they probably know better...
10 INSTALL_DIR= /usr/local/sbin
11
12 # This is our header selection. Try to hide the mess and the misery :-(
13 # Please choose *only one* of the define...
14
15 # Kernel headers 2.4.X + Glibc 2.2 - Mandrake 8.0 */
16 #HEADERS= -DGLIBC22_HEADERS
17
18 # Kernel headers 2.0.X + Glibc 2.0 - Debian 2.0, RH 5
19 # Kernel headers 2.2.X + Glibc 2.1 - Debian 2.2, RH 6.1
20 # Kernel headers 2.4.X + Glibc 2.1 - Debian 2.2 upgraded, RH 7.0
21 HEADERS= -DGLIBC_HEADERS
22
23 # Kernel headers 2.2.X + Glibc 2.0 - Debian 2.1
24 #HEADERS= -DKLUDGE_HEADERS
25
26 # Kernel headers 2.0.X + libc5 - old systems
27 #HEADERS= -DLIBC5_HEADERS
28
29 # Use private copy of Wireless Extension definition instead of the
30 # system wide one in /usr/include/linux. Use with care.
31 # Can be used to create multiple versions of the tools on the same system
32 # for multiple kernels or get around broken distributions.
33 #WE_HEADER= -DPRIVATE_WE_HEADER
34 WE_HEADER=
35
36 # ------------ End of config --------------
37
38 CC = gcc
39 RM = rm -f
40
41 RM_CMD = $(RM) *.BAK *.bak *.o ,* *~ *.a
42
43 CFLAGS=-O2 -Wall $(HEADERS) $(WE_HEADER)
44
45 LIBS=-lm
46
47 all:: $(PROGS)
48
49 .c.o:
50         $(CC) $(CFLAGS) -c $<
51
52 iwconfig: iwconfig.o iwcommon.o
53         $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
54
55 iwlist: iwlist.o iwcommon.o
56         $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
57
58 iwpriv: iwpriv.o iwcommon.o
59         $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
60
61 iwspy: iwspy.o iwcommon.o
62         $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
63
64 iwgetid: iwgetid.o
65         $(CC) $(CFLAGS) -o $@ $^
66
67 # So crude but so effective ;-)
68 install::
69         cp $(PROGS) $(INSTALL_DIR)
70
71 clean::
72         $(RM_CMD) 
73
74 realclean::
75         $(RM_CMD) 
76         $(RM) $(PROGS)
77
78 depend::
79         makedepend -s "# DO NOT DELETE" -- $(INCLUDES) -- $(SRCS)
80 # DO NOT DELETE