4 rm -r "$out/" 2> /dev/null
7 src/nitg src/nitg.nit -v "$@" --compile-dir "$out" -o "$out/nitg" --no-cc
8 mv "$out/nitg.mk" "$out/Makefile"
9 sed -i -e "s#../$out/##g" "$out/Makefile"
11 # Copy all direct dependencies
12 for f in `grep -h -o '\S*/[^/]*\.c' "$out/Makefile" | sort -u`; do
14 cp "$out/${f%c}h" "$out/"
16 for f in `grep -h -o '\.\..*\.h' "$out"/*.[ch] | sort -u`; do
20 # Update references in file
21 perl -i -npe 's#"\.\./.*?([^/]*.h)"#"\1"#' "$out"/*.[ch]
22 perl -i -npe 's#\S*/([^/]*.[ch])#\1#' "$out/Makefile"
23 perl -i -npe 's#../clib#.#' "$out/Makefile"