You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
939 B
22 lines
939 B
7 years ago
|
#!/bin/sh
|
||
|
# Karl Palsson <karlp@tweak.net.au> Sept 2017
|
||
|
# Parse .d files for a given target, and generate a doxygen config file
|
||
|
# stub that is to be "@INCLUDE = <xxx>" into a doxygen template file.
|
||
|
|
||
|
DDIR=$1
|
||
|
ODIR=$2
|
||
|
ONAME=doxy.sourcelist
|
||
|
|
||
|
PATH_DELTA=$(realpath --relative-to=${ODIR} ${DDIR})
|
||
|
|
||
|
printf "# This file is autogenerated by scripts/gendoxylist\n" > ${ODIR}/${ONAME}
|
||
|
printf "# Documentation only header, not caught by .d file tracking" >> ${ODIR}/${ONAME}
|
||
|
FN=$(find ../include/libopencm3/ -name doc-$(basename ${ODIR}).h)
|
||
|
printf "INPUT += ../%s\n" "$FN" > ${ODIR}/${ONAME}
|
||
|
|
||
|
printf "# Headers first\n" >> ${ODIR}/${ONAME}
|
||
|
grep -o '[^ ]*.h' ${DDIR}/*.d | grep 'include/libopencm3' | cut -d ':' -f2 | sort | uniq | sed "s#^#INPUT += ${PATH_DELTA}/#" >> ${ODIR}/${ONAME}
|
||
|
|
||
|
printf "# Now sources\n" >> ${ODIR}/${ONAME}
|
||
|
grep -o '[^ ]*\.c' ${DDIR}/*.d | cut -d ':' -f 2 | sort | uniq | sed "s#^#INPUT += $PATH_DELTA/#" >> ${ODIR}/${ONAME}
|