* DU 4.0B make/ld doesn't delete target
@ 1997-10-07 4:00 Dylan Salisbury
1997-10-13 4:00 ` Craig Neth USG
0 siblings, 1 reply; 2+ messages in thread
From: Dylan Salisbury @ 1997-10-07 4:00 UTC (permalink / raw)
Hello,
I'm running Digital Unix 4.0B with no patches. I'm using Digital's cc,
ld, and make (I know that one answer to my question is "use gcc and GNU
make" so please bear with me and help me find another answer!).
After a link error during a make, I end up with the partially linked
executable remaining! It's my understanding that make should always
delete a failed target unless the .PRECIOUS special target is specified,
correct?
Are there any flags or commands I can use to get around this problem
without switching development tools? If not, I'd love recommendations
for the next-least-painful solution (which I imagine is to go GNU?)
Following are two files and a typescript session that reproduce the
problem.
Thanks in advance,
Dylan
Makefile:
a: a.o
cc a.o -o a
a.o: a.c
cc -c a.c -o a.o
a.c:
int x(void);
int main(void)
{
return x();
}
typescript:
Script started, file is typescript
$ make
cc -c a.c -o a.o
cc a.o -o a
ld:
Unresolved:
x
*** Exit 1
Stop.
$ make
`a' is up to date.
$ exit
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: DU 4.0B make/ld doesn't delete target
1997-10-07 4:00 DU 4.0B make/ld doesn't delete target Dylan Salisbury
@ 1997-10-13 4:00 ` Craig Neth USG
0 siblings, 0 replies; 2+ messages in thread
From: Craig Neth USG @ 1997-10-13 4:00 UTC (permalink / raw)
Dylan Salisbury wrote:>
> After a link error during a make, I end up with the partially linked
> executable remaining! It's my understanding that make should always
> delete a failed target unless the .PRECIOUS special target is specified,
> correct?
>
> Are there any flags or commands I can use to get around this problem
> without switching development tools? If not, I'd love recommendations
> for the next-least-painful solution (which I imagine is to go GNU?)
I've never heard of a make rule that it delete a failed target but
I'm no expert on make.
What I _have_ seen is lots of makefiles that look like this:
foo: $(foo_OBJS)
cc -o $@.X $(foo_OBJS)
mv $@.X $@
I.e. they link into a temporary target and then move it to real target.
If the link fails, the 'mv' won't be executed.
--
-------------------------------------------------------------------------------
Craig Neth ! neth@zk3.dec.com
DIGITAL Equipment Corporation !
110 Spit Brook Road ZKO2-3/W17 !
Nashua, NH 03062 ! Opinions expressed herein are my own.
===============================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1997-10-13 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-10-07 4:00 DU 4.0B make/ld doesn't delete target Dylan Salisbury
1997-10-13 4:00 ` Craig Neth USG
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox