25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
1.1 KiB

  1. #!/bin/sh
  2. # Karl Palsson <karlp@tweak.net.au> Sept 2017
  3. # Parse .d files for a given target, and generate a doxygen config file
  4. # stub that is to be "@INCLUDE = <xxx>" into a doxygen template file.
  5. DDIR=$1
  6. ODIR=$2
  7. ONAME=doxy.sourcelist
  8. IPATH=$(echo ${DDIR} | sed -e 's#../lib/##')
  9. PATH_DELTA=$(realpath --relative-to=${ODIR} ${DDIR})
  10. printf "# This file is autogenerated by scripts/gendoxylist\n" > ${ODIR}/${ONAME}
  11. printf "# All headers for core/platform, not always caught by .d file tracking\n" >> ${ODIR}/${ONAME}
  12. UNTRACKED_DIRS="../include/libopencm3/cm3 ../include/libopencm3/${IPATH}"
  13. for FN in $(find ${UNTRACKED_DIRS} -name '*.h' | sort); do
  14. printf "INPUT += ../%s\n" "$FN" >> ${ODIR}/${ONAME}
  15. done
  16. # There will be duplicates here, but doxygen doesn't mind.
  17. printf "# Headers first\n" >> ${ODIR}/${ONAME}
  18. grep -o '[^ ]*.h' ${DDIR}/*.d | grep 'include/libopencm3' | cut -d ':' -f2 | sort | uniq | sed "s#^#INPUT += ${PATH_DELTA}/#" >> ${ODIR}/${ONAME}
  19. printf "# Now sources\n" >> ${ODIR}/${ONAME}
  20. grep -o '[^ ]*\.c' ${DDIR}/*.d | cut -d ':' -f 2 | sort | uniq | sed "s#^#INPUT += $PATH_DELTA/#" >> ${ODIR}/${ONAME}