Makefile 1.3 KB

12345678910111213141516171819202122232425262728
  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.heapsuffix substitutions.conf.FreeBSD substitutions.conf.Linux
  13. cat substitutions.conf.franchise substitutions.conf.heapsuffix substitutions.conf.`uname` > $@
  14. substitutions.conf.heapsuffix:
  15. echo "HEAP_SUFFIX `sml @SMLsuffix`" > $@
  16. substitutions.conf.local:
  17. [ -e $@ ] || \
  18. { ETC_CONF=`sed -n -E -e 's/^ETC_DIR[[:space:]]+(.*)$$/\1/p' substitutions.conf.default | head -n 1`/nodes2grafana.conf ; \
  19. if [ -e $$ETC_CONF ] ; then ln -s $$ETC_CONF $@ ; else touch $@ ; fi ; }
  20. clean:
  21. rm -f substitutions.sed substitutions.conf substitutions.conf.default substitutions.conf.heapsuffix
  22. [ -L substitutions.conf.local ] && rm -f substitutions.conf.local || [ -s substitutions.conf.local ] || rm -f substitutions.conf.local