Build changes for Linux kconfig code to work in seabios dir structure.
[seabios.git] / Makefile
index d0b88819c6836d59362f1bae2991aee04e9792af..c7dfc0b94c81369249ff6b3df95fc2a185b33a1f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,11 @@
 # SeaBIOS build system
 #
-# Copyright (C) 2008,2009  Kevin O'Connor <kevin@koconnor.net>
+# Copyright (C) 2008-2010  Kevin O'Connor <kevin@koconnor.net>
 #
 # This file may be distributed under the terms of the GNU LGPLv3 license.
 
 # Program version
-VERSION=pre-0.6.1-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname)
+VERSION=pre-0.6.2-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname)
 
 # Output directory
 OUT=out/
@@ -15,12 +15,13 @@ SRCBOTH=misc.c pmm.c stacks.c output.c util.c block.c floppy.c ata.c mouse.c \
         kbd.c pci.c serial.c clock.c pic.c cdrom.c ps2port.c smp.c resume.c \
         pnpbios.c pirtable.c vgahooks.c ramdisk.c pcibios.c blockcmd.c \
         usb.c usb-uhci.c usb-ohci.c usb-ehci.c usb-hid.c usb-msc.c \
-        virtio-ring.c virtio-pci.c virtio-blk.c
-SRC16=$(SRCBOTH) system.c disk.c apm.c font.c
+        virtio-ring.c virtio-pci.c virtio-blk.c apm.c ahci.c
+SRC16=$(SRCBOTH) system.c disk.c font.c
 SRC32FLAT=$(SRCBOTH) post.c shadow.c memmap.c coreboot.c boot.c \
       acpi.c smm.c mptable.c smbios.c pciinit.c optionroms.c mtrr.c \
-      lzmadecode.c usb-hub.c paravirt.c
-SRC32SEG=util.c output.c pci.c pcibios.c apm.c
+      lzmadecode.c bootsplash.c jpeg.c usb-hub.c paravirt.c dev-i440fx.c \
+      pci_region.c
+SRC32SEG=util.c output.c pci.c pcibios.c apm.c stacks.c
 
 cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
               /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
@@ -53,13 +54,14 @@ ifdef V
 Q=
 else
 Q=@
+MAKEFLAGS += --no-print-directory
 endif
 
 OBJCOPY=objcopy
 OBJDUMP=objdump
 STRIP=strip
 
-.PHONY : all FORCE
+.PHONY : all clean distclean FORCE
 
 vpath %.c src vgasrc
 vpath %.S src vgasrc
@@ -67,7 +69,7 @@ vpath %.S src vgasrc
 ################ Build rules
 
 # Verify the gcc configuration and test if -fwhole-program works.
-TESTGCC:=$(shell CC=$(CC) tools/test-gcc.sh)
+TESTGCC:=$(shell CC="$(CC)" tools/test-gcc.sh)
 ifeq "$(TESTGCC)" "-1"
 $(error "Please upgrade GCC")
 endif
@@ -184,16 +186,32 @@ $(OUT)vgabios.bin: $(OUT)vgabios.bin.raw tools/buildrom.py
        $(Q)./tools/buildrom.py $< $@
 
 ####### dsdt build rules
-src/acpi-dsdt.hex: src/acpi-dsdt.dsl
+src/%.hex: src/%.dsl
        @echo "Compiling DSDT"
-       $(Q)cpp -P $< > $(OUT)acpi-dsdt.dsl.i
-       $(Q)iasl -tc -p $@ $(OUT)acpi-dsdt.dsl.i
-       $(Q)rm $(OUT)acpi-dsdt.dsl.i
+       $(Q)cpp -P $< > $(OUT)$*.dsl.i
+       $(Q)iasl -tc -p $(OUT)$* $(OUT)$*.dsl.i
+       $(Q)cp $(OUT)$*.hex $@
+
+$(OUT)ccode32flat.o: src/acpi-dsdt.hex
+
+####### Kconfig rules
+export HOSTCC             := $(CC)
+export CONFIG_SHELL       := sh
+export KCONFIG_AUTOHEADER := autoconf.h
+export KCONFIG_CONFIG     := $(CURDIR)/.config
+
+%onfig:
+       $(Q)mkdir -p $(OUT)/tools/kconfig/lxdialog
+       $(Q)mkdir -p $(OUT)/include/config
+       $(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/tools/kconfig/Makefile srctree=$(CURDIR) src=tools/kconfig obj=tools/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $@
 
 ####### Generic rules
 clean:
        $(Q)rm -rf $(OUT)
 
+distclean: clean
+       $(Q)rm -f .config .config.old
+
 $(OUT):
        $(Q)mkdir $@