A problem with pmake

Dennis Linse djlinse at phoenix.Princeton.EDU
Sun Mar 10 11:11:37 AEST 1991


I've been using pmake(1) on our Personal Iris for several months now
with no problems under Irix 3.2.2.  I updated to 3.3.2 this week and
attempted to rebuild some of my source and ran into problems during a
partial pmake of an archive.  I've simplified it down to the following
source.

----- Makefile -----
main:	libtest.a main.o
	cc -o main main.o libtest.a

libtest.a:	libtest.a(sub.o)
		ar cru $(.TARGET) $(.OODATE)
		rm -f $(.OODATE)
----- main.c -----
main()
{ sub(); }
----- sub.c -----
sub()
{ }
-----

Putting these three files in a separate directory and running pmake the
first time works great.  Now touch sub.c and rerun pmake.  To me this
should (and use to) recompile sub.c to sub.o, include sub.o in
libtest.a, remove sub.o, and relink main.  Unfortunately, that isn't
what it does, although pmake says it is going to do that.

Here is a short typescript which shows the output for pmake and pmake -n
which tells what pmake is *going* to do.

-----
theodore, dude> pmake
`main' is up to date.
theodore, dude> touch sub.c
theodore, dude> pmake -n
--- sub.o ---
cc -O -c sub.c
--- libtest.a(sub.o) ---
--- libtest.a ---
ar cru libtest.a sub.o
rm -f sub.o
--- main ---
cc -o main main.o libtest.a
theodore, dude> pmake
--- sub.o ---
cc -O -c sub.c
`main' is up to date.
theodore, dude> pmake -n
--- libtest.a(sub.o) ---
--- libtest.a ---
ar cru libtest.a sub.o
rm -f sub.o
--- main ---
cc -o main main.o libtest.a
theodore, dude> pmake
`main' is up to date.
theodore, dude>
-----

As you can see, the ar command is never run.  Thus main is *not* up to
date, nor is libtest.a.  Even pmake admits this with the -n option.

Am I doing something incredibly wrong?  Hopefully I am, or else I'll
have to submit a bug report next week and try to rethink of a way to do
what I want.  (I use pmake because it looked easier when I was putting
together this project under RCS.)

Thanks for any help.

Dennis  (djlinse at phoenix.princeton.edu)
A witty saying proves nothing. -- Voltaire



More information about the Comp.sys.sgi mailing list