>> os.system("make -C %s" % build_dir)
>> OP specified GNU make, so that works fine, but make sure you're not
>> going to need to use it with another make before settling on that
>> alternative. Frederik's works with more versions of make.
Understood. That was the only reason I
[EMAIL PROTECTED] wrote:
> Fredrik> build_dir = "path/to/makefile"
>
> Fredrik> cwd = os.getcwd() # get current directory
> Fredrik> try:
> Fredrik> os.chdir(build_dir)
> Fredrik> os.system("make")
> Fredrik> finally:
> Fredrik> os.chdir(cwd)
>
> Or even:
>
>
Fredrik> build_dir = "path/to/makefile"
Fredrik> cwd = os.getcwd() # get current directory
Fredrik> try:
Fredrik> os.chdir(build_dir)
Fredrik> os.system("make")
Fredrik> finally:
Fredrik> os.chdir(cwd)
Or even:
os.system("make -C %s" % build_dir)
Efrat Regev wrote:
> 1. The script is not in the directory of the makefile, and changing the
> locations of either is not an option. Consequently, the makefile fails,
> since it can't find the targets/dependencies.
build_dir = "path/to/makefile"
cwd = os.getcwd() # get current directory
try:
Efrat Regev wrote in news:[EMAIL PROTECTED] in comp.lang.python:
>Hello,
>
>I need to call GNU/make from within a Python script. This raised some
> problems:
> 1. The script is not in the directory of the makefile, and changing the
> locations of either is not an option. Consequently, t
Hello,
I need to call GNU/make from within a Python script. This raised some
problems:
1. The script is not in the directory of the makefile, and changing the
locations of either is not an option. Consequently, the makefile fails,
since it can't find the targets/dependencies.
2. After sea