summaryrefslogtreecommitdiff
path: root/helpers/mkdep.sh
blob: 510bdc02fbfdede430e74b3b443c8d1252248cf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
#
# 1) remove everything after the DO NOT REMOVE
# 2) generate the dependencies, adding them to the end of Makefile.new
# 3) move the Makefile.new back into place
#
# Note that we use && to ensure that Makefile is not changed if an error
# occurs during the process
#
sed -ne '1,/^# DO NOT REMOVE/p' Makefile > Makefile.new \
    && gcc -MM  $* | sed -e "s/\.o:/\.lo:/" >> Makefile.new \
    && mv Makefile.new Makefile