2 # Basic and crude Makefile...
8 PROGS= iwconfig iwlist iwpriv iwspy iwgetid
10 # Composition of the library :
13 # Define if tools should be built using static or dynamic version of the lib
17 # Installation directory. By default, go in local.
18 # Distributions should probably use /usr/sbin, but they probably know better...
19 INSTALL_DIR= /usr/local/sbin
20 INSTALL_LIB= /usr/local/lib
21 INSTALL_INC= /usr/local/include
23 # This is our header selection. Try to hide the mess and the misery :-(
24 # Please choose *only one* of the define...
26 # Kernel headers 2.4.X + Glibc 2.2 - Mandrake 8.0, Debian 2.3, RH 7.1
27 #HEADERS= -DGLIBC22_HEADERS
29 # Kernel headers 2.0.X + Glibc 2.0 - Debian 2.0, RH 5
30 # Kernel headers 2.2.X + Glibc 2.1 - Debian 2.2, RH 6.1
31 # Kernel headers 2.4.X + Glibc 2.1 - Debian 2.2 upgraded, RH 7.0
32 HEADERS= -DGLIBC_HEADERS
34 # Kernel headers 2.2.X + Glibc 2.0 - Debian 2.1
35 #HEADERS= -DKLUDGE_HEADERS
37 # Kernel headers 2.0.X + libc5 - old systems
38 #HEADERS= -DLIBC5_HEADERS
40 # Use private copy of Wireless Extension definition instead of the
41 # system wide one in /usr/include/linux. Use with care.
42 # Can be used to create multiple versions of the tools on the same system
43 # for multiple kernels or get around broken distributions.
44 #WE_HEADER= -DPRIVATE_WE_HEADER
47 # ------------ End of config --------------
52 RM_CMD = $(RM) *.BAK *.bak *.o ,* *~ *.a
54 CFLAGS=-O2 -Wall $(HEADERS) $(WE_HEADER)
58 all:: $(STATIC) $(DYNAMIC) $(PROGS)
63 iwconfig: iwconfig.o $(OBJS)
64 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
66 iwlist: iwlist.o $(OBJS)
67 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
69 iwpriv: iwpriv.o $(OBJS)
70 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
72 iwspy: iwspy.o $(OBJS)
73 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
76 $(CC) $(CFLAGS) -o $@ $^
78 # Compilation of the dynamic library
80 $(CC) -O2 -shared -o $@ -Wl,-soname,$@ -lm -lc $^
82 # Compilation of the static library
88 # So crude but so effective ;-)
90 cp $(PROGS) $(INSTALL_DIR)
91 cp $(STATIC) $(DYNAMIC) $(INSTALL_LIB)
92 echo "Don't forget to fix you /etc/ld.so.conf and run ldconfig."
93 cp iwlib.h $(INSTALL_INC)
100 $(RM) $(STATIC) $(DYNAMIC) $(PROGS)
103 makedepend -s "# DO NOT DELETE" -- $(INCLUDES) -- $(SRCS)