C99 Compliance #29

Merged
jordan merged 11 commits from c99 into master 2024-01-13 22:13:46 +00:00
Showing only changes of commit aa737a2b2e - Show all commits

17
configure vendored
View file

@ -128,11 +128,26 @@ print_obj() {
printf '%s ' "$2"
}
get_deps() {
src="$1"
${CC} -I${INCLUDE} -E "$src" \
| grep '^#' \
| awk '{print $3}' \
| cut -d '"' -f 2 \
| sort \
| uniq \
| grep -v '^[/<]' \
| while IFS= read -r dep; do
printf "%s " "$dep"
done
}
compile_obj() {
src="$1"
obj="$2"
${CC} -I${INCLUDE} -MM -MT "${obj}" "${src}"
echo "${obj}: $(get_deps ${src})"
echo "${TAB}@mkdir -p $(dirname ${obj})"
echo "${TAB}\$(CC) \$(CFLAGS) -fPIC -c -o \"${obj}\" \"${src}\""
}