2 ## Please check the configurion parameters below
5 ## Installation directory. By default, go in /usr/local
6 ## Distributions should probably use /usr, but they probably know better...
12 ## Uncomment this to build against this kernel
13 # KERNEL_SRC = /usr/src/linux
15 ## Uncomment this to force a particular version of wireless extensions.
16 ## This would use private copy of Wireless Extension definition instead
17 ## of the system wide one in /usr/include/linux. Use with care.
18 ## Can be used to create multiple versions of the tools on the same system
19 ## for multiple kernels or get around broken distributions.
20 # FORCE_WEXT_VERSION = 14
22 ## Uncomment this to build tools using dynamic version of the library
25 ## Uncomment this to build without using libm (less efficient)
26 ## This is mostly useful for embedded platforms
29 # ***************************************************************************
30 # ***** Most users should not need to change anything beyond this point *****
31 # ***************************************************************************
36 PROGS= iwconfig iwlist iwpriv iwspy iwgetid iwevent
37 MANPAGES8=iwconfig.8 iwlist.8 iwpriv.8 iwspy.8 iwgetid.8 iwevent.8
40 # Composition of the library :
43 # Select library to link tool with
50 # Standard name for dynamic library so that the dynamic linker can pick it.
51 # We will just create a symbolic link to the real thing.
52 DYNAMIC_LINK= libiw.so
55 INSTALL_DIR= $(PREFIX)/sbin/
56 INSTALL_LIB= $(PREFIX)/lib/
57 INSTALL_INC= $(PREFIX)/include/
58 INSTALL_MAN= $(PREFIX)/man/
60 # Use local header if the version of wireless extensions is specified
61 ifdef FORCE_WEXT_VERSION
62 WEXT_FLAG = -DWEXT_HEADER=\"wireless.$(FORCE_WEXT_VERSION).h\"
67 RM_CMD = $(RM) *.BAK *.bak *.o *.so ,* *~ *.a *.orig *.rej
70 KERNEL_INCLUDES = -I $(KERNEL_SRC)/include
73 # Do we want to build with or without libm ?
76 WELIB_FLAG = -DWE_NOLIBM=y
81 #CFLAGS=-O2 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror
82 CFLAGS=-O2 -W -Wall -Wstrict-prototypes
83 XCFLAGS=$(CFLAGS) $(WARN) $(HEADERS) $(WEXT_FLAG) $(WELIB_FLAG) $(KERNEL_INCLUDES)
86 all:: $(STATIC) $(DYNAMIC) $(PROGS)
89 $(CC) $(XCFLAGS) -o $@ $^ $(LIBS)
91 $(CC) $(XCFLAGS) -c $<
93 $(CC) $(XCFLAGS) $(PICFLAG) -c -o $@ $<
95 iwconfig: iwconfig.o $(IWLIB)
97 iwlist: iwlist.o $(IWLIB)
99 iwpriv: iwpriv.o $(IWLIB)
101 iwspy: iwspy.o $(IWLIB)
105 iwevent: iwevent.o $(IWLIB)
107 macaddr: macaddr.o $(IWLIB)
109 # Compilation of the dynamic library
110 $(DYNAMIC): $(OBJS:.o=.so)
111 $(CC) -shared -o $@ -Wl,-soname,$@ -lm -lc $^
113 # Compilation of the static library
119 # So crude but so effective ;-)
120 # Less crude thanks to many contributions ;-)
122 install -m 755 -d $(INSTALL_DIR)
123 install -m 755 $(PROGS) $(INSTALL_DIR)
124 install -m 755 -d $(INSTALL_LIB)
125 install -m 644 $(STATIC) $(INSTALL_LIB)
126 install -m 755 $(DYNAMIC) $(INSTALL_LIB)
127 ln -sfn $(DYNAMIC) $(INSTALL_LIB)/$(DYNAMIC_LINK)
128 echo "Don't forget to add $(INSTALL_LIB) to /etc/ld.so.conf, and run ldconfig."
129 install -m 755 -d $(INSTALL_INC)
130 install -m 644 iwlib.h $(INSTALL_INC)
131 install -m 755 -d $(INSTALL_MAN)/man8/
132 install -m 644 $(MANPAGES8) $(INSTALL_MAN)/man8/
133 install -m 755 -d $(INSTALL_MAN)/man7/
134 install -m 644 $(MANPAGES7) $(INSTALL_MAN)/man7/
141 $(RM) $(STATIC) $(DYNAMIC) $(PROGS) macaddr
144 for f in $(PROGS); do \
145 $(RM) $(INSTALL_DIR)/$$f; \
147 $(RM) $(INSTALL_LIB)/$(STATIC)
148 $(RM) $(INSTALL_LIB)/$(DYNAMIC)
149 $(RM) $(INSTALL_LIB)/$(DYNAMIC_LINK)
150 $(RM) $(INSTALL_INC)/iwlib.h
151 for f in $(MANPAGES8); do \
152 $(RM) $(INSTALL_MAN)/man8/$$f; \
153 for f in $(MANPAGES7); do \
154 $(RM) $(INSTALL_MAN)/man7/$$f; \
158 makedepend -s "# DO NOT DELETE" -- $(INCLUDES) -- $(SRCS)