diff options
author | Greg Ward <gward@python.net> | 2000-03-02 01:21:54 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-03-02 01:21:54 (GMT) |
commit | 49ffce173ef739c8f3f26f236287e57f5d018a19 (patch) | |
tree | 56f6c071f88319d8749fe3e182068de1c086088b | |
parent | b48bc17d10fa53c7ccbcca5597ee4bdb8754973e (diff) | |
download | cpython-49ffce173ef739c8f3f26f236287e57f5d018a19.zip cpython-49ffce173ef739c8f3f26f236287e57f5d018a19.tar.gz cpython-49ffce173ef739c8f3f26f236287e57f5d018a19.tar.bz2 |
In the 'compile()' method: preserve the directory portion of source
filenames when constructing object filenames, even if output_dir given --
eg. "foo/bar.c" will compile to "foo/bar.o" without an output_dir, and to
"temp/foo/bar.o" if output_dir is "temp".
-rw-r--r-- | Lib/distutils/unixccompiler.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index 77d12d3..518132f 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -100,6 +100,7 @@ class UnixCCompiler (CCompiler): def compile (self, sources, output_dir=None, + keep_dir=0, macros=None, include_dirs=None, debug=0, @@ -134,7 +135,11 @@ class UnixCCompiler (CCompiler): # don't have to recompile. (Simplistic check -- we just compare the # source and object file, no deep dependency checking involving # header files. Hmmm.) - objects = self.object_filenames (sources, output_dir=output_dir) + objects = self.object_filenames (sources, + output_dir=output_dir, + keep_dir=keep_dir) + all_objects = copy (objects) # preserve full list to return + if not self.force: skipped = newer_pairwise (sources, objects) for skipped_pair in skipped: @@ -169,7 +174,7 @@ class UnixCCompiler (CCompiler): # Have to re-fetch list of object filenames, because we want to # return *all* of them, including those that weren't recompiled on # this call! - return self.object_filenames (orig_sources, output_dir=output_dir) + return all_objects def _fix_link_args (self, output_dir, libraries, library_dirs): |