1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
## Process this file with automake to produce Makefile.in
# $Id: Makefile.am,v 1.24 2009-04-03 19:13:27 vrsieh Exp $
#
# Copyright (C) 2005-2009 FAUmachine Team <info@faumachine.org>.
#
# This program is free software. You can redistribute it and/or modify it
# under the terms of the GNU General Public License, either version 2 of
# the License, or (at your option) any later version. See COPYING.
CONFIG = \
-DCONFIG_80286_SUPPORT
INCLUDE = -I. -I../vgabios -I.. -I../..
CFLAGS = $(filter-out -g, $(filter-out -finline-limit-100000, $(filter-out -O2,@CFLAGS@))) -Os -fomit-frame-pointer -mpreferred-stack-boundary=2 --freestanding -falign-functions=15 $(INCLUDE) $(CONFIG)
CCASFLAGS = $(CONFIG)
if HOST_X86_64
CCASFLAGS += -m32
CFLAGS += -m32
endif
MAPFILE = vgabios.map
LINK_SCRIPT = vgabios.lds.in
# little trick to compile & assemble with gcc.pl
CC = ./gcc.pl "@FAUCC@ -b i286 -f sizeof_int=2 -f sizeof_pointer=4"
CCAS = ./gcc.pl "@CCAS@"
bin2bios=${top_builddir}/scripts/bin2bios
LDSCRIPT_PATCHER = ./ldscript_patcher.pl
libfaucc = @LIBFAUCC@
bios_cflags = -I${top_srcdir} --freestanding
bios_casflags = -D__ASSEMBLY__ -I${top_srcdir}
if BUILD_BIOS
rom_DATA = vgabios.rom
noinst_PROGRAMS = vgabios.elf
noinst_DATA = vgabios.elf vgabios.dis
noinst_LIBRARIES = lib_vgabios.a
C_sources = \
../vgabios/assert.c ../vgabios/vga.c \
../vgabios/main.c ../vgabios/print.c \
../vgabios/vsprintf.c \
vesa.c \
../../../lib/font_8x8_128.c \
../../../lib/font_8x14.c \
../../../lib/font_8x16.c
gas_sources = ../vgabios/head.S ../vgabios/entry.S
all_sources = $(gas_sources) $(C_sources)
CLEANFILES = $(rom_DATA) $(noinst_DATA) $(MAPFILE) $(LINK_SCRIPT:.in=)
lib_vgabios_a_SOURCES = $(all_sources)
lib_vgabios_a_CFLAGS = $(bios_cflags)
lib_vgabios_a_CCASFLAGS = $(bios_casflags)
vgabios_elf_SOURCES =
vgabios_elf_LDFLAGS = -Xlinker --whole-archive \
-T $(LINK_SCRIPT:.in=) -static -nostdlib \
-Xlinker -Map -Xlinker $(MAPFILE) -Xlinker --cref
vgabios_elf_DEPENDENCIES = $(LINK_SCRIPT:.in=) lib_vgabios.a \
$(libfaucc)
vgabios_elf_LDADD = \
lib_vgabios.a \
$(libfaucc)
$(LINK_SCRIPT:.in=): $(LINK_SCRIPT) $(LDSCRIPT_PATCHER) \
lib_vgabios.a \
$(libfaucc)
## Preprocess ld-script
cpp -I../vgabios -P $< > $(<:.in=.patched)
cpp -I.. -P $< > $(<:.in=.patched)
## Patch ld-script
$(LDSCRIPT_PATCHER) $(<:.in=.patched) $(<:.in=) \
lib_vgabios.a \
$(libfaucc)
rm $(<:.in=.patched)
check-local:
if grep -q 'switch.*(.*)' *.c; then exit 1; fi
test -z `$(NM) vgabios.elf$(EXEEXT) | egrep ' (B|b) '`
test -z `$(NM) $< | egrep ' (D|d) '`
vgabios.dis: vgabios.elf$(EXEEXT)
if HAVE_OBJDUMP
objdump -D -r --disassembler-options=att,i8086 $< > $@
endif
vgabios.rom: vgabios.elf$(EXEEXT)
$(OBJCOPY) -O binary -j .text -j .rodata -j .data -j .bss $< vgabios.text
$(bin2bios) vgabios.text > $@
rm -f vgabios.text
endif
|