2020-02-16 12:19:01 +03:00
|
|
|
# Copyright (C) 2001-2020 The Bochs Project
|
2001-04-10 05:04:59 +04:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
2012-07-14 11:01:43 +04:00
|
|
|
SHELL = @SHELL@
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
@SET_MAKE@
|
|
|
|
|
|
|
|
CXX = @CXX@
|
2002-10-04 10:08:38 +04:00
|
|
|
CXXFLAGS = @CXXFLAGS@
|
2021-09-10 18:33:22 +03:00
|
|
|
CPPFLAGS = @CPPFLAGS@
|
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
|
2020-02-16 12:19:01 +03:00
|
|
|
GCC32 = gcc -m32 -march=i386 -fno-stack-protector
|
2021-09-10 18:33:22 +03:00
|
|
|
LD32 = ld
|
|
|
|
OBJCOPY32 = objcopy
|
2005-04-30 15:11:16 +04:00
|
|
|
AS86 = as86
|
2019-12-30 16:16:18 +03:00
|
|
|
IASL = @IASL@
|
2005-04-30 15:11:16 +04:00
|
|
|
|
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 =
|
|
|
|
|
2019-12-30 16:16:18 +03:00
|
|
|
UPSTREAM_RELEASE_DATE = $(shell grep "Updated:" ../README | sed 's/Updated://')
|
2020-06-20 19:40:50 +03:00
|
|
|
BUILDDATE = `date -u -d '$(UPSTREAM_RELEASE_DATE)' '+%m/%d/%y'`
|
2005-04-30 15:11:16 +04:00
|
|
|
BIOS_BUILD_DATE = "-DBIOS_BUILD_DATE=\"$(BUILDDATE)\""
|
2001-04-10 05:04:59 +04:00
|
|
|
#
|
|
|
|
# -------- end configurable options --------------------------
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
.@CPP_SUFFIX@.o:
|
2021-09-10 18:33:22 +03:00
|
|
|
$(CXX) -c $(BX_INCDIRS) $(CPPFLAGS) $(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
|
2019-12-30 16:16:18 +03:00
|
|
|
@RMCOMMAND@ acpt-dsdt.aml
|
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
|
2021-09-10 18:33:22 +03:00
|
|
|
$(OBJCOPY32) -O binary $< $@
|
2006-09-28 23:01:04 +04:00
|
|
|
./biossums -pad $@
|
|
|
|
|
|
|
|
rombios32.out: rombios32start.o rombios32.o rombios32.ld
|
2021-09-10 18:33:22 +03:00
|
|
|
$(LD32) -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
|
|
|
|
2019-12-30 16:16:18 +03:00
|
|
|
ifneq ($(IASL), not_found)
|
2006-09-28 23:01:04 +04:00
|
|
|
acpi-dsdt.hex: acpi-dsdt.dsl
|
2008-12-27 20:23:23 +03:00
|
|
|
cpp -P $< $<.i
|
|
|
|
iasl -tc -p $@ $<.i
|
|
|
|
rm $<.i
|
2020-01-08 21:15:01 +03:00
|
|
|
sed -i -e's/^unsigned/const unsigned/;s/ACPI-DSDT_HEX/ACPI_DSDT_HEX/g;s/acpi-dsdt_aml_code/AmlCode/g' $@
|
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
|