[net.unix-wizards] Make

conrad@nbires.UUCP (M. Conrad Geiger) (08/09/84)

  	Does anyone out there have or know about a good replacement for
"make"?  I am looking for one and would appreciate any responses.

											Conrad Geiger
											NBI
											P.O. Box 9001
											Boulder, Colorado
											(303) 938-2986

		network address ------> nbires!yaz!conrad
 			

sean@ukecc.UUCP (Sean Casey) (08/08/86)

I need some help with make.  I've pored over the documentation, but
it seems that no matter what I try I can't get it to do what I want.
Could somebody please help me out?

I have some nroff source files in a directory.  I want to conditionally
compile them and place the results in another directory.  The end result
should look something like this:

% ls
subject1.ms	subject2.ms	subject3.ms	subject4.ms
% ls ../docsdir
%
% make
	nroff -ms subject1.ms | myprog > ../docsdir/subject1
	nroff -ms subject2.ms | myprog > ../docsdir/subject2
	nroff -ms subject3.ms | myprog > ../docsdir/subject3
	nroff -ms subject4.ms | myprog > ../docsdir/subject4
% touch subject2.ms
% make
	nroff -ms subject2.ms | myprog > ../docsdir/subject2
%

This doesn't sound all that complicated for someone that really
knows make.  I've tried .SUFFIXES: .ms:, changing .DEFAULT, etc.

Help!

Sean

khasin@hcrvx2.UUCP (Kha Sin Teow) (08/15/86)

In article <567@ukecc.UUCP> sean@ukecc.UUCP (Sean Casey) writes:
>I need some help with make.  I've pored over the documentation, but
>it seems that no matter what I try I can't get it to do what I want.
>Could somebody please help me out?
> ...

although i don't have a complete solution to your problem, i have done
something similar to what you are trying to do.
typically i maintained a processed document file in the same directory
as the source, except that it is appended with a different suffix.
using your sample of file names:
	subject1.ms subject2.ms
i would put the processed files into:
	subject1.doc subject2.doc

Consequently, the Makefile would look something like this:

	# Make file for processing subject documents
	.SUFFIXES .doc .ms
	#
	.ms.doc:
		nroff -ms $*.ms | myprog > $*.doc


If you must keep *.doc in a separate subdirectory, you could "mv" or
"ln" them.
Otherwise, you would have to explicitly specify the depedency of each
processed file and its source:

	# another make file line
	docsdir/subject1.doc:	subject1.ms
		nroff -ms ...

which is not as "elegant" as the previous setup.

Hope this help.


Kha Sin TEOW, HCR.
Toronto.