🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.misc
Article #134

bug in make

#134
From: Brian Wallis
Date: Fri, 22 Jul 1988 07:46
90 lines
2730 bytes
Is this a bug in make, or am I just missing something obvious?
The simple example for the make file is as follows...

| 
| exe: file1.o
| 	ld -o exe file1.o
| 
| file1.o: dir1/file1.c
| 

'Makefile' is in '.' and the file 'file1.c' is in './dir1'

I want to make the file 'exe' from 'file1.o' in '.' where 'file1.o'
depends on './dir1/file1.c' as is stated in the Makefile. I expect
the default '.c.o:' rule to be used to generate the file 'file1.o'
from ./dir1/file1.c.

I can get this to work by including an explicit rule for the
'file1.o' dependency, but this is a little awkward since I use mkdep
to generate the dependancies and have a large number of source files in
a large number of subdirectories.

Here is the output from the make with debug on (and ignore errors, the
bug still exists without -i, but the debuging is truncated).

*** Note: that file1.o DOES NOT exist but a time is returned which
          is later that that returned for dir1/file1.c !!! ***

| 
| 127% ls -l
| total 2
| -rw-r-----  1 brw            65 Jul 22 17:23 Makefile
| drwxr-x---  2 brw           512 Jul 22 17:17 dir1
| 128% ls -l dir1
| total 1
| -rw-r-----  1 brw            87 Jul 22 14:51 file1.c
| 129% make -d -i exe
| doname(exe,0)
| doname(file1.o,1)
| doname(dir1/file1.c,2)
| TIME(dir1/file1.c)=585550307
| TIME(file1.o)=585559519    <<< where the hell does this time come from!!!!
| ld  -o exe file1.o
| ld:file1.o: cannot open
| *** Error code 4 (ignored)
| Open directories:
| 	4: .
| 	3: dir1
| Macros:
| 	? = file1.o
| 	@ = 
| 	* = file1

.... (deleted stuff)

| dir1/file1.c  done=2
| 
| file1.o:  done=2
|  depends on: dir1/file1.c 
| 
| exe:  done=2  (MAIN NAME)
|  depends on: file1.o 
|  commands:
| 	ld $(LFLAGS) -o exe file1.o

... (deleted stuff)

| .c.o:  done=0
|  commands:
| 	$(CC) $(CFLAGS) -c $<

... (deleted stuff)

| .SUFFIXES:  done=0
|  depends on: .out  .o  .c  .F  .f  .e  .r  .y  .yr  .ye  .l  .s  .cl  .p 

Can someone with source help out here???

I have tried this on...

MicroVax running Ultrix 2.0
Sun 3/110 running SunOS 3.2
Altos 586 running Xenix 3.0

with the same results each time (minor differences in debugging output).
-- 
Brian Wallis (brw@jim.odr.oz)		    O'Dowd Research P/L.
	(03) 562-0100 Fax: (03) 562-0616,
	Telex: Jacobs Radio (Bayswater) 152093
Technical Details
Message-ID: <525@jim.odr.oz>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!munnari!moncskermit!goanna!yabbie!koel!cit5!olympic!jim!brw

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!munnari!moncskermit!goanna!yabbie!koel!cit5!olympic!jim!brw
From: brw@jim.odr.oz (Brian Wallis)
Newsgroups: comp.bugs.misc
Subject: bug in make
Keywords: make subdirectories BUG
Message-ID: <525@jim.odr.oz>
Date: 22 Jul 88 07:46:40 GMT
Organization: O'Dowd Research Pty. Ltd., Melbourne, Australia.
Lines: 90