From: Kel Modderman Date: Wed, 17 Sep 2008 09:04:33 +0000 (+0200) Subject: makefile improvements X-Git-Tag: v0.9.4~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=848794ec8cb47d997baa674add941536df47892b;p=thirdparty%2Fiw.git makefile improvements * 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 --- diff --git a/Makefile b/Makefile index 5c08881..f858d1e 100644 --- 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