From patchwork Fri May 7 10:09:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 51910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 67EC6B7D5C for ; Fri, 7 May 2010 23:43:03 +1000 (EST) Received: from localhost ([127.0.0.1]:53841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OANpT-0005YX-TW for incoming@patchwork.ozlabs.org; Fri, 07 May 2010 09:43:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OANXb-0001GH-Sm for qemu-devel@nongnu.org; Fri, 07 May 2010 09:24:32 -0400 Received: from [140.186.70.92] (port=49880 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OANXU-0008PH-PQ for qemu-devel@nongnu.org; Fri, 07 May 2010 09:24:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAKVG-0003q4-Qy for qemu-devel@nongnu.org; Fri, 07 May 2010 06:10:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11239) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAKVG-0003pa-HZ; Fri, 07 May 2010 06:09:54 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o47A9r9K003107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 May 2010 06:09:53 -0400 Received: from zweiblum.home.kraxel.org (vpn1-6-164.ams2.redhat.com [10.36.6.164]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o47A9owL029350; Fri, 7 May 2010 06:09:50 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 82FBE12002; Fri, 7 May 2010 12:09:47 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org, vgabios-developers@nongnu.org Date: Fri, 7 May 2010 12:09:43 +0200 Message-Id: <1273226987-10066-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 1/5] Makefile cleanup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Use a single rule for building bios binaries. Use target specific variables to set compile flags. This makes it more obvious what the differences between the versions are. It also makes it easier to add new bios binaries with slightly different settings. Signed-off-by: Gerd Hoffmann --- Makefile | 76 +++++++++++++++++++++++++++---------------------------------- 1 files changed, 34 insertions(+), 42 deletions(-) diff --git a/Makefile b/Makefile index 00e8c66..c3c744c 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,7 @@ VGABIOS_DATE = "-DVGABIOS_DATE=\"$(RELDATE)\"" all: bios cirrus-bios - -bios: biossums vgabios.bin vgabios.debug.bin +bios: vgabios.bin vgabios.debug.bin cirrus-bios: vgabios-cirrus.bin vgabios-cirrus.debug.bin @@ -27,6 +26,39 @@ clean: dist-clean: clean +# source files +VGA_FILES := vgabios.c vgabios.h vgafonts.h vgatables.h +VBE_FILES := vbe.h vbe.c vbetables.h + +# build flags +vgabios.bin : VGAFLAGS := -DVBE +vgabios.debug.bin : VGAFLAGS := -DVBE -DDEBUG +vgabios-cirrus.bin : VGAFLAGS := -DCIRRUS -DPCIBIOS +vgabios-cirrus.debug.bin : VGAFLAGS := -DCIRRUS -DPCIBIOS -DCIRRUS_DEBUG + +# dist names +vgabios.bin : DISTNAME := VGABIOS-lgpl-latest.bin +vgabios.debug.bin : DISTNAME := VGABIOS-lgpl-latest.debug.bin +vgabios-cirrus.bin : DISTNAME := VGABIOS-lgpl-latest.cirrus.bin +vgabios-cirrus.debug.bin : DISTNAME := VGABIOS-lgpl-latest.cirrus.debug.bin + +# dependencies +vgabios.bin : $(VGA_FILES) $(VBE_FILES) biossums +vgabios.debug.bin : $(VGA_FILES) $(VBE_FILES) biossums +vgabios-cirrus.bin : $(VGA_FILES) clext.c biossums +vgabios-cirrus.debug.bin : $(VGA_FILES) clext.c biossums + +# build rule +%.bin: + $(GCC) -E -P vgabios.c $(VGABIOS_VERS) $(VGAFLAGS) $(VGABIOS_DATE) > _$*_.c + $(BCC) -o $*.s -C-c -D__i86__ -S -0 _$*_.c + sed -e 's/^\.text//' -e 's/^\.data//' $*.s > _$*_.s + $(AS86) _$*_.s -b $*.bin -u -w- -g -0 -j -O -l $*.txt + rm -f _$*_.s _$*_.c $*.s + mv $*.bin $(DISTNAME) + ./biossums $(DISTNAME) + ls -l $(DISTNAME) + release: VGABIOS_VERS=\"-DVGABIOS_VERS=\\\"$(RELVERS)\\\"\" make bios cirrus-bios /bin/rm -f *.o *.s *.ld86 \ @@ -37,46 +69,6 @@ release: cp VGABIOS-lgpl-latest.cirrus.debug.bin ../$(RELEASE).cirrus.debug.bin tar czvf ../$(RELEASE).tgz --exclude CVS -C .. $(RELEASE)/ -vgabios.bin: vgabios.c vgabios.h vgafonts.h vgatables.h vbe.h vbe.c vbetables.h - $(GCC) -E -P vgabios.c $(VGABIOS_VERS) -DVBE $(VGABIOS_DATE) > _vgabios_.c - $(BCC) -o vgabios.s -C-c -D__i86__ -S -0 _vgabios_.c - sed -e 's/^\.text//' -e 's/^\.data//' vgabios.s > _vgabios_.s - $(AS86) _vgabios_.s -b vgabios.bin -u -w- -g -0 -j -O -l vgabios.txt - rm -f _vgabios_.s _vgabios_.c vgabios.s - mv vgabios.bin VGABIOS-lgpl-latest.bin - ./biossums VGABIOS-lgpl-latest.bin - ls -l VGABIOS-lgpl-latest.bin - -vgabios.debug.bin: vgabios.c vgabios.h vgafonts.h vgatables.h vbe.h vbe.c vbetables.h - $(GCC) -E -P vgabios.c $(VGABIOS_VERS) -DVBE -DDEBUG $(VGABIOS_DATE) > _vgabios-debug_.c - $(BCC) -o vgabios-debug.s -C-c -D__i86__ -S -0 _vgabios-debug_.c - sed -e 's/^\.text//' -e 's/^\.data//' vgabios-debug.s > _vgabios-debug_.s - $(AS86) _vgabios-debug_.s -b vgabios.debug.bin -u -w- -g -0 -j -O -l vgabios.debug.txt - rm -f _vgabios-debug_.s _vgabios-debug_.c vgabios-debug.s - mv vgabios.debug.bin VGABIOS-lgpl-latest.debug.bin - ./biossums VGABIOS-lgpl-latest.debug.bin - ls -l VGABIOS-lgpl-latest.debug.bin - -vgabios-cirrus.bin: vgabios.c vgabios.h vgafonts.h vgatables.h clext.c - $(GCC) -E -P vgabios.c $(VGABIOS_VERS) -DCIRRUS -DPCIBIOS $(VGABIOS_DATE) > _vgabios-cirrus_.c - $(BCC) -o vgabios-cirrus.s -C-c -D__i86__ -S -0 _vgabios-cirrus_.c - sed -e 's/^\.text//' -e 's/^\.data//' vgabios-cirrus.s > _vgabios-cirrus_.s - $(AS86) _vgabios-cirrus_.s -b vgabios-cirrus.bin -u -w- -g -0 -j -O -l vgabios.cirrus.txt - rm -f _vgabios-cirrus_.s _vgabios-cirrus_.c vgabios-cirrus.s - mv vgabios-cirrus.bin VGABIOS-lgpl-latest.cirrus.bin - ./biossums VGABIOS-lgpl-latest.cirrus.bin - ls -l VGABIOS-lgpl-latest.cirrus.bin - -vgabios-cirrus.debug.bin: vgabios.c vgabios.h vgafonts.h vgatables.h clext.c - $(GCC) -E -P vgabios.c $(VGABIOS_VERS) -DCIRRUS -DCIRRUS_DEBUG -DPCIBIOS $(VGABIOS_DATE) > _vgabios-cirrus-debug_.c - $(BCC) -o vgabios-cirrus-debug.s -C-c -D__i86__ -S -0 _vgabios-cirrus-debug_.c - sed -e 's/^\.text//' -e 's/^\.data//' vgabios-cirrus-debug.s > _vgabios-cirrus-debug_.s - $(AS86) _vgabios-cirrus-debug_.s -b vgabios.cirrus.debug.bin -u -w- -g -0 -j -O -l vgabios.cirrus.debug.txt - rm -f _vgabios-cirrus-debug_.s _vgabios-cirrus-debug_.c vgabios-cirrus-debug.s - mv vgabios.cirrus.debug.bin VGABIOS-lgpl-latest.cirrus.debug.bin - ./biossums VGABIOS-lgpl-latest.cirrus.debug.bin - ls -l VGABIOS-lgpl-latest.cirrus.debug.bin - biossums: biossums.c $(CC) -o biossums biossums.c