#!/bin/sh

# $Id: 00get.sh,v 1.9 2012/02/17 14:17:02 vrsieh Exp $
#
# Copyright (C) 2007-2009 FAUcc Team.
# 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.
#

BIOS=$HOME/Work/FAUmachine/src/node-pc/simulator/bios
# CONFIG='-DCONFIG_APIC_SUPPORT -DCONFIG_APM_SUPPORT -DCONFIG_MOUSE_SUPPORT -DCONFIG_PCI_SUPPORT -DCONFIG_SMI_SUPPORT -DCONFIG_SMP_SUPPORT -DCONFIG_ACPI_SUPPORT'
CONFIG='-DCONFIG_80286_SUPPORT'

for section in INIT_RM INIT_EARLY RUNTIME_PM RUNTIME_RM ; do
	(
		cd ${BIOS}
		ls *.c
	) \
	| grep -v 'mouse.c' \
	| grep -v 'pci.c' \
	| grep -v 'smi.c' \
	| while read file ; do
		file=`echo ${file} | sed -e 's/\.c//'`
		gcc -m32 -E ${CONFIG} -I${BIOS} -I${BIOS}/.. -I${BIOS}/../.. -I${BIOS}/../../.. -I${BIOS}/../mb_ibm_at_bios -I${BIOS}/../../../lib -D${section} ${BIOS}/${file}.c > ${file}.${section}.i
	done
done
