help-make
[Top][All Lists]
Advanced

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

Re: Multiple files different flags needed


From: Paul D. Smith
Subject: Re: Multiple files different flags needed
Date: Tue, 25 Jul 2006 11:21:43 -0400

%% Anoneironaut <address@hidden> writes:

  a> Here is my situation.  I'm trying to make a bunch of files into a
  a> single executable.  Most of these files compile and link with a
  a> uniform set of flags.  However there are 2 or 3 files which have
  a> different flags.  What I tried to do to make this work was to
  a> define a pattern rule and then define these files hoping that they
  a> would override the pattern rule:

They will.  Another option (if you have a new-enough version of make) is
to use target-specific variables to add or change certain flags for some
targets.

  a> # General Rules for making
  a> %.r37:%.c
  a>    $(COMP) $(CFLAGS) $<

  a> %.r37:%.C
  a>    $(COMP) $(CFLAGS) $<

  a> Test.d37: $(R37FILES)
  a>           $(LNK) $(XFLAGS) $(R37FILES)
          
  a> # Special Makes

  a> Heap.r37 : Heap.c
  a>          $(COMP) $(HEAPFLAGS) Heap.c

There's nothing wrong with this that I can see.  It will do as you intend.

  a> However when I try this I get a "multiple target patterns" error.

Sorry, but there's nothing in the makefile snippet above that would lead
to that kind of error.

When asking for help, please _always_ include the full and exact error
message (cut and paste is best).  Also, it's best if you can reproduce
the problem with a small, sample makefile that doesn't use any special
tools (you can use touch, etc. to simulate commands) and include that.
Finally, GNU make will print a line number with the error: please point
out which line make thinks is wrong.

And of course always remember to include the version of the program (GNU
make in this case) you're using, plus the operating system name and
version.

-- 
-------------------------------------------------------------------------------
 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]