]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
makefile improvements
authorKel Modderman <kel@otaku42.de>
Wed, 17 Sep 2008 09:04:33 +0000 (11:04 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Wed, 17 Sep 2008 09:04:33 +0000 (11:04 +0200)
* Add DESTDIR variable which makes distribution package maintainers weak at
  knees, because lots of tools set this to something suitable automagically
  for package build process (eg. dh)
* Make sure installation directories are mkdir'd
* Ensure sane permissions are set for installed files

Makefile

index 5c08881f95a8186f72eb0e455ca78cfc5d590d0f..f858d1eea6c928064e66c56a047d320093f82e8a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@
 
 MAKEFLAGS += --no-print-directory
 
+MKDIR ?= mkdir -p
 INSTALL ?= install
 PREFIX ?= /usr
 CC ?= "gcc"
@@ -48,9 +49,11 @@ check:
 
 install: iw iw.8.gz
        @$(NQ) ' INST iw'
-       $(Q)$(INSTALL) -o root -g root -t $(PREFIX)/bin iw
+       $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)/bin/
+       $(Q)$(INSTALL) -m 755 -o root -g root -t $(DESTDIR)$(PREFIX)/bin/ iw
        @$(NQ) ' INST iw.8'
-       $(Q)$(INSTALL) -o root -g root -t $(PREFIX)/share/man/man8/ iw.8.gz
+       $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)/share/man/man8/
+       $(Q)$(INSTALL) -m 644 -o root -g root -t $(DESTDIR)$(PREFIX)/share/man/man8/ iw.8.gz
 
 clean:
        $(Q)rm -f iw *.o *~ *.gz version.h