🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.4bsd
Article #1671

glitch in 4.2 BSD make

#1671
From: 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
Technical Details
Message-ID: <143@uwslh.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!uwvax!uwslh!jiml

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!uwvax!uwslh!jiml
From: jiml@uwslh.UUCP (Jim Leinweber)
Newsgroups: net.bugs.4bsd
Subject: glitch in 4.2 BSD make
Message-ID: <143@uwslh.UUCP>
Date: Thu, 11-Sep-86 15:54:44 EDT
Article-I.D.: uwslh.143
Posted: Thu Sep 11 15:54:44 1986
Date-Received: Sun, 14-Sep-86 20:16:22 EDT
Distribution: na
Organization: U of Wisconsin-Madison, State Hygiene Lab
Lines: 64