1# Copyright (C) 2001 MandrakeSoft S.A. 2# 3# MandrakeSoft S.A. 4# 43, rue d'Aboukir 5# 75002 Paris - France 6# http://www.linux-mandrake.com/ 7# http://www.mandrakesoft.com/ 8# 9# This library is free software; you can redistribute it and/or 10# modify it under the terms of the GNU Lesser General Public 11# License as published by the Free Software Foundation; either 12# version 2 of the License, or (at your option) any later version. 13# 14# This library is distributed in the hope that it will be useful, 15# but WITHOUT ANY WARRANTY; without even the implied warranty of 16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17# Lesser General Public License for more details. 18# 19# You should have received a copy of the GNU Lesser General Public 20# License along with this library; if not, write to the Free Software 21# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 23# Makefile for the BIOS component of bochs 24 25 26@SUFFIX_LINE@ 27 28srcdir = @srcdir@ 29VPATH = @srcdir@ 30 31SHELL = /bin/sh 32 33@SET_MAKE@ 34 35CXX = @CXX@ 36CXXFLAGS = @CXXFLAGS@ 37 38LDFLAGS = @LDFLAGS@ 39LIBS = @LIBS@ 40RANLIB = @RANLIB@ 41 42BCC = bcc 43GCC = gcc 44GCC32 = gcc -m32 -fno-stack-protector 45AS86 = as86 46 47BX_INCDIRS = -I.. -I$(srcdir)/.. -I../iodev -I$(srcdir)/../iodev 48LOCAL_CXXFLAGS = 49 50BUILDDATE = `date '+%m/%d/%y'` 51BIOS_BUILD_DATE = "-DBIOS_BUILD_DATE=\"$(BUILDDATE)\"" 52# 53# -------- end configurable options -------------------------- 54# 55 56 57.@CPP_SUFFIX@.o: 58 $(CXX) -c $(BX_INCDIRS) $(CXXFLAGS) $(LOCAL_CXXFLAGS) @CXXFP@$< @OFP@$@ 59 60 61bios: biossums BIOS-bochs-latest BIOS-bochs-legacy 62 63clean: 64 @RMCOMMAND@ *.o *.a *.s _rombios*_.c rombios*.txt rombios*.sym 65 @RMCOMMAND@ usage biossums rombios16.bin 66 @RMCOMMAND@ rombios32.bin rombios32.out 67 68dist-clean: clean 69 @RMCOMMAND@ Makefile 70 71bios-clean: 72 @RMCOMMAND@ BIOS-bochs-* 73 74BIOS-bochs-legacy: rombios.c apmbios.S biossums rombios.h 75 $(GCC32) $(BIOS_BUILD_DATE) -DLEGACY -E -P $< > _rombiosl_.c 76 $(BCC) -o rombiosl.s -C-c -D__i86__ -0 -S _rombiosl_.c 77 sed -e 's/^\.text//' -e 's/^\.data//' rombiosl.s > _rombiosl_.s 78 $(AS86) _rombiosl_.s -b tmpl.bin -u- -w- -g -0 -j -O -l rombiosl.txt 79 -perl ${srcdir}/makesym.perl < rombiosl.txt > rombiosl.sym 80 mv tmpl.bin $@ 81 ./biossums $@ 82 @RMCOMMAND@ _rombiosl_.s 83 84 85rombios16.bin: rombios.c apmbios.S biossums rombios.h 86 $(GCC32) $(BIOS_BUILD_DATE) -E -P $< > _rombios_.c 87 $(BCC) -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c 88 sed -e 's/^\.text//' -e 's/^\.data//' rombios.s > _rombios_.s 89 $(AS86) _rombios_.s -b tmp.bin -u- -w- -g -0 -j -O -l rombios.txt 90 -perl ${srcdir}/makesym.perl < rombios.txt > rombios.sym 91 mv tmp.bin rombios16.bin 92 ./biossums rombios16.bin 93 @RMCOMMAND@ _rombios_.s 94 95 96rombios32.bin: rombios32.out rombios.h 97 objcopy -O binary $< $@ 98 ./biossums -pad $@ 99 100rombios32.out: rombios32start.o rombios32.o rombios32.ld 101 ld -o $@ -T $(srcdir)/rombios32.ld rombios32start.o rombios32.o 102 103rombios32.o: rombios32.c acpi-dsdt.hex 104 $(GCC32) -O2 -Wall -c -o $@ $< 105 106ifeq ("1", "0") 107acpi-dsdt.hex: acpi-dsdt.dsl 108 cpp -P $< $<.i 109 iasl -tc -p $@ $<.i 110 rm $<.i 111 sed -i -e's/^unsigned/const unsigned/' $@ 112endif 113 114rombios32start.o: rombios32start.S 115 $(GCC32) -c -o $@ $< 116 117BIOS-bochs-latest: rombios16.bin rombios32.bin 118 cat rombios32.bin rombios16.bin > $@ 119 120biossums: biossums.o 121