Index: utils/objfw-compile ================================================================== --- utils/objfw-compile +++ utils/objfw-compile @@ -63,10 +63,11 @@ } srcs="" out="" objs="" +builddir="" link="no" link_stdcpp="no" lib="no" plugin="no" out_prefix="" @@ -98,10 +99,14 @@ lib="yes" OBJCFLAGS="$OBJCFLAGS $($OBJFW_CONFIG --lib-cflags)" out_prefix="$($OBJFW_CONFIG --lib-prefix)" out_suffix="$($OBJFW_CONFIG --lib-suffix)" ;; + --builddir) + shift + builddir="$1" + ;; -D) shift CPPFLAGS="$CPPFLAGS -D$1" ;; -D*) @@ -187,29 +192,39 @@ if test x"$out" = x""; then echo "No output name specified! Use -o or --out!" exit 1 fi + +case "$builddir" in + "") + ;; + */) + ;; + *) + builddir="$builddir/" + ;; +esac for i in $srcs; do case $i in *.m) if test x"$lib" = x"yes"; then - obj="${i%.m}.lib.o" + obj="$builddir${i%.m}.lib.o" elif test x"$plugin" = x"yes"; then - obj="${i%.m}.plugin.o" + obj="$builddir${i%.m}.plugin.o" else - obj="${i%.m}.o" + obj="$builddir${i%.m}.o" fi ;; *.mm) if test x"$lib" = x"yes"; then - obj="${i%.mm}.lib.o" + obj="$builddir${i%.mm}.lib.o" elif test x"$plugin" = x"yes"; then - obj="${i%.mm}.plugin.o" + obj="$builddir${i%.mm}.plugin.o" else - obj="${i%.mm}.o" + obj="$builddir${i%.mm}.o" fi ;; esac objs="$objs $obj" build="no"