OSDN Git Service

Add Android.mk
[android-x86/external-wireless-tools.git] / wireless_tools / Makefile
index bc4fbd6..0078324 100644 (file)
@@ -2,31 +2,38 @@
 ## Please check the configurion parameters below
 ##
 
-## Installation directory. By default, go in /usr/local
+## Installation directory. By default, go in /usr/local.
 ## Distributions should probably use /, but they probably know better...
 ifndef PREFIX
   PREFIX = /usr/local
 endif
 
-## Compiler to use (modify this for cross compile)
+## Compiler to use (modify this for cross compile).
 CC = gcc
-## Other tools you need to modify for cross compile (static lib only)
+## Other tools you need to modify for cross compile (static lib only).
 AR = ar
 RANLIB = ranlib
 
-## Uncomment this to build tools using static version of the library
+## Uncomment this to build tools using static version of the library.
 ## Mostly useful for embedded platforms without ldd, or to create
 ## a local version (non-root).
-# BUILD_STATIC = y
+## Standard distros should comment that option to save space and to
+## build libiw.so used by third parties...
+BUILD_STATIC = y
 
-## Uncomment this to build without using libm (less efficient)
+## Uncomment this to build without using libm (less efficient).
 ## This is mostly useful for embedded platforms without maths.
 # BUILD_NOLIBM = y
 
-## Uncomment this to strip binary from symbols. This reduce binary size
+## Uncomment this to strip binary from symbols. This reduce binary size.
 ## by a few percent but make debug worse...
 # BUILD_STRIPPING = y
 
+## Uncomment this to build with only essential functionality.
+## This leaves out the less used features and cut in half the tools.
+## This is mostly useful for embedded platforms without limited feature needs.
+# BUILD_WE_ESSENTIAL = y
+
 # ***************************************************************************
 # ***** Most users should not need to change anything beyond this point *****
 # ***************************************************************************
@@ -66,10 +73,10 @@ endif
 DYNAMIC_LINK= libiw.so
 
 # Install directories
-INSTALL_DIR= $(PREFIX)/sbin/
-INSTALL_LIB= $(PREFIX)/lib/
-INSTALL_INC= $(PREFIX)/include/
-INSTALL_MAN= $(PREFIX)/man/
+INSTALL_DIR= $(PREFIX)/sbin
+INSTALL_LIB= $(PREFIX)/lib
+INSTALL_INC= $(PREFIX)/include
+INSTALL_MAN= $(PREFIX)/man
 
 # Various commands
 RM = rm -f
@@ -91,12 +98,17 @@ else
   STRIPFLAGS=
 endif
 
+# Do we want to build with only essential functionality ?
+ifdef BUILD_WE_ESSENTIAL
+  WEDEF_FLAG= -DWE_ESSENTIAL=y
+endif
+
 # Other flags
 CFLAGS=-Os -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow \
        -Wpointer-arith -Wcast-qual -Winline -I.
 #CFLAGS=-O2 -W -Wall -Wstrict-prototypes -I.
 DEPFLAGS=-MMD
-XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS) $(WELIB_FLAG)
+XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS) $(WELIB_FLAG) $(WEDEF_FLAG)
 PICFLAG=-fPIC
 
 # Standard compilation targets
@@ -173,12 +185,14 @@ install-hdr:: wireless.h
 
 # How could you live without those manapages ?
 install-man::
-       install -m 755 -d $(INSTALL_MAN)/man8/
-       install -m 644 $(MANPAGES8) $(INSTALL_MAN)/man8/
-       install -m 755 -d $(INSTALL_MAN)/man7/
-       install -m 644 $(MANPAGES7) $(INSTALL_MAN)/man7/
-       install -m 755 -d $(INSTALL_MAN)/man5/
-       install -m 644 $(MANPAGES5) $(INSTALL_MAN)/man5/
+       for lang in . cs fr.*; do \
+           install -m 755 -d $(INSTALL_MAN)/$$lang/man8/; \
+           install -m 644 $$lang/$(MANPAGES8) $(INSTALL_MAN)/$$lang/man8/; \
+           install -m 755 -d $(INSTALL_MAN)/$$lang/man7/; \
+           install -m 644 $$lang/$(MANPAGES7) $(INSTALL_MAN)/$$lang/man7/; \
+           install -m 755 -d $(INSTALL_MAN)/$$lang/man5/; \
+           install -m 644 $$lang/$(MANPAGES5) $(INSTALL_MAN)/$$lang/man5/; \
+       done
 
 install-iwmulticall:: iwmulticall
        install -m 755 -d $(INSTALL_DIR)
@@ -205,14 +219,16 @@ uninstall::
        $(RM) $(INSTALL_LIB)/$(DYNAMIC_LINK)
        $(RM) $(INSTALL_INC)/iwlib.h
        $(RM) $(INSTALL_INC)/wireless.h
-       for f in $(MANPAGES8); do \
-         $(RM) $(INSTALL_MAN)/man8/$$f; \
-       done
-       for f in $(MANPAGES7); do \
-         $(RM) $(INSTALL_MAN)/man7/$$f; \
-       done
-       for f in $(MANPAGES5); do \
-         $(RM) $(INSTALL_MAN)/man5/$$f; \
+       for lang in . cs fr.*; do \
+           for f in $(MANPAGES8); do \
+               $(RM) $(INSTALL_MAN)/$$lang/man8/$$f; \
+           done; \
+           for f in $(MANPAGES7); do \
+               $(RM) $(INSTALL_MAN)/$$lang/man7/$$f; \
+           done; \
+           for f in $(MANPAGES5); do \
+               $(RM) $(INSTALL_MAN)/$$lang/man5/$$f; \
+           done; \
        done
 
 # Include dependancies