🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49855

Getting Makefile to properly support VPATH

#49855
From: Mark Nelson
Date: Thu, 16 Dec 1993 20:18
40 lines
2264 bytes
I'm in the process of creating a modified version of GCC 2.5.6 for my
research, and in order to cut down on clutter I'm using VPATH to allow
me to put only my modified source in my directory, using our normal
system GCC source directory for the rest.  Unfortunately, some parts
of the Makefile generated by configure are broken when I try this.

Note:  using VPATH to compile in a separate directory is claimed to
work--see the info page for gcc/Installation/Other Dir.

Anyway, most of what is broken in the Makefile seems to be broken
unnecessarily.  For example, the rules for insn-emit.o, insn-recog.o, 
insn-opinit.o, insn-extract.o insn-peep.o, insn-attrtab.o, and 
insn-output.o have explicit command lines all similar to

	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c

which should just do the default, which is:

.c.o:
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

Also, c-parse.y, c-parse.c, and c-parse.h are all built in the source
directory with the current Makefile, instead of in the build directory.

Finally, the rule for enquire:

enquire: enquire.o $(GCC_PARTS)
	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@

attempts to put enquire into the source directory--changing the $@ to
enquire would seem to be the right thing.

There may be other problems, but these are all I've found so far.  Are
there problems with my changes?  I'm certainly not a Makefile guru.
-- 
This function is occasionally useful as an argument to other functions
which require functions as arguments.-- Guy Steele Jr. CLTL

Mark Nelson                                       mnelson@cis.udel.edu
Technical Details
Message-ID: <2eqfqg$inn@louie.udel.edu>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!darwin.sura.net!udel!mr_slate.cis.udel.edu!mnelson

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,8f5f0b0a88b456d0,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-12-16 13:18:07 PST
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!darwin.sura.net!udel!mr_slate.cis.udel.edu!mnelson
From: mnelson@mr_slate.cis.udel.edu (Mark Nelson)
Newsgroups: gnu.gcc.help
Subject: Getting Makefile to properly support VPATH
Date: 16 Dec 1993 20:18:24 GMT
Organization: University of Delaware, Newark
Lines: 40
Message-ID: <2eqfqg$inn@louie.udel.edu>
NNTP-Posting-Host: mr_slate.cis.udel.edu