Hi,
On Sun, 4 Oct 2009, Paul Edwards wrote:
> With 3.4.6, I have a script called "compile", which looks like this:
>
> call stdcomp alias.c %1 %2 %3 %4 %5 %6 %7 %8 %9
> call stdcomp alloc-pool.c %1 %2 %3 %4 %5 %6 %7 %8 %9
> call stdcomp attribs.c %1 %2 %3 %4 %5 %6 %7 %8 %9
> call stdcomp bb-reorder.c %1 %2 %3 %4 %5 %6 %7 %8 %9
> call stdcomp bitmap.c %1 %2 %3 %4 %5 %6 %7 %8 %9
> call stdcomp bt-load.c %1 %2 %3 %4 %5 %6 %7 %8 %9
> ...
> gcc -s -nostdlib -o gccmvs.exe *.o ../../pdos/pdpclib/pdpwin32.a -lkernel32
>
> I believe that a simple script like above can be *generated* with a few
> lines of changes to an appropriate makefile. That's why I mentioned
> before that I'm after a makefile target that only lists the object code
> that would go into a stage 1 executable.
Ignoring the cross stuff, if this is all you need I would suggest calling
make in the right way to generate this script. We'll use a fake
"compiler" for making cc1 which does nothing else than appending its
command line to your compile script. Hence, create a script
collect-stuff.sh with this content:
-------- snip ----------
#!/bin/sh
echo stdcomp ${1+"$@"} >> /tmp/compile
-------- snap ----------
Now we'll call make so that it only tries to make cc1 with this compiler
to collect the commands:
% cd gcc
% make CC=collect-stuff.sh cc1
/tmp/compile will now fill up with the commands to use. If you don't need
the various options, also add "ALL_COMPILERFLAGS= ALL_CPPFLAGS=" to the
make command (might be other variable names in the old 4.x compilers), or
amend the collect-stuff.sh script to not echo them.
Remember to clean the build dir before doing this as otherwise some .o
files aren't remade.
Ciao,
Michael.