tech-toolchain archive

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

Re: make: avoid breaking backwards compatability



On Fri, Sep 05, 2014 at 12:36:18AM +0200, Alan Barrett wrote:
> We do want to consistently override on a file by file basis. There might 
> be a foo.c and bar.c with portable code, and several different foo.S and 
> bar.S in different subdirectories for different machine platforms or 
> different optimisation strategies. We want to tell make exactly which .S 
> file or .c file to use, using conditions depending on the machine 
> platform, and foo and bar could easily want different conditional 
> choices.

Please somebody tell me why are you people so dead set against using
a directory in the dependency?  It would explicitly remove all ambiguity
and would not rely on implementation specific tricks.

What is wrong with (not intended to be syntactically correct):

    .if arch = arch1
    exe: arch1/foo.o
    .elif arch = arch2
    exe: arch2/foo.o
    .else
    exe: foo.o
    .fi

or

    .if exists(${arch}/foo.S)
    exe: ${arch}/foo.o
    .else
    exe: foo.o
    .fi

Ok, this still relies on the implementation specific .if, but that would
have to be used anyway, if you want to pick and choose based on
the configuration, right?  Unless there was a makefile for every
possible configuration...

All the files are in the same directory?  Make a new directory then,
it is not like they're some scarce resource that needs to be preserved.

-- 
Jarmo Jaakkola


Home | Main Index | Thread Index | Old Index