1999-11-29 11:04:23 -08:00
|
|
|
|
# DoMake
|
|
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
|
1996-11-02 10:05:24 -08:00
|
|
|
|
# Execute the output of "Make -f Makefile.Mac -f Makefile.Mac.depend"
|
1999-11-29 11:04:23 -08:00
|
|
|
|
# or "Make -f Makefile -f Makefile.depend" if "Makefile.Mac" does not exist
|
|
|
|
|
# or "Make -f <file>" if the "-f" option is given.
|
|
|
|
|
|
|
|
|
|
# usage: domake [-quiet] [-f <file>]<5D> <make arguments>
|
1996-11-02 10:05:24 -08:00
|
|
|
|
|
|
|
|
|
set echo 0
|
|
|
|
|
|
1999-11-29 11:04:23 -08:00
|
|
|
|
set domake_quiet 0
|
|
|
|
|
set domake_files ""
|
|
|
|
|
|
|
|
|
|
loop
|
|
|
|
|
if "{1}" == "-quiet"
|
|
|
|
|
set domake_quiet 1
|
|
|
|
|
shift
|
|
|
|
|
else if "{1}" == "-f"
|
|
|
|
|
set domake_files "{domake_files} -f `quote "{2}"`"
|
|
|
|
|
shift 2
|
|
|
|
|
else
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
end
|
1996-11-02 10:05:24 -08:00
|
|
|
|
|
1999-11-29 11:04:23 -08:00
|
|
|
|
set tempfile "{TempFolder}temp-domake-`Date -n`"
|
1998-07-04 09:51:51 -07:00
|
|
|
|
if "`exists "{tempfile}"`"
|
|
|
|
|
set i 0
|
|
|
|
|
loop
|
1999-11-29 11:04:23 -08:00
|
|
|
|
break if ! "`exists "{tempfile}.{i}"`"
|
|
|
|
|
evaluate i += 1
|
1998-07-04 09:51:51 -07:00
|
|
|
|
end
|
|
|
|
|
set tempfile "{tempfile}.{i}"
|
|
|
|
|
end
|
|
|
|
|
|
1999-11-29 11:04:23 -08:00
|
|
|
|
if "{domake_files}" == ""
|
|
|
|
|
if "`exists Makefile.Mac`" != ""
|
|
|
|
|
set domake_main "Makefile.Mac"
|
|
|
|
|
else
|
|
|
|
|
set domake_main "Makefile"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if "`exists "{domake_main}".depend`" != ""
|
|
|
|
|
set domake_files "-f {domake_main} -f {domake_main}.depend"
|
|
|
|
|
else
|
|
|
|
|
set domake_files "-f {domake_main}"
|
|
|
|
|
end
|
1996-11-02 10:05:24 -08:00
|
|
|
|
end
|
|
|
|
|
|
1999-11-29 11:04:23 -08:00
|
|
|
|
if {domake_quiet}
|
|
|
|
|
echo >"{tempfile}"
|
1996-11-02 10:05:24 -08:00
|
|
|
|
else
|
|
|
|
|
echo 'set echo 1' >"{tempfile}"
|
|
|
|
|
end
|
1999-11-29 11:04:23 -08:00
|
|
|
|
make {domake_files} {"Parameters"} >>"{tempfile}"
|
1996-11-02 10:05:24 -08:00
|
|
|
|
|
|
|
|
|
"{tempfile}"
|
|
|
|
|
|
|
|
|
|
Delete -i "{tempfile}"
|