Makefile 1.1 KB

12345678910111213141516171819202122232425
  1. ../Makefile: ../Makefile.in substitutions.sed substitute.sh
  2. ./substitute.sh ../Makefile.in ../Makefile
  3. substitutions.sed: substitutions.conf
  4. sed -n -E \
  5. -e 's@^[[:space:]]*#.*@@' \
  6. -e 's@!@\\!@g' \
  7. -e 's@^([[:alnum:]_]+) *(.*)@s!%%\1%%!\2!g@p' \
  8. substitutions.conf > $@
  9. substitutions.conf: substitutions.conf.default substitutions.conf.local
  10. cp -p substitutions.conf.local $@
  11. awk '{ print $$1 }' substitutions.conf.local | fgrep -v -h -f - substitutions.conf.default >> $@
  12. substitutions.conf.default: substitutions.conf.franchise substitutions.conf.FreeBSD substitutions.conf.Linux
  13. cat substitutions.conf.franchise substitutions.conf.`uname` > $@
  14. substitutions.conf.local:
  15. [ -e $@ ] || \
  16. { ETC_CONF=`sed -n -E -e 's/^ETC_DIR[[:space:]]+(.*)$$/\1/p' substitutions.conf.default | head -n 1`/nodes2grafana.conf ; \
  17. if [ -e $$ETC_CONF ] ; then ln -s $$ETC_CONF $@ ; else touch $@ ; fi ; }
  18. clean:
  19. rm -f substitutions.sed substitutions.conf substitutions.conf.default
  20. [ -L substitutions.conf.local ] && rm -f substitutions.conf.local || [ -s substitutions.conf.local ] || rm -f substitutions.conf.local