Fix the Makefile for gmake and pmake
authorRoy Marples <roy@marples.name>
Fri, 16 Nov 2007 14:32:02 +0000 (14:32 +0000)
committerRoy Marples <roy@marples.name>
Fri, 16 Nov 2007 14:32:02 +0000 (14:32 +0000)
Makefile

index 4389903d418592a02cdcdf1bc6c4ef2009a3b8dc..71097ca03d77855f305f545c501da44bdd31f68b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ DESTDIR =
 PREFIX =
 MANPREFIX ?= /usr/share
 ROOT = $(DESTDIR)$(PREFIX)
-INSTALL = install 
+INSTALL = install
 ETCDIR = $(ROOT)/etc/resolvconf
 MANDIR = $(MANPREFIX)/man/man8
 BINDIR = $(ROOT)/sbin
@@ -14,16 +14,15 @@ RESOLVCONF = resolvconf resolvconf.8
 SUBSCRIBERS = libc dnsmasq named
 TARGET = $(RESOLVCONF) $(SUBSCRIBERS)
 
-all: $(TARGET)
+.SUFFIXES: .in
 
-$(SUBSCRIBERS): $*.in
-       sed -e s':^PREFIX=.*:PREFIX="$(PREFIX)":' $*.in > $*
+all: $(TARGET)
 
-resolvconf: $*.in
-       sed -e s':^PREFIX=.*:PREFIX="$(PREFIX)":' $*.in > $*
+.in:
+       sed -e s':^PREFIX=.*:PREFIX="$(PREFIX)":' $@.in > $@
 
-resolvconf.8:
-       sed -e 's:%%PREFIX%%:$(PREFIX):g' $*.in > $*
+resolvconf.8: resolvconf.8.in
+       sed -e 's:%%PREFIX%%:$(PREFIX):g' $@.in > $@
 
 clean:
        rm -f $(TARGET) openresolv-$(VERSION).tar.bz2
@@ -37,11 +36,11 @@ install: $(TARGET)
        $(INSTALL) -d $(ETCDIR)/update-libc.d
        $(INSTALL) -d $(UPDATEDIR)
        $(INSTALL) $(SUBSCRIBERS) $(UPDATEDIR)
-       $(INSTALL) -m 644 resolvconf.8 $(MANDIR)
+       $(INSTALL) -m 0644 resolvconf.8 $(MANDIR)
        ln -snf /var/run/resolvconf $(ETCDIR)/run
 
 dist:
-       $(INSTALL) -m 0755 -d /tmp/openresolv-$(VERSION)
+       $(INSTALL) -d /tmp/openresolv-$(VERSION)
        cp -RPp . /tmp/openresolv-$(VERSION)
        (cd /tmp/openresolv-$(VERSION); $(MAKE) clean)
        rm -rf /tmp/openresolv-$(VERSION)/*.bz2 /tmp/openresolv-$(VERSION)/.git