2 # Basic and crude Makefile...
8 PROGS= iwconfig iwlist iwpriv iwspy iwgetid iwevent
9 MANPAGES=iwconfig.8 iwlist.8 iwpriv.8 iwspy.8 iwgetid.8 iwevent.8
11 # Composition of the library :
14 # Define if tools should be built using static or dynamic version of the lib
18 # Standard name for dynamic library so that the dynamic linker can pick it.
19 # We will just create a symbolic link to the real thing.
20 DYNAMIC_LINK= libiw.so
22 # Installation directory. By default, go in local.
23 # Distributions should probably use /usr/sbin, but they probably know better...
24 # Don't forget trailing slash to avoid issues
26 INSTALL_DIR= /usr/local/sbin/
27 INSTALL_LIB= /usr/local/lib/
28 INSTALL_INC= /usr/local/include/
29 INSTALL_MAN= /usr/local/man
31 # Header selection is now supposed to be automatic...
33 # Use private copy of Wireless Extension definition instead of the
34 # system wide one in /usr/include/linux. Use with care.
35 # Can be used to create multiple versions of the tools on the same system
36 # for multiple kernels or get around broken distributions.
37 #WE_HEADER= -DPRIVATE_WE_HEADER
40 # ------------ End of config --------------
45 RM_CMD = $(RM) *.BAK *.bak *.o *.so ,* *~ *.a *.orig *.rej
47 #CFLAGS=-O2 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror
48 CFLAGS=-O2 -W -Wall -Wstrict-prototypes
49 XCFLAGS=$(CFLAGS) $(WARN) $(HEADERS) $(WE_HEADER)
54 all:: $(STATIC) $(DYNAMIC) $(PROGS)
57 $(CC) $(XCFLAGS) -o $@ $^ $(LIBS)
59 $(CC) $(XCFLAGS) -c $<
61 $(CC) $(XCFLAGS) $(PICFLAG) -c -o $@ $<
63 iwconfig: iwconfig.o $(IWLIB)
65 iwlist: iwlist.o $(IWLIB)
67 iwpriv: iwpriv.o $(IWLIB)
69 iwspy: iwspy.o $(IWLIB)
73 iwevent: iwevent.o $(IWLIB)
75 macaddr: macaddr.o $(IWLIB)
77 # Compilation of the dynamic library
78 $(DYNAMIC): $(OBJS:.o=.so)
79 $(CC) -shared -o $@ -Wl,-soname,$@ -lm -lc $^
81 # Compilation of the static library
87 # So crude but so effective ;-)
88 # Less crude thanks to many contributions ;-)
90 install -m 755 $(PROGS) $(INSTALL_DIR)
91 install -m 644 $(STATIC) $(INSTALL_LIB)
92 install -m 755 $(DYNAMIC) $(INSTALL_LIB)
93 ln -s $(INSTALL_LIB)/$(DYNAMIC) $(INSTALL_LIB)/$(DYNAMIC_LINK)
94 echo "Don't forget to add $(INSTALL_LIB) to /etc/ld.so.conf, and run ldconfig."
95 install -m 644 iwlib.h $(INSTALL_INC)
96 install -m 644 $(MANPAGES) $(INSTALL_MAN)/man8/
103 $(RM) $(STATIC) $(DYNAMIC) $(PROGS) macaddr
106 makedepend -s "# DO NOT DELETE" -- $(INCLUDES) -- $(SRCS)