🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Jim Leinweber Thu, 11 Sep 1986 19:54
glitch in 4.2 BSD make
#1671
Author: Jim Leinweber
Date: Thu, 11 Sep 1986 19:54
64 lines
2516 bytes
In some circumstances, make gets the file names on the generated
commands wrong.  I don't know a fix.

Example: in the following sample makefile, "make lint" works, "make all"
works, "make all lint" works, but "make lint all" produces garbled commands.

The problem seems to be an interaction between the default rules for
lex.l -> lex.c -> lex.o and the overdone dependency "lint :  ... lex.l lex.c".

% cat bug.mak

CC1NULL = $(CC) $(CFLAGS) -o $* $*.c
SRC = alarmd.c bd_main.c lex.l batchq.c
H = batchq.h batchd.h include.h lex.h
BDO = bd_main.o lex.o

all : alarmd batchd batchq

alarmd : alarmd.c batchq.h ; $(CC1NULL)
batchd : $(BDO) ; $(CC) $(CFLAGS) -o batchd $(BDO) -ll
batchq : batchq.c batchq.h ; $(CC1NULL)

lex.c : lex.l lex.h
$(BDO): batchd.h batchq.h

lint : $(SRC) $H lex.c
	lint -achpx bd_*.c lex.c > lint
	lint -achpx batch.c >> lint
	lint -achpx batchq.c >> lint

% make -n -f bug.mak all lint            # this one is correct
cc  -o alarmd alarmd.c
cc  -c bd_main.c
lex  lex.l
mv lex.yy.c lex.c
cc  -c lex.c
cc  -o batchd bd_main.o lex.o -ll
cc  -o batchq batchq.c
lint -achpx bd_*.c lex.c > lint
lint -achpx batch.c >> lint
lint -achpx batchq.c >> lint

% make -n -f bug.mak lint all           # this one is wrong
lex  lex.l
mv lex.yy.c lex.c
lint -achpx bd_*.c lex.c > lint
lint -achpx batch.c >> lint
lint -achpx batchq.c >> lint
cc  -o lex lex.c                           # should be alarmd
cc  -c bd_main.c
cc  -c lex.c
cc  -o batchd bd_main.o lex.o -ll
cc  -o lex lex.c                           # should be batchq


Jim Leinweber   			usenet:  jiml@uwslh.uucp
State Hygiene Laboratory        	  {seismo, harvard, topaz, ihnp4,...}!
University of Wisconsin			  uwvax!uwslh!jiml
465 Henry Mall				internet:    uwslh!jiml@wisc.edu
Madison, Wisconsin, USA  53706		phone:   (608) 262-8092
-- 
James E. Leinweber   ...!{seismo,harvard,topaz,ihnp4}!uwvax!uwslh!jiml
Wisconsin State Hygiene Lab          (608) 262-8092
University of Wisconsin; 465 Henry Mall; Madison, WI  53706
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads