Luka Vandervelden
f30e64e604
- This update also allowed to have a somewhat cleaner support for building libraries. (because the code to generate the rules for the .o files is common, uh) - Such automatic rules are hidden from the Makefiles’ “help” message, as they previously were. - subdirs are expected to have been broken. I should really write a real tool to do this job. In, say, C, maybe?
35 lines
583 B
Bash
35 lines
583 B
Bash
|
|
function ofile.build {
|
|
local dirname="$(dirname "$target")"
|
|
write -n "${target}: ${target%.o}.c"
|
|
|
|
sed '/^#include "/!d;s/^#include "//;s/"$//' "${target%.o}.c" | \
|
|
while read h; do
|
|
h="$dirname/$h"
|
|
|
|
write -n " $h"
|
|
done
|
|
write
|
|
|
|
write "\t@echo '$(CC ${target})'"
|
|
write -n "\t$Q\$(CC) \$(CFLAGS) ${cflags[$target]} -c ${target%.o}.c "
|
|
write -n " ${cflags[$target]}"
|
|
write " -o ${target}"
|
|
write
|
|
}
|
|
|
|
function ofile.install {
|
|
write "${target}.install:"
|
|
write
|
|
}
|
|
|
|
function ofile.uninstall {
|
|
write "${target}.uninstall:"
|
|
write
|
|
}
|
|
|
|
function ofile.clean {
|
|
binary.clean "$@"
|
|
}
|
|
|