2 # Basic and crude Makefile...
8 PROGS= iwconfig iwlist iwpriv iwspy iwgetid
9 MANPAGES=iwconfig.8 iwlist.8 iwpriv.8 iwspy.8
11 # Composition of the library :
14 # Define if tools should be built using static or dynamic version of the lib
18 # Installation directory. By default, go in local.
19 # Distributions should probably use /usr/sbin, but they probably know better...
20 INSTALL_DIR= /usr/local/sbin/
21 INSTALL_LIB= /usr/local/lib/
22 INSTALL_INC= /usr/local/include/
23 INSTALL_MAN= /usr/local/man
25 # Header selection is now supposed to be automatic...
27 # Use private copy of Wireless Extension definition instead of the
28 # system wide one in /usr/include/linux. Use with care.
29 # Can be used to create multiple versions of the tools on the same system
30 # for multiple kernels or get around broken distributions.
31 #WE_HEADER= -DPRIVATE_WE_HEADER
34 # ------------ End of config --------------
39 RM_CMD = $(RM) *.BAK *.bak *.o ,* *~ *.a
41 CFLAGS=-O2 -Wall $(HEADERS) $(WE_HEADER)
45 all:: $(STATIC) $(DYNAMIC) $(PROGS)
50 iwconfig: iwconfig.o $(OBJS)
51 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
53 iwlist: iwlist.o $(OBJS)
54 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
56 iwpriv: iwpriv.o $(OBJS)
57 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
59 iwspy: iwspy.o $(OBJS)
60 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
63 $(CC) $(CFLAGS) -o $@ $^
65 # Compilation of the dynamic library
67 $(CC) -O2 -shared -o $@ -Wl,-soname,$@ -lm -lc $^
69 # Compilation of the static library
75 # So crude but so effective ;-)
76 # Less crude thanks to many contributions ;-)
78 install -m 755 $(PROGS) $(INSTALL_DIR)
79 install -m 644 $(STATIC) $(INSTALL_LIB)
80 install -m 755 $(DYNAMIC) $(INSTALL_LIB)
81 echo "Don't forget to fix your /etc/ld.so.conf and run ldconfig."
82 install -m 644 iwlib.h $(INSTALL_INC)
83 install -m 644 $(MANPAGES) $(INSTALL_MAN)/man8/
90 $(RM) $(STATIC) $(DYNAMIC) $(PROGS)
93 makedepend -s "# DO NOT DELETE" -- $(INCLUDES) -- $(SRCS)