This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: make capabilities



On 1 Mar 2001, J.T. Conklin wrote:

> Is it safe to assume that all versions of make used to build GDB will
> understand the ${FOO:.c=.o} construct?  It does not appear to be used
> elsewhere in the GDB or binutils trees, so it is possible (maybe even
> likely) that they do not.  But I do not know how to solve a problem
> without it.
> 
> The problem is the "lint" target:
> 
>         lint:   $(LINTFILES)
>                 $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
>                    `echo $(DEPFILES) | sed 's/\.o /\.c /g'`
> 
> If srcdir != objdir, lint is not able to find the source files.  This
> can be fixed if the rule is re-written as such:
> 
>         lint:   $(LINTFILES) $(DEPFILES:.c=.o)
>                 $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $^
> 
> Thoughts?

I can suggest two thoughts:

  1. The current Emacs distribution uses $(FOO:.x=.y) in its Makefile's.  
     While this version is not yet released, its pretest was tested on 
     many different systems, and none failed to build it.

  2. However, it _is_ known that not all versions of Make support that 
     construct.  If you want to be 100% portable, you can edit .c into .o 
     with `sed` invocation in the rule's commands.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]