make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATSUBST and FILTER help


From: Paul D. Smith
Subject: Re: PATSUBST and FILTER help
Date: Tue, 5 Aug 2003 00:23:32 -0400

%% Wehr Bruce <address@hidden> writes:

  wb> I have a makefile (attached) it used to build 3 different "flavors" of
  wb> menu code.  In order to build a list of object file needed to for each
  wb> flavor, I use the following cryptic command (this should be right up
  wb> your ally):

  wb>   OBJS=     $(patsubst %.c,%.obj,$(filter %.c,$(CFILES))) \
  wb>             $(patsubst %.asm,%.obj,$(filter %.asm,$(AFILES)))

  wb> The rule to make all the objects is as follows:

  wb>       %.obj: %.c $(HFILES)
  wb>             $(CC) $(FLAGS) $< $(CPU) $(CFLAGS) $(ST10DEF)

  wb>       %.obj: %.asm
  wb>             $(CC) $(FLAGS) $< $(ASMFLAGS) $(ST10DEF)

  wb> Now, everything works fine UNLESS there is currently no .OBJ file
  wb> for a corresponding .C or .ASM file!  In this case I get the error
  wb> message: No rule to make foo.obj needed by MenuXXX.out.  If
  wb> foo.obj already exists, it will recompile foo.c just fine.  This
  wb> is very perplexing.

It could be one of two things (at least...)  There isn't enough
information given to rule out the first, and I don't know enough about
how Windows handles these things to rule out the second.

The first is that he's creating the objects in a different directory
than the current working directory, and using (or trying to use) VPATH
to find them.  That's a no-no; there's a paper on my site (below)
describing the right way to use VPATH.

The second is that he's got case-sensitivity problems.  GNU make is a
UNIX tool and as such expects to be case-sensitive; Windows filesystems
are not case-sensitive generally.

So, if you have a rule that can create a .obj from a .asm, but you have
a .ASM file instead, then that won't match.  Maybe.  There's some
information about this in the README.W32 file in the GNU make
distribution, that might help.  Or, someone else on this list might have
a better idea/more information.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]