2001-04-10 06:20:02 +04:00
|
|
|
# Copyright (C) 2001 MandrakeSoft S.A.
|
2001-04-10 05:04:59 +04: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 12:05:52 +03:00
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
# Makefile for the BIOS component of bochs
|
|
|
|
|
|
|
|
|
|
|
|
@SUFFIX_LINE@
|
|
|
|
|
2001-09-14 08:19:08 +04:00
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
SHELL = /bin/sh
|
|
|
|
|
|
|
|
@SET_MAKE@
|
|
|
|
|
|
|
|
CXX = @CXX@
|
2002-10-04 10:08:38 +04:00
|
|
|
CXXFLAGS = @CXXFLAGS@
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
LDFLAGS = @LDFLAGS@
|
|
|
|
LIBS = @LIBS@
|
|
|
|
RANLIB = @RANLIB@
|
|
|
|
|
2005-04-30 15:11:16 +04:00
|
|
|
BCC = bcc
|
|
|
|
GCC = gcc
|
2008-12-20 17:27:22 +03:00
|
|
|
GCC32 = gcc -m32 -fno-stack-protector
|
2005-04-30 15:11:16 +04:00
|
|
|
AS86 = as86
|
|
|
|
|
2001-09-14 08:19:08 +04:00
|
|
|
BX_INCDIRS = -I.. -I$(srcdir)/.. -I../iodev -I$(srcdir)/../iodev
|
2001-04-10 05:04:59 +04:00
|
|
|
LOCAL_CXXFLAGS =
|
|
|
|
|
2005-04-30 15:11:16 +04:00
|
|
|
BUILDDATE = `date '+%m/%d/%y'`
|
|
|
|
BIOS_BUILD_DATE = "-DBIOS_BUILD_DATE=\"$(BUILDDATE)\""
|
2001-04-10 05:04:59 +04:00
|
|
|
#
|
|
|
|
# -------- end configurable options --------------------------
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
.@CPP_SUFFIX@.o:
|
2002-10-25 01:07:56 +04:00
|
|
|
$(CXX) -c $(BX_INCDIRS) $(CXXFLAGS) $(LOCAL_CXXFLAGS) @CXXFP@$< @OFP@$@
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
|
2008-01-26 12:15:27 +03:00
|
|
|
bios: biossums BIOS-bochs-latest BIOS-bochs-legacy
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
clean:
|
2006-01-13 20:36:27 +03:00
|
|
|
@RMCOMMAND@ *.o *.a *.s _rombios*_.c rombios*.txt rombios*.sym
|
2006-09-28 23:01:04 +04:00
|
|
|
@RMCOMMAND@ usage biossums rombios16.bin
|
|
|
|
@RMCOMMAND@ rombios32.bin rombios32.out
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2002-12-13 02:55:34 +03:00
|
|
|
dist-clean: clean
|
2001-04-10 05:04:59 +04:00
|
|
|
@RMCOMMAND@ Makefile
|
|
|
|
|
|
|
|
bios-clean:
|
2002-11-14 23:04:38 +03:00
|
|
|
@RMCOMMAND@ BIOS-bochs-*
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2006-10-04 00:30:09 +04:00
|
|
|
BIOS-bochs-legacy: rombios.c apmbios.S biossums rombios.h
|
2007-09-28 00:17:05 +04:00
|
|
|
$(GCC32) $(BIOS_BUILD_DATE) -DLEGACY -E -P $< > _rombiosl_.c
|
2006-10-04 00:30:09 +04: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 17:02:42 +04:00
|
|
|
$(AS86) _rombiosl_.s -b tmpl.bin -u- -w- -g -0 -j -O -l rombiosl.txt
|
2006-10-04 00:30:09 +04:00
|
|
|
-perl ${srcdir}/makesym.perl < rombiosl.txt > rombiosl.sym
|
2007-09-22 17:02:42 +04:00
|
|
|
mv tmpl.bin $@
|
2006-10-04 00:30:09 +04:00
|
|
|
./biossums $@
|
|
|
|
@RMCOMMAND@ _rombiosl_.s
|
|
|
|
|
|
|
|
|
|
|
|
rombios16.bin: rombios.c apmbios.S biossums rombios.h
|
2007-09-28 00:17:05 +04:00
|
|
|
$(GCC32) $(BIOS_BUILD_DATE) -E -P $< > _rombios_.c
|
2005-04-30 15:11:16 +04:00
|
|
|
$(BCC) -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c
|
2001-05-25 02:27:44 +04:00
|
|
|
sed -e 's/^\.text//' -e 's/^\.data//' rombios.s > _rombios_.s
|
2005-04-30 15:11:16 +04:00
|
|
|
$(AS86) _rombios_.s -b tmp.bin -u- -w- -g -0 -j -O -l rombios.txt
|
2002-11-25 01:45:40 +03:00
|
|
|
-perl ${srcdir}/makesym.perl < rombios.txt > rombios.sym
|
2006-09-28 23:01:04 +04:00
|
|
|
mv tmp.bin rombios16.bin
|
|
|
|
./biossums rombios16.bin
|
|
|
|
@RMCOMMAND@ _rombios_.s
|
|
|
|
|
|
|
|
|
2006-10-04 00:30:09 +04:00
|
|
|
rombios32.bin: rombios32.out rombios.h
|
2006-09-28 23:01:04 +04:00
|
|
|
objcopy -O binary $< $@
|
|
|
|
./biossums -pad $@
|
|
|
|
|
|
|
|
rombios32.out: rombios32start.o rombios32.o rombios32.ld
|
2008-12-20 17:27:22 +03:00
|
|
|
ld -o $@ -T $(srcdir)/rombios32.ld rombios32start.o rombios32.o
|
2006-09-28 23:01:04 +04:00
|
|
|
|
2010-02-09 00:25:35 +03:00
|
|
|
rombios32.o: rombios32.c acpi-dsdt.hex rombios.h
|
2007-09-28 00:17:05 +04:00
|
|
|
$(GCC32) -O2 -Wall -c -o $@ $<
|
2006-09-28 23:01:04 +04:00
|
|
|
|
|
|
|
ifeq ("1", "0")
|
|
|
|
acpi-dsdt.hex: acpi-dsdt.dsl
|
2008-12-27 20:23:23 +03:00
|
|
|
cpp -P $< $<.i
|
|
|
|
iasl -tc -p $@ $<.i
|
|
|
|
rm $<.i
|
2008-12-04 21:44:14 +03:00
|
|
|
sed -i -e's/^unsigned/const unsigned/' $@
|
2006-09-28 23:01:04 +04:00
|
|
|
endif
|
|
|
|
|
|
|
|
rombios32start.o: rombios32start.S
|
2007-09-28 00:17:05 +04:00
|
|
|
$(GCC32) -c -o $@ $<
|
2006-09-28 23:01:04 +04:00
|
|
|
|
|
|
|
BIOS-bochs-latest: rombios16.bin rombios32.bin
|
|
|
|
cat rombios32.bin rombios16.bin > $@
|
2002-11-14 23:04:38 +03:00
|
|
|
|
2008-12-20 17:27:22 +03:00
|
|
|
biossums: biossums.o
|