[comp.unix.questions] MAKE checking archive files?

Schauble@MIT-MULTICS.arpa (Paul Schauble) (03/23/87)

Is there a version of make circulating that is capable of checking the
times on individual elements within archives such as those produced by
ar or within object libraries.  For example, if I keep an object library
and keep the corresponding sources within an a .ar file, is there a make
that can do the usual date-time processing without exploding the .ar and
the object library?

Please copy me directly on any responses.  I'll summarize to the list if
I get anything interesting.

    thanks,
      Paul
        Schauble at MIT-Multics.edu

jfh@killer.UUCP (04/02/87)

In article <5398@brl-adm.ARPA>, Schauble@MIT-MULTICS.arpa (Paul Schauble) writes:
> Is there a version of make circulating that is capable of checking the
> times on individual elements within archives such as those produced by
> ar or within object libraries.  For example, if I keep an object library
> and keep the corresponding sources within an a .ar file, is there a make
> that can do the usual date-time processing without exploding the .ar and
> the object library?
> 
> Please copy me directly on any responses.  I'll summarize to the list if
> I get anything interesting.
> 
The manual page for make says:

_Libraries_
	If a target or dependency name contains parentheses, it is assumed
	to be an archive library, the string within parentheses referring to a
	member within the library...

The rules I have used when writing makefile's for libraries look like this:

mylib.a:	mylib.a(file1.o) mylib.a(file2.o) ...

mylib.a(file1.o):	file1.c ...
	cc -c -O file1.c
	ld -r -x file1.o		# removes superfluous symbols
	mv a.out file1.o		# puts the .o file back (bitch)
	ar rv mylib.a file1.o		# install in archive
	rm file1.o			# remove unneed file

This is a _pain_, but it seems to work very well.

- john.		(jfh@killer.UUCP)

No disclaimer.  Whatcha gonna do, sue me?