]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - m4.sh
Add better debug output to m4.sh and link.sh.
[config/dotfiles.git] / m4.sh
1 #!/bin/sh
2
3 # m4 wrapper script which uses $1.m4 as template file, feeds it to m4 and
4 # writes it to $1 with a warning at the beginning to not edit the generated
5 # file.
6 #
7 # All arguments to this script (except the first which is the filename) are
8 # passed to m4.
9
10
11 # First argument is file name.
12 file=$1
13 shift
14
15 # Write a warning to the generated file.
16 echo "###################################" > $file
17 echo "# WARNING! DO NOT EDIT THIS FILE! #" >> $file
18 echo "###################################" >> $file
19 echo >> $file
20 echo "# It was generated from $file.m4 on `date`." >> $file
21 echo >> $file
22
23 # Process $1.m4 with m4 using the given options.
24 echo "m4.sh: generating '$file' from '$file.m4' with options '$*'"
25 m4 $* $file.m4 >> $file