[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | DIGITAL UNIX (FORMERLY KNOWN AS DEC OSF/1) |
Notice: | Welcome to the Digital UNIX Conference |
Moderator: | SMURF::DENHAM |
|
Created: | Thu Mar 16 1995 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 10068 |
Total number of notes: | 35879 |
9115.0. "Problem observed with Make on 3.2 and 4.0 (not seen with GNU make)" by BEGIN::ROTITHOR () Tue Mar 11 1997 17:38
While compiling a large benchmark I observed the following problem with make
on digital Unix (both 3.2 and 4.0), I am not sure that this the right
behavior, will appreciate any comments.
I have reduced the problem below.
I tried the same example with GNU make (gmake) and the problem does not
show up there (output attached).
The problem is: in a make file, if I include a file in a directory one level
up and that included file includes a file from my original directory, then
for the second file being included, make looks up in the directory one
level up instead of looking in the same dir where make command was
invoked.
I have given a reproducible example below.
directory structure for the example:
current dir files: Makefile Make.lst hello.cxx
files in dir one level up: Make.src
Actual file contents:
enum.zko.dec.com> cat Makefile
include ../Make.src
enum.zko.dec.com> cat Make.lst
OBJECTS = \
hello.o
enum.zko.dec.com> cat hello.cxx
#include <stdio.h>
main ()
{
int x;
for(x=0;x<1000000;x++)
printf("Hello %d\n",x);
return 0;
}
enum.zko.dec.com> cat ../Make.src
CC = cxx
CFLAGS = -O
.SUFFIXES: .cxx
include Make.lst
.cxx.o:
$(CC) $(CFLAGS) -c $<
all: $(OBJECTS)
$(CC) $(OBJECTS) -o $@
enum.zko.dec.com> uname -a
OSF1 enum.zko.dec.com V4.0 386 alpha
enum.zko.dec.com> make -f Makefile
Make: Cannot open ../Make.lst. Stop.
(This is the problem, it looks for Make.lst in ../ instead of ./)
The make -f Makefile command is run in the same dir in which Makefile
exists.
With Gnu Make:
sdtad.zko.dec.com> gmake -f Makefile
cxx -O -c hello.cxx
cxx hello.o -o all
T.R | Title | User | Personal Name | Date | Lines
|
---|