makefiles and sccs

Frank J. Edwards crash at jc3b21.UUCP
Thu Feb 16 07:19:07 AEST 1989


>From article <295 at ge1cbx.UUCP>, by usenet at ge1cbx.UUCP:
> 
> The .c~ trick for sccs files works fine when the sccs files are located in
> the directory one does the make in.  Few projects I know of can make use of
> this; typical setup is sccs somewhere else and development directories where
> makes and edits are made.
> 
> To support sccs files in another path, I have to do
> 
> OFILES = main.o a.o c.o zx.o etc.o
> CFILES = main.c a.c c.c zx.c etc.c
> 
> $(CFILES):
> 	get ...
> 
> There's gotta be a better way than the above, hopefully an implicit rule of
> some sort.  If you know of one, please email.
> 
> Thanks in advance,
> Terry Lee

Well, this isn't exactly the prettiest way, but it works:

	.DEFAULT:
		$(GET) $(GFLAGS) $(SCCSDIR)/$*.c
		$(CC) $(CFLAGS) $*.c

Notice that this will be used for any dependent that MAKE can't find;
which is why this isn't the best answer, just the only easy one.  There's
a possibility that VPATH may work with your version of MAKE.  On the
3B2 System V.2 machine I worked on, VPATH had a serious problem:

	VPATH = .:$(SCCSDIR):sccs	# list of directories (like PATH)

	file.o: file.c defs.h

If "file.c" or "defs.h" can't be found in the current directory, then
MAKE searches the VPATH directories.  HOWEVER, it does NOT provide a
macro to obtain the full path name if the file IS found!!  As far
as I'm concerned, VPATH is useless or worse.  Say "file.c" is found
in the $(SCCSDIR) directory.  MAKE still only uses "file.c" (the
original dependent's name) in the macro structures.

Of course, if you have the source for MAKE, you can change it... :-)

Hope this helps.
Frank "Crash" Edwards
"No one knows the trouble I've seen..."



More information about the Comp.unix.questions mailing list