Is this a make bug or a make feature?

Duane Morse duane at anasazi.UUCP
Sat Apr 20 02:07:56 AEST 1985


In bringing up the public domain cpp, I noticed the following odd
behaviour of make. Supposed a make file looks like this:

OBJS = cpp1.o cpp2.o cpp3.o cpp4.o cpp5.o cpp6.o
SRCS = cpp1.c cpp2.c cpp3.c cpp4.c cpp5.c cpp6.c

cpp:	$(OBJS)
	$(CC) $(CFLAGS) $(OBJS) -o cpp

lint:	$(SRCS)
	lint $(LINTFLAGS) $(SRCS)

If the source files are kept under sccs and the .c's aren't kept around,
life gets difficult. Even though cpp is the target, make thinks that
it needs the source files since the (potential) lint target requires them.
Hence, make gets every source file. Then make notices that the .c files
are newer than the .o's (surprise!), and it recompiles every one. Finally,
since the .c files were gotten by the ~.c rule, the .c files are not
removed.

Is this a bug in our version of make (Convergent Technologies Megaframe
CTIX, ostensibly System V), or is this merely an unwanted feature?

Duane Morse
International Anasazi @ Phoenix



More information about the Comp.unix mailing list