2001-04-10 02:20:02 +00:00
|
|
|
# Copyright (C) 2001 MandrakeSoft S.A.
|
2001-04-10 01:04:59 +00:00
|
|
|
#
|
|
|
|
# MandrakeSoft S.A.
|
|
|
|
# 43, rue d'Aboukir
|
|
|
|
# 75002 Paris - France
|
|
|
|
# http://www.linux-mandrake.com/
|
|
|
|
# http://www.mandrakesoft.com/
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, write to the Free Software
|
2009-02-08 09:05:52 +00:00
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-04-10 01:04:59 +00:00
|
|
|
|
|
|
|
# Makefile for the BIOS component of bochs
|
|
|
|
|
|
|
|
|
|
|
|
@SUFFIX_LINE@
|
|
|
|
|
2001-09-14 04:19:08 +00:00
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
2001-04-10 01:04:59 +00:00
|
|
|
|
|
|
|
SHELL = /bin/sh
|
|
|
|
|
|
|
|
@SET_MAKE@
|
|
|
|
|
|
|
|
CXX = @CXX@
|
2002-10-04 06:08:38 +00:00
|
|
|
CXXFLAGS = @CXXFLAGS@
|
2001-04-10 01:04:59 +00:00
|
|
|
|
|
|
|
LDFLAGS = @LDFLAGS@
|
|
|
|
LIBS = @LIBS@
|
|
|
|
RANLIB = @RANLIB@
|
|
|
|
|
2005-04-30 11:11:16 +00:00
|
|
|
BCC = bcc
|
|
|
|
GCC = gcc
|
2008-12-20 14:27:22 +00:00
|
|
|
GCC32 = gcc -m32 -fno-stack-protector
|
2005-04-30 11:11:16 +00:00
|
|
|
AS86 = as86
|
|
|
|
|
2001-09-14 04:19:08 +00:00
|
|
|
BX_INCDIRS = -I.. -I$(srcdir)/.. -I../iodev -I$(srcdir)/../iodev
|
2001-04-10 01:04:59 +00:00
|
|
|
LOCAL_CXXFLAGS =
|
|
|
|
|
2005-04-30 11:11:16 +00:00
|
|
|
BUILDDATE = `date '+%m/%d/%y'`
|
|
|
|
BIOS_BUILD_DATE = "-DBIOS_BUILD_DATE=\"$(BUILDDATE)\""
|
2001-04-10 01:04:59 +00:00
|
|
|
#
|
|
|
|
# -------- end configurable options --------------------------
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
.@CPP_SUFFIX@.o:
|
2002-10-24 21:07:56 +00:00
|
|
|
$(CXX) -c $(BX_INCDIRS) $(CXXFLAGS) $(LOCAL_CXXFLAGS) @CXXFP@$< @OFP@$@
|
2001-04-10 01:04:59 +00:00
|
|
|
|
|
|
|
|
2008-01-26 09:15:27 +00:00
|
|
|
bios: biossums BIOS-bochs-latest BIOS-bochs-legacy
|
2001-04-10 01:04:59 +00:00
|
|
|
|
|
|
|
clean:
|
2006-01-13 17:36:27 +00:00
|
|
|
@RMCOMMAND@ *.o *.a *.s _rombios*_.c rombios*.txt rombios*.sym
|
2006-09-28 19:01:04 +00:00
|
|
|
@RMCOMMAND@ usage biossums rombios16.bin
|
|
|
|
@RMCOMMAND@ rombios32.bin rombios32.out
|
2001-04-10 01:04:59 +00:00
|
|
|
|
2002-12-12 23:55:34 +00:00
|
|
|
dist-clean: clean
|
2001-04-10 01:04:59 +00:00
|
|
|
@RMCOMMAND@ Makefile
|
|
|
|
|
|
|
|
bios-clean:
|
2002-11-14 20:04:38 +00:00
|
|
|
@RMCOMMAND@ BIOS-bochs-*
|
2001-04-10 01:04:59 +00:00
|
|
|
|
2006-10-03 20:30:09 +00:00
|
|
|
BIOS-bochs-legacy: rombios.c apmbios.S biossums rombios.h
|
2007-09-27 20:17:05 +00:00
|
|
|
$(GCC32) $(BIOS_BUILD_DATE) -DLEGACY -E -P $< > _rombiosl_.c
|
2006-10-03 20:30:09 +00:00
|
|
|
$(BCC) -o rombiosl.s -C-c -D__i86__ -0 -S _rombiosl_.c
|
|
|
|
sed -e 's/^\.text//' -e 's/^\.data//' rombiosl.s > _rombiosl_.s
|
2007-09-22 13:02:42 +00:00
|
|
|
$(AS86) _rombiosl_.s -b tmpl.bin -u- -w- -g -0 -j -O -l rombiosl.txt
|
2006-10-03 20:30:09 +00:00
|
|
|
-perl ${srcdir}/makesym.perl < rombiosl.txt > rombiosl.sym
|
2007-09-22 13:02:42 +00:00
|
|
|
mv tmpl.bin $@
|
2006-10-03 20:30:09 +00:00
|
|
|
./biossums $@
|
|
|
|
@RMCOMMAND@ _rombiosl_.s
|
|
|
|
|
|
|
|
|
|
|
|
rombios16.bin: rombios.c apmbios.S biossums rombios.h
|
2007-09-27 20:17:05 +00:00
|
|
|
$(GCC32) $(BIOS_BUILD_DATE) -E -P $< > _rombios_.c
|
2005-04-30 11:11:16 +00:00
|
|
|
$(BCC) -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c
|
2001-05-24 22:27:44 +00:00
|
|
|
sed -e 's/^\.text//' -e 's/^\.data//' rombios.s > _rombios_.s
|
2005-04-30 11:11:16 +00:00
|
|
|
$(AS86) _rombios_.s -b tmp.bin -u- -w- -g -0 -j -O -l rombios.txt
|
2002-11-24 22:45:40 +00:00
|
|
|
-perl ${srcdir}/makesym.perl < rombios.txt > rombios.sym
|
2006-09-28 19:01:04 +00:00
|
|
|
mv tmp.bin rombios16.bin
|
|
|
|
./biossums rombios16.bin
|
|
|
|
@RMCOMMAND@ _rombios_.s
|
|
|
|
|
|
|
|
|
2006-10-03 20:30:09 +00:00
|
|
|
rombios32.bin: rombios32.out rombios.h
|
2006-09-28 19:01:04 +00:00
|
|
|
objcopy -O binary $< $@
|
|
|
|
./biossums -pad $@
|
|
|
|
|
|
|
|
rombios32.out: rombios32start.o rombios32.o rombios32.ld
|
2008-12-20 14:27:22 +00:00
|
|
|
ld -o $@ -T $(srcdir)/rombios32.ld rombios32start.o rombios32.o
|
2006-09-28 19:01:04 +00:00
|
|
|
|
|
|
|
rombios32.o: rombios32.c acpi-dsdt.hex
|
2007-09-27 20:17:05 +00:00
|
|
|
$(GCC32) -O2 -Wall -c -o $@ $<
|
2006-09-28 19:01:04 +00:00
|
|
|
|
|
|
|
ifeq ("1", "0")
|
|
|
|
acpi-dsdt.hex: acpi-dsdt.dsl
|
2008-12-27 17:23:23 +00:00
|
|
|
cpp -P $< $<.i
|
|
|
|
iasl -tc -p $@ $<.i
|
|
|
|
rm $<.i
|
2008-12-04 18:44:14 +00:00
|
|
|
sed -i -e's/^unsigned/const unsigned/' $@
|
2006-09-28 19:01:04 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
rombios32start.o: rombios32start.S
|
2007-09-27 20:17:05 +00:00
|
|
|
$(GCC32) -c -o $@ $<
|
2006-09-28 19:01:04 +00:00
|
|
|
|
|
|
|
BIOS-bochs-latest: rombios16.bin rombios32.bin
|
|
|
|
cat rombios32.bin rombios16.bin > $@
|
2002-11-14 20:04:38 +00:00
|
|
|
|
2008-12-20 14:27:22 +00:00
|
|
|
biossums: biossums.o
|