From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31694 invoked by alias); 5 Oct 2009 13:17:13 -0000 Received: (qmail 31683 invoked by uid 22791); 5 Oct 2009 13:17:12 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Oct 2009 13:17:07 +0000 Received: from relay1.suse.de (mail2.suse.de [195.135.221.8]) by mx2.suse.de (Postfix) with ESMTP id 541A986391; Mon, 5 Oct 2009 15:17:04 +0200 (CEST) Date: Mon, 05 Oct 2009 13:17:00 -0000 From: Michael Matz To: Paul Edwards Cc: Ian Lance Taylor , gcc@gcc.gnu.org Subject: Re: i370 port - constructing compile script In-Reply-To: <01EDD002E9184163A5A91409025429D6@Paullaptop> Message-ID: References: <200909251516.n8PFGPYn014618@d12av02.megacenter.de.ibm.com><4F1842D6879348899E3A1999066969F5@Paullaptop><4AC39435.8010902@redhat.com><36D486ECFFC04FBD8318DFDD333FD206@Paullaptop><7AE4510479514D0E9B72A9B827275199@Paullaptop><77AE26D4B4604E1EB60B7B6152EA9FD4@Paullaptop> <01EDD002E9184163A5A91409025429D6@Paullaptop> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg00088.txt.bz2 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.