diff --git a/scat/GNUmakefile b/scat/GNUmakefile index 399947e..704e3d2 100644 --- a/scat/GNUmakefile +++ b/scat/GNUmakefile @@ -1,5 +1,4 @@ include GNUmakevars -include GNUmakerules all: scat $(patsubst %.msg, %.cat, $(wildcard *.msg)) @@ -15,3 +14,10 @@ clean: rm -f *.cat *.o scat core scat.h install: $(BINDIR)/scat + +GNUmakevars: GNUmakevars.sh + sh ./$^ > $@ +GNUmakerules: GNUmakerules.sh + sh ./$^ > $@ + +include GNUmakerules diff --git a/scat/GNUmakerules.sh b/scat/GNUmakerules.sh new file mode 100755 index 0000000..952629f --- /dev/null +++ b/scat/GNUmakerules.sh @@ -0,0 +1,5 @@ +#!/bin/sh +echo "\$(BINDIR)/%: %" +echo -e "\tcp \$^ \$@" +echo "\$(MAN1DIR)/%: %" +echo -e "\tcp \$^ \$@" diff --git a/scat/GNUmakevars.sh b/scat/GNUmakevars.sh new file mode 100755 index 0000000..1443f83 --- /dev/null +++ b/scat/GNUmakevars.sh @@ -0,0 +1,15 @@ +#!/bin/sh +prefix=${prefix:-/usr/local} +echo "BINDIR=$prefix/bin" + +for i in "$prefix/share/man/man1" "$prefix/man/man1" +do + if [ -d "$i" -a -w "$i" ] + then + echo "MAN1DIR=$i" + break; + fi +done + +echo +echo "all:"