charmc: Don't skip linking if user explicitly specified an output file53/4753/5
commitf6bed65a2001810df6599ecac55e33ca57593720
authorTim Haines <thaines.astro@gmail.com>
Tue, 30 Oct 2018 00:54:52 +0000 (29 19:54 -0500)
committerEvan Ramos <evan@hpccharm.com>
Mon, 5 Nov 2018 18:05:10 +0000 (5 12:05 -0600)
tree48dc589cc52fac5c07b1dc059bbda673a17ca1f6
parentfc6f914af35b5ed3621ede1ff01376b3f71e1599
charmc: Don't skip linking if user explicitly specified an output file

This allows generating dependencies while compiling

If you have a directory layout like

src/
   foo/
      a.cpp
   a.cpp

this changeset fixes a seemingly unrelated bug where compiling
'foo/a.cpp' from 'src' using
'charmc -MMD -MP -MF foo/a.d -c foo/a.cpp -o foo/a.o' produces
'src/a.o' instead of 'src/foo/a.o'- overwriting (or will be
overwritten by) the object generated by 'src/a.cpp'. This happens
because of the test 'if [ ! -z "$SKIPLINK" ]' on line 1854
(in this commit; 1848 in HEAD).

A simpler fix would be to not set SKIPLINK when a dependency flag is
read in 'processArgs'. However, that would change the meaning when
the user does not specify an output file (and linking should be
skipped) and wants to generate dependency files.

This bug likely never showed up because it works fine when the
source being compiled is in the same directory from which charmc is
invoked as most compiler's default output location is the pwd.

Change-Id: I8b28e64ba46f060039bd3c4f0e88b8d842ddb3bc
src/scripts/charmc