C99 Compliance #29
1 changed files with 16 additions and 1 deletions
17
configure
vendored
17
configure
vendored
|
@ -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}\""
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue