clean up the build system.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@71 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
11fc6fdf71
commit
16a3503d0d
58 changed files with 406 additions and 2443 deletions
|
|
@ -1,23 +0,0 @@
|
|||
##
|
||||
## This file is part of the LinuxBIOS project.
|
||||
##
|
||||
## Copyright (C) 2006 coresystems GmbH
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program 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 General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
obj-$(CONFIG_ARCH_X86) += x86/
|
||||
obj-$(CONFIG_ARCH_POWERPC) += powerpc/
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
##
|
||||
## This file is part of the LinuxBIOS project.
|
||||
##
|
||||
## Copyright (C) 2006 coresystems GmbH
|
||||
## Copyright (C) 2006-2007 coresystems GmbH
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -18,12 +18,104 @@
|
|||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
#obj-y += init/
|
||||
obj:=$(objdir)
|
||||
src:=$(srcdir)
|
||||
|
||||
$(obj)/linuxbios.rom: $(obj)/linuxbios.lar $(obj)/stage0.init $(obj)/linuxbios.vpd
|
||||
@cat $(obj)/linuxbios.lar \
|
||||
$(obj)/linuxbios.vpd \
|
||||
$(obj)/stage0.init > \
|
||||
$(obj)/linuxbios.rom
|
||||
|
||||
#
|
||||
# This part takes care of compression. It should build the compression modules
|
||||
# in a way that they can be put in the lar. FIXME it belongs in lib/
|
||||
#
|
||||
|
||||
lzma:
|
||||
$(Q)echo "building lzma"
|
||||
|
||||
|
||||
#
|
||||
# initram is always uncompressed. It belongs into the mainboard directory
|
||||
# and is build from what was auto.c in v2
|
||||
#
|
||||
|
||||
initram:
|
||||
$(Q)echo "building initram"
|
||||
|
||||
#
|
||||
# this is the rest of linuxbios (v2: linuxbios_ram.rom)
|
||||
# Is this maybe platform independent, except for the "drivers"?
|
||||
# Where should it be built?
|
||||
#
|
||||
# This needs to be compressed with the default compressor
|
||||
#
|
||||
|
||||
linuxbios_ram: $(obj)/statictree.o
|
||||
$(Q)echo "building linuxbios_ram"
|
||||
|
||||
#
|
||||
# The payload as we love it. Get it from somewhere.
|
||||
# Is this a place to incorporate buildrom?
|
||||
#
|
||||
# This needs to be compressed with the default compressor
|
||||
#
|
||||
|
||||
payload:
|
||||
$(Q)echo "building payload"
|
||||
|
||||
|
||||
#
|
||||
# build the lar archive
|
||||
#
|
||||
|
||||
$(obj)/linuxbios.lar: $(obj)/util/lar/lar lzma linuxbios.initram linuxbios_ram payload
|
||||
$(Q)echo "Building LinuxBIOS archive..."
|
||||
$(Q)rm -rf $(obj)/lar.tmp
|
||||
$(Q)mkdir $(obj)/lar.tmp
|
||||
$(Q)mkdir $(obj)/lar.tmp/normal
|
||||
$(Q)cp $(obj)/linuxbios.initram $(obj)/lar.tmp/normal/initram
|
||||
$(Q)cd $(obj)/lar.tmp && ../util/lar/lar c ../linuxbios.lar.pre normal/initram
|
||||
# TODO: dynamically pad the lar archive. bs is image size - bootblock size (8k)
|
||||
$(Q)dd if=$(obj)/linuxbios.lar.pre of=$(obj)/linuxbios.lar bs=253952 count=1 conv=sync
|
||||
|
||||
|
||||
#
|
||||
# this is going to be the enable car code, lar parser and such:
|
||||
#
|
||||
|
||||
INITCFLAGS := $(CFLAGS) -I$(src)/include/cpu/generic/x86 -I$(src)/include -fno-builtin
|
||||
|
||||
$(obj)/stage0.init:
|
||||
@echo Building linuxbios.init
|
||||
# Building asm stub
|
||||
@$(CC) -E $(LINUXBIOSINCLUDE) $(src)/arch/x86/stage0_i586.S -o $(obj)/stage0_i586.s -DBOOTBLK=0x1f00 -DRESRVED=0xf0 -DDATE=\"`date +%Y/%m/%d`\"
|
||||
@$(AS) $(obj)/stage0_i586.s -o $(obj)/stage0_i586.o
|
||||
# Building cachemain
|
||||
$(CC) $(INITCFLAGS) -c $(src)/arch/x86/cachemain.c -o $(obj)/cachemain.o
|
||||
#
|
||||
@$(CC) $(INITCFLAGS) -c $(src)/lib/lar.c -o $(obj)/lar.o
|
||||
#
|
||||
# console lib
|
||||
@$(CC) $(INITCFLAGS) -c $(src)/arch/x86/console.c -o $(obj)/console.o
|
||||
@$(CC) $(INITCFLAGS) -c $(src)/arch/x86/serial.c -o $(obj)/serial.o
|
||||
@$(CC) $(INITCFLAGS) -c $(src)/console/vtxprintf.c -o $(obj)/vtxprintf.o
|
||||
@$(CC) $(INITCFLAGS) -c $(src)/lib/uart8250.c -o $(obj)/uart8250.o
|
||||
# other lib parts
|
||||
@$(CC) $(INITCFLAGS) -c $(src)/lib/memcpy.c -o $(obj)/memcpy.o
|
||||
|
||||
@cd $(obj); $(CC) -m32 -nostdlib -static -T $(src)/arch/x86/ldscript.ld cachemain.o console.o uart8250.o \
|
||||
serial.o vtxprintf.o lar.o memcpy.o stage0_i586.o -o stage0.o
|
||||
@objcopy -O binary $(obj)/stage0.o $(obj)/stage0.init.pre
|
||||
|
||||
# Pad boot block to 0x2000 - 0x100
|
||||
# we will probably remove this step -- not needed if we continue with ldscript.ld
|
||||
@dd if=$(obj)/stage0.init.pre of=$(obj)/stage0.init bs=7936 conv=sync
|
||||
@echo "Len: `wc -c < $(obj)/stage0.init.pre`"
|
||||
#
|
||||
@test `wc -c < $(obj)/stage0.init.pre` -gt 7936 && echo "Error. Bootblock got too big" || true
|
||||
|
||||
|
||||
|
||||
define archhelp
|
||||
echo '* linuxbios.rom - Compressed kernel image (arch/$(ARCH)/linuxbios.rom)'
|
||||
echo ' install - Install kernel using'
|
||||
echo ' fdimage - Create a bios update floppy image'
|
||||
endef
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,150 +0,0 @@
|
|||
##
|
||||
## This file is part of the LinuxBIOS project.
|
||||
##
|
||||
## Copyright (C) 2006 coresystems GmbH
|
||||
## Copyright (C) 2007 Ron G. Minnich <rminnich@gmail.com>
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program 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 General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
#
|
||||
# This part builds the last 16 byte containing the jmp to the code
|
||||
# and a date or stamp or pointer to a data structure that flashrom
|
||||
# might want to read
|
||||
#
|
||||
|
||||
CFLAGS :=
|
||||
|
||||
#linuxbios.jump: FORCE
|
||||
# $(Q)echo "Building jump vector"
|
||||
# $(Q)$(CC) -E $(srctree)/arch/x86/reset.S -o $(objtree)/reset.s -DBOOTBLK=0x1f00 -DRESRVED=0xf0 -DDATE=\"`date +%Y/%m/%d`\"
|
||||
# $(Q)$(AS) $(objtree)/reset.s -o $(objtree)/reset.o
|
||||
# $(Q)$(LD) -Ttext 0xfffffff0 -s --oformat binary $(objtree)/reset.o -o $(objtree)/linuxbios.jump
|
||||
# $(Q)chmod 644 $(objtree)/linuxbios.jump
|
||||
# $(Q)echo "Len: `wc -c < linuxbios.jump`"
|
||||
|
||||
#
|
||||
# This part takes care of compression. It should build the compression modules
|
||||
# in a way that they can be put in the lar. FIXME it belongs in lib/
|
||||
#
|
||||
|
||||
lzma:
|
||||
$(Q)echo "building lzma"
|
||||
|
||||
|
||||
#
|
||||
# initram is always uncompressed. It belongs into the mainboard directory
|
||||
# and is build from what was auto.c in v2
|
||||
#
|
||||
|
||||
initram:
|
||||
$(Q)echo "building initram"
|
||||
|
||||
#
|
||||
# this is the rest of linuxbios (v2: linuxbios_ram.rom)
|
||||
# Is this maybe platform independent, except for the "drivers"?
|
||||
# Where should it be built?
|
||||
#
|
||||
# This needs to be compressed with the default compressor
|
||||
#
|
||||
|
||||
linuxbios_ram: statictree.o
|
||||
$(Q)echo "building linuxbios_ram"
|
||||
|
||||
#
|
||||
# The payload as we love it. Get it from somewhere.
|
||||
# Is this a place to incorporate buildrom?
|
||||
#
|
||||
# This needs to be compressed with the default compressor
|
||||
#
|
||||
|
||||
payload:
|
||||
$(Q)echo "building payload"
|
||||
|
||||
|
||||
#
|
||||
# build the lar archive
|
||||
#
|
||||
|
||||
linuxbios.lar: $(objtree)/lar lzma linuxbios.initram linuxbios_ram payload
|
||||
$(Q)echo "Building LinuxBIOS archive..."
|
||||
$(Q)mkdir $(objtree)/lar.tmp
|
||||
$(Q)mkdir $(objtree)/lar.tmp/normal
|
||||
$(Q)cp $(objtree)/linuxbios.initram $(objtree)/lar.tmp/normal/initram
|
||||
$(Q)cd $(objtree)/lar.tmp && ../lar c ../linuxbios.lar.pre normal/initram
|
||||
# TODO: dynamically pad the lar archive. bs is image size - bootblock size (8k)
|
||||
$(Q)dd if=$(objtree)/linuxbios.lar.pre of=$(objtree)/linuxbios.lar bs=253952 count=1 conv=sync
|
||||
|
||||
#
|
||||
# this is going to be the enable car code, lar parser and such:
|
||||
#
|
||||
|
||||
INITCFLAGS=-I$(srctree)/include/cpu/generic/x86 -I$(srctree)/include -fno-builtin -Os
|
||||
|
||||
# Note: we could cat .o files together, but one important goal is to leave us with a complete gdb-debuggable
|
||||
# .o for use with popular ICE and other tools. We go to some effort here to end up with a
|
||||
# stage0.o that has debug symbols. This stage0 will actually load the first LAR file and execute it.
|
||||
stage0.init:
|
||||
echo "You will need to create variables for arch/$(CONFIG_ARCH)"
|
||||
echo "and CC flags for architecture, and to select the stage0_$(CONFIG_STAGE0_1)"
|
||||
echo "these will be set in mainboard Kconfig. Also, you need to define the .c files for "
|
||||
echo "stage0 in that file as well. "
|
||||
$(Q)echo Building linuxbios.init
|
||||
#
|
||||
# asm stub
|
||||
$(Q)$(CC) -E $(LINUXBIOSINCLUDE) $(srctree)/arch/x86/stage0_i586.S -o $(objtree)/stage0_i586.s -DBOOTBLK=0x1f00 -DRESRVED=0xf0 -DDATE=\"`date +%Y/%m/%d`\"
|
||||
$(Q)$(AS) $(objtree)/stage0_i586.s -o $(objtree)/stage0_i586.o
|
||||
#
|
||||
# main
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/arch/x86/cachemain.c -o cachemain.o
|
||||
#
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/lib/lar.c -o lar.o
|
||||
#
|
||||
# console lib
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/arch/x86/console.c -o console.o
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/arch/x86/serial.c -o serial.o
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/console/vtxprintf.c -o vtxprintf.o
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/lib/uart8250.c -o uart8250.o
|
||||
|
||||
# leave a .o around for debugging etc.
|
||||
# we did not want to use a ldscript. But the outstanding bugs in gld make it impossible to do
|
||||
# anything else.
|
||||
# Google Not enough room for program headers (allocated 3, need 4)
|
||||
$(Q)$(CC) -m32 -nostdlib -static -T $(srctree)/arch/x86/ldscript.ld cachemain.o console.o uart8250.o \
|
||||
serial.o vtxprintf.o lar.o stage0_i586.o -o stage0.o
|
||||
$(Q)objcopy -O binary stage0.o stage0.init.pre
|
||||
|
||||
# Pad boot block to 0x2000 - 0x100
|
||||
# we will probably remove this step -- not needed if we continue with ldscript.ld
|
||||
$(Q)dd if=stage0.init.pre of=stage0.init bs=7936 conv=sync
|
||||
$(Q)echo "Len: `wc -c < stage0.init.pre`"
|
||||
#
|
||||
$(Q)test `wc -c < stage0.init.pre` -gt 7936 && echo "Error. Bootblock got too big" || true
|
||||
|
||||
#
|
||||
# Compose the image:
|
||||
#
|
||||
|
||||
linuxbios.rom: linuxbios.lar stage0.init linuxbios.vpd
|
||||
$(Q)cat $(objtree)/linuxbios.lar \
|
||||
$(objtree)/linuxbios.vpd $(objtree)/stage0.init> \
|
||||
$(objtree)/linuxbios.rom
|
||||
|
||||
$(objtree)/lar:
|
||||
$(MAKE) -C $(srctree)/util/lar
|
||||
cp $(srctree)/util/lar/lar $(objtree)
|
||||
|
||||
|
||||
.PHONY: linuxbios.rom
|
||||
|
|
@ -23,6 +23,13 @@
|
|||
#include <lar.h>
|
||||
#include "config.h"
|
||||
|
||||
/* these prototypes should go into headers */
|
||||
void uart_init(void);
|
||||
int printk(int msg_level, const char *fmt, ...);
|
||||
void console_init(void);
|
||||
void die(const char *msg);
|
||||
int find_file(struct mem_file *archive, char *filename, struct mem_file *result);
|
||||
|
||||
static void post_code(u8 value)
|
||||
{
|
||||
outb(value, 0x80);
|
||||
|
|
@ -70,7 +77,8 @@ void stage1_main(u32 bist)
|
|||
console_init(); // print banner
|
||||
|
||||
if (bist!=0) {
|
||||
die("BIST FAILED: %08x", bist);
|
||||
printk(BIOS_INFO, "BIST FAILED: %08x", bist);
|
||||
die("");
|
||||
}
|
||||
|
||||
// enable rom
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@
|
|||
#define ntohl(x) (x)
|
||||
#endif
|
||||
|
||||
// FIXME: this should go into a header
|
||||
int printk(int msg_level, const char *fmt, ...);
|
||||
|
||||
|
||||
int find_file(struct mem_file *archive, char *filename, struct mem_file *result)
|
||||
{
|
||||
char * walk, *fullname;
|
||||
|
|
@ -83,7 +87,7 @@ int copy_file(struct mem_file *archive, char *filename, void *where)
|
|||
|
||||
int run_file(struct mem_file *archive, char *filename, void *where)
|
||||
{
|
||||
int (*v)();
|
||||
int (*v)(void);
|
||||
|
||||
if (copy_file(archive, filename, where)){
|
||||
printk(BIOS_INFO, "run file %s failed: ENOENT\n", filename);
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
##
|
||||
## This file is part of the LinuxBIOS project.
|
||||
##
|
||||
## Copyright (C) 2006 coresystems GmbH
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program 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 General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
obj-$(CONFIG_VENDOR_EMULATION) += emulation/
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
##
|
||||
## This file is part of the LinuxBIOS project.
|
||||
##
|
||||
## Copyright (C) 2006 coresystems GmbH
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program 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 General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
obj-$(CONFIG_BOARD_EMULATION_QEMU_X86) += qemu-i386/
|
||||
|
||||
|
|
@ -1,21 +1,65 @@
|
|||
##
|
||||
## This file is part of the LinuxBIOS project.
|
||||
##
|
||||
## Copyright (C) 2006-2007 coresystems GmbH
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program 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 General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
#
|
||||
# Makefile for this mainboard
|
||||
# VPD or SIP ROM or ... how does nvidia call it?
|
||||
# Some space to cope with dirty southbridge tricks.
|
||||
# Do we want to put our own stuff there, too?
|
||||
#
|
||||
|
||||
$(obj)/linuxbios.vpd:
|
||||
@printf "Building dummy VPD ..."
|
||||
@dd if=/dev/zero of=$(obj)/linuxbios.vpd bs=240 count=1
|
||||
@printf "ok.\n"
|
||||
|
||||
#obj-y = mainboard.o setup_before_car.o
|
||||
obj-y = setup_before_car.o
|
||||
#lib-y = linuxbios.vpd
|
||||
|
||||
#$(obj)/mainboard.o: $(obj)/dtc.h
|
||||
#
|
||||
#$(obj)/dtc.h: $(src)/dts $(obj)/dtc
|
||||
# $(obj)/dtc -O lb $(src)/dts >$(obj)/dtc.h
|
||||
# this is going to be the enable car code, lar parser and such:
|
||||
#
|
||||
|
||||
linuxbios.initram:
|
||||
$(Q)echo Building linuxbios.initram
|
||||
#
|
||||
# main
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(src)/mainboard/$(MAINBOARDDIR)/initram.c -o $(obj)/initram.o
|
||||
#
|
||||
# console lib
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(src)/arch/x86/console.c -o $(obj)/console.o
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(src)/arch/x86/serial.c -o $(obj)/serial.o
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(src)/console/vtxprintf.c -o $(obj)/vtxprintf.o
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(src)/lib/uart8250.c -o $(obj)/uart8250.o
|
||||
|
||||
cd $(obj); $(Q)$(LD) -Ttext 0x00000000 -s --oformat binary initram.o console.o uart8250.o \
|
||||
serial.o vtxprintf.o -o $(obj)/linuxbios.initram
|
||||
|
||||
$(Q)chmod 644 $(obj)/linuxbios.initram
|
||||
|
||||
|
||||
## this does not belong in this file.
|
||||
#$(obj)/dtc:
|
||||
# $(MAKE) -C $(srctree)/util/dtc/
|
||||
# cp $(srctree)/util/dtc/dtc $(obj)
|
||||
# miscellaneous important targets.
|
||||
$(obj)/mainboard.o: $(obj)/statictree.o
|
||||
|
||||
$(obj)/statictree.o: $(obj)/statictree.c
|
||||
$(CC) $(CFLAGS) $(LINUXBIOSINCLUDE) -c -o $(obj)/statictree.o $(obj)/statictree.c
|
||||
|
||||
$(obj)/statictree.c: mainboard/$(MAINBOARDDIR)/dts $(obj)/util/dtc/dtc
|
||||
$(obj)/util/dtc/dtc -O lb mainboard/$(MAINBOARDDIR)/dts >$(obj)/statictree.c
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
##
|
||||
## This file is part of the LinuxBIOS project.
|
||||
##
|
||||
## Copyright (C) 2006 coresystems GmbH
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program 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 General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
|
||||
#
|
||||
# VPD or SIP ROM or ... how does nvidia call it?
|
||||
# Some space to cope with dirty southbridge tricks.
|
||||
# Do we want to put our own stuff there, too?
|
||||
#
|
||||
|
||||
linuxbios.vpd:
|
||||
$(Q)printf "Building dummy VPD ..."
|
||||
$(Q)dd if=/dev/zero of=$(objtree)/linuxbios.vpd bs=240 count=1
|
||||
$(Q)printf "ok.\n"
|
||||
|
||||
|
||||
#
|
||||
# this is going to be the enable car code, lar parser and such:
|
||||
#
|
||||
|
||||
INITCFLAGS=-I$(srctree)/include/cpu/generic/x86 -I$(srctree)/include -fno-builtin -Os -fPIC
|
||||
|
||||
linuxbios.initram:
|
||||
$(Q)echo Building linuxbios.initram
|
||||
#
|
||||
# main
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/mainboard/$(MAINBOARDDIR)/initram.c -o initram.o
|
||||
#
|
||||
# console lib
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/arch/x86/console.c -o console.o
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/arch/x86/serial.c -o serial.o
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/console/vtxprintf.c -o vtxprintf.o
|
||||
$(Q)$(CC) $(INITCFLAGS) -c $(srctree)/lib/uart8250.c -o uart8250.o
|
||||
|
||||
$(Q)$(LD) -Ttext 0x00000000 -s --oformat binary initram.o console.o uart8250.o \
|
||||
serial.o vtxprintf.o -o $(objtree)/linuxbios.initram
|
||||
|
||||
$(Q)chmod 644 $(objtree)/linuxbios.initram
|
||||
|
||||
|
||||
# miscellaneous important targets.
|
||||
$(objtree)/mainboard.o: $(objtree)/statictree.o
|
||||
|
||||
$(objtree)/statictree.o: $(objtree)/statictree.c
|
||||
$(CC) $(CFLAGS) $(LINUXBIOSINCLUDE) -c -o $(objtree)/statictree.o $(objtree)/statictree.c
|
||||
|
||||
$(objtree)/statictree.c: mainboard/$(MAINBOARDDIR)/dts $(objtree)/dtc
|
||||
$(objtree)/dtc -O lb mainboard/$(MAINBOARDDIR)/dts >$(objtree)/statictree.c
|
||||
|
||||
$(objtree)/dtc:
|
||||
$(MAKE) -C $(srctree)/util/dtc/
|
||||
cp $(srctree)/util/dtc/dtc $(objtree)
|
||||
|
||||
|
|
@ -21,6 +21,10 @@
|
|||
#include <arch/io.h>
|
||||
#include <console/loglevel.h>
|
||||
|
||||
int printk(int msg_level, const char *fmt, ...);
|
||||
void die(const char *msg);
|
||||
|
||||
|
||||
static void post_code(u8 value)
|
||||
{
|
||||
outb(value, 0x80);
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
###
|
||||
# scripts contains sources for various helper programs used throughout
|
||||
# the kernel for the build process.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Let clean descend into subdirs
|
||||
subdir- += basic kconfig package
|
||||
|
|
@ -1,320 +0,0 @@
|
|||
# ==========================================================================
|
||||
# Building
|
||||
# ==========================================================================
|
||||
|
||||
src := $(obj)
|
||||
|
||||
.PHONY: __build
|
||||
__build:
|
||||
|
||||
# Read .config if it exist, otherwise ignore
|
||||
-include .config
|
||||
|
||||
include scripts/Kbuild.include
|
||||
|
||||
# The filename Kbuild has precedence over Makefile
|
||||
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
|
||||
include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
|
||||
|
||||
include scripts/Makefile.lib
|
||||
|
||||
ifdef host-progs
|
||||
ifneq ($(hostprogs-y),$(host-progs))
|
||||
$(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please replace with hostprogs-y!)
|
||||
hostprogs-y += $(host-progs)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Do not include host rules unles needed
|
||||
ifneq ($(hostprogs-y)$(hostprogs-m),)
|
||||
include scripts/Makefile.host
|
||||
endif
|
||||
|
||||
ifneq ($(KBUILD_SRC),)
|
||||
# Create output directory if not already present
|
||||
_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
|
||||
|
||||
# Create directories for object files if directory does not exist
|
||||
# Needed when obj-y := dir/file.o syntax is used
|
||||
_dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
|
||||
endif
|
||||
|
||||
|
||||
ifndef obj
|
||||
$(warning kbuild: Makefile.build is included improperly)
|
||||
endif
|
||||
|
||||
# ===========================================================================
|
||||
|
||||
ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),)
|
||||
lib-target := $(obj)/lib.a
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(lib-target)),)
|
||||
builtin-target := $(obj)/built-in.o
|
||||
endif
|
||||
|
||||
# We keep a list of all modules in $(MODVERDIR)
|
||||
|
||||
__build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
|
||||
$(if $(KBUILD_MODULES),$(obj-m)) \
|
||||
$(subdir-ym) $(always)
|
||||
@:
|
||||
|
||||
# Linus' kernel sanity checking tool
|
||||
ifneq ($(KBUILD_CHECKSRC),0)
|
||||
ifeq ($(KBUILD_CHECKSRC),2)
|
||||
quiet_cmd_force_checksrc = CHECK $<
|
||||
cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
|
||||
else
|
||||
quiet_cmd_checksrc = CHECK $<
|
||||
cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
# Compile C sources (.c)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Default is built-in, unless we know otherwise
|
||||
modkern_cflags := $(CFLAGS_KERNEL)
|
||||
quiet_modtag := $(empty) $(empty)
|
||||
|
||||
$(real-objs-m) : modkern_cflags := $(CFLAGS_MODULE)
|
||||
$(real-objs-m:.o=.i) : modkern_cflags := $(CFLAGS_MODULE)
|
||||
$(real-objs-m:.o=.s) : modkern_cflags := $(CFLAGS_MODULE)
|
||||
$(real-objs-m:.o=.lst): modkern_cflags := $(CFLAGS_MODULE)
|
||||
|
||||
$(real-objs-m) : quiet_modtag := [M]
|
||||
$(real-objs-m:.o=.i) : quiet_modtag := [M]
|
||||
$(real-objs-m:.o=.s) : quiet_modtag := [M]
|
||||
$(real-objs-m:.o=.lst): quiet_modtag := [M]
|
||||
|
||||
$(obj-m) : quiet_modtag := [M]
|
||||
|
||||
# Default for not multi-part modules
|
||||
modname = $(*F)
|
||||
|
||||
$(multi-objs-m) : modname = $(modname-multi)
|
||||
$(multi-objs-m:.o=.i) : modname = $(modname-multi)
|
||||
$(multi-objs-m:.o=.s) : modname = $(modname-multi)
|
||||
$(multi-objs-m:.o=.lst) : modname = $(modname-multi)
|
||||
$(multi-objs-y) : modname = $(modname-multi)
|
||||
$(multi-objs-y:.o=.i) : modname = $(modname-multi)
|
||||
$(multi-objs-y:.o=.s) : modname = $(modname-multi)
|
||||
$(multi-objs-y:.o=.lst) : modname = $(modname-multi)
|
||||
|
||||
quiet_cmd_cc_s_c = CC $(quiet_modtag) $@
|
||||
cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
|
||||
|
||||
%.s: %.c FORCE
|
||||
$(call if_changed_dep,cc_s_c)
|
||||
|
||||
quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@
|
||||
cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
|
||||
|
||||
%.i: %.c FORCE
|
||||
$(call if_changed_dep,cc_i_c)
|
||||
|
||||
quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
|
||||
cmd_cc_symtypes_c = \
|
||||
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
|
||||
| $(GENKSYMS) -T $@ >/dev/null; \
|
||||
test -s $@ || rm -f $@
|
||||
|
||||
%.symtypes : %.c FORCE
|
||||
$(call if_changed_dep,cc_symtypes_c)
|
||||
|
||||
# C (.c) files
|
||||
# The C file is compiled and updated dependency information is generated.
|
||||
# (See cmd_cc_o_c + relevant part of rule_cc_o_c)
|
||||
|
||||
quiet_cmd_cc_o_c = CC $(quiet_modtag) $@
|
||||
|
||||
ifndef CONFIG_MODVERSIONS
|
||||
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
|
||||
|
||||
else
|
||||
# When module versioning is enabled the following steps are executed:
|
||||
# o compile a .tmp_<file>.o from <file>.c
|
||||
# o if .tmp_<file>.o doesn't contain a __ksymtab version, i.e. does
|
||||
# not export symbols, we just rename .tmp_<file>.o to <file>.o and
|
||||
# are done.
|
||||
# o otherwise, we calculate symbol versions using the good old
|
||||
# genksyms on the preprocessed source and postprocess them in a way
|
||||
# that they are usable as a linker script
|
||||
# o generate <file>.o from .tmp_<file>.o using the linker to
|
||||
# replace the unresolved symbols __crc_exported_symbol with
|
||||
# the actual value of the checksum generated by genksyms
|
||||
|
||||
cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
|
||||
cmd_modversions = \
|
||||
if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
|
||||
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
|
||||
| $(GENKSYMS) $(if $(KBUILD_SYMTYPES), \
|
||||
-T $(@D)/$(@F:.o=.symtypes)) \
|
||||
> $(@D)/.tmp_$(@F:.o=.ver); \
|
||||
\
|
||||
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
|
||||
-T $(@D)/.tmp_$(@F:.o=.ver); \
|
||||
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
|
||||
else \
|
||||
mv -f $(@D)/.tmp_$(@F) $@; \
|
||||
fi;
|
||||
endif
|
||||
|
||||
define rule_cc_o_c
|
||||
$(if $($(quiet)cmd_checksrc),echo ' $($(quiet)cmd_checksrc)';) \
|
||||
$(cmd_checksrc) \
|
||||
$(if $($(quiet)cmd_cc_o_c),echo ' $(call escsq,$($(quiet)cmd_cc_o_c))';) \
|
||||
$(cmd_cc_o_c); \
|
||||
$(cmd_modversions) \
|
||||
scripts/basic/fixdep $(depfile) $@ '$(call escsq,$(cmd_cc_o_c))' > $(@D)/.$(@F).tmp; \
|
||||
rm -f $(depfile); \
|
||||
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
|
||||
endef
|
||||
|
||||
# Built-in and composite module parts
|
||||
|
||||
%.o: %.c FORCE
|
||||
$(call cmd,force_checksrc)
|
||||
$(call if_changed_rule,cc_o_c)
|
||||
|
||||
# Single-part modules are special since we need to mark them in $(MODVERDIR)
|
||||
|
||||
$(single-used-m): %.o: %.c FORCE
|
||||
$(call cmd,force_checksrc)
|
||||
$(call if_changed_rule,cc_o_c)
|
||||
@{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)
|
||||
|
||||
quiet_cmd_cc_lst_c = MKLST $@
|
||||
cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \
|
||||
$(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \
|
||||
System.map $(OBJDUMP) > $@
|
||||
|
||||
%.lst: %.c FORCE
|
||||
$(call if_changed_dep,cc_lst_c)
|
||||
|
||||
# Compile assembler sources (.S)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
modkern_aflags := $(AFLAGS_KERNEL)
|
||||
|
||||
$(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE)
|
||||
$(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
|
||||
|
||||
quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
|
||||
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
|
||||
|
||||
%.s: %.S FORCE
|
||||
$(call if_changed_dep,as_s_S)
|
||||
|
||||
quiet_cmd_as_o_S = AS $(quiet_modtag) $@
|
||||
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
|
||||
|
||||
%.o: %.S FORCE
|
||||
$(call if_changed_dep,as_o_S)
|
||||
|
||||
targets += $(real-objs-y) $(real-objs-m) $(lib-y)
|
||||
targets += $(extra-y) $(MAKECMDGOALS) $(always)
|
||||
|
||||
# Linker scripts preprocessor (.lds.S -> .lds)
|
||||
# ---------------------------------------------------------------------------
|
||||
quiet_cmd_cpp_lds_S = LDS $@
|
||||
cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $<
|
||||
|
||||
%.lds: %.lds.S FORCE
|
||||
$(call if_changed_dep,cpp_lds_S)
|
||||
|
||||
# Build the compiled-in targets
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# To build objects in subdirs, we need to descend into the directories
|
||||
$(sort $(subdir-obj-y)): $(subdir-ym) ;
|
||||
|
||||
#
|
||||
# Rule to compile a set of .o files into one .o file
|
||||
#
|
||||
ifdef builtin-target
|
||||
quiet_cmd_link_o_target = LD $@
|
||||
# If the list of objects to link is empty, just create an empty built-in.o
|
||||
cmd_link_o_target = $(if $(strip $(obj-y)),\
|
||||
$(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
|
||||
rm -f $@; $(AR) rcs $@)
|
||||
|
||||
$(builtin-target): $(obj-y) FORCE
|
||||
$(call if_changed,link_o_target)
|
||||
|
||||
targets += $(builtin-target)
|
||||
endif # builtin-target
|
||||
|
||||
#
|
||||
# Rule to compile a set of .o files into one .a file
|
||||
#
|
||||
ifdef lib-target
|
||||
quiet_cmd_link_l_target = AR $@
|
||||
cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(lib-y)
|
||||
|
||||
$(lib-target): $(lib-y) FORCE
|
||||
$(call if_changed,link_l_target)
|
||||
|
||||
targets += $(lib-target)
|
||||
endif
|
||||
|
||||
#
|
||||
# Rule to link composite objects
|
||||
#
|
||||
# Composite objects are specified in kbuild makefile as follows:
|
||||
# <composite-object>-objs := <list of .o files>
|
||||
# or
|
||||
# <composite-object>-y := <list of .o files>
|
||||
link_multi_deps = \
|
||||
$(filter $(addprefix $(obj)/, \
|
||||
$($(subst $(obj)/,,$(@:.o=-objs))) \
|
||||
$($(subst $(obj)/,,$(@:.o=-y)))), $^)
|
||||
|
||||
quiet_cmd_link_multi-y = LD $@
|
||||
cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
|
||||
|
||||
quiet_cmd_link_multi-m = LD [M] $@
|
||||
cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
|
||||
|
||||
# We would rather have a list of rules like
|
||||
# foo.o: $(foo-objs)
|
||||
# but that's not so easy, so we rather make all composite objects depend
|
||||
# on the set of all their parts
|
||||
$(multi-used-y) : %.o: $(multi-objs-y) FORCE
|
||||
$(call if_changed,link_multi-y)
|
||||
|
||||
$(multi-used-m) : %.o: $(multi-objs-m) FORCE
|
||||
$(call if_changed,link_multi-m)
|
||||
@{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod)
|
||||
|
||||
targets += $(multi-used-y) $(multi-used-m)
|
||||
|
||||
|
||||
# Descending
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
.PHONY: $(subdir-ym)
|
||||
$(subdir-ym):
|
||||
$(Q)$(MAKE) $(build)=$@
|
||||
|
||||
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
.PHONY: FORCE
|
||||
|
||||
FORCE:
|
||||
|
||||
# Read all saved command lines and dependencies for the $(targets) we
|
||||
# may be building above, using $(if_changed{,_dep}). As an
|
||||
# optimization, we don't need to read them if the target does not
|
||||
# exist, we will rebuild anyway in that case.
|
||||
|
||||
targets := $(wildcard $(sort $(targets)))
|
||||
cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
|
||||
|
||||
ifneq ($(cmd_files),)
|
||||
include $(cmd_files)
|
||||
endif
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
# ==========================================================================
|
||||
# Cleaning up
|
||||
# ==========================================================================
|
||||
|
||||
src := $(obj)
|
||||
|
||||
.PHONY: __clean
|
||||
__clean:
|
||||
|
||||
# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
|
||||
# Usage:
|
||||
# $(Q)$(MAKE) $(clean)=dir
|
||||
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
|
||||
|
||||
# The filename Kbuild has precedence over Makefile
|
||||
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
|
||||
include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
|
||||
|
||||
# Figure out what we need to build from the various variables
|
||||
# ==========================================================================
|
||||
|
||||
__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
|
||||
subdir-y += $(__subdir-y)
|
||||
__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
|
||||
subdir-m += $(__subdir-m)
|
||||
__subdir-n := $(patsubst %/,%,$(filter %/, $(obj-n)))
|
||||
subdir-n += $(__subdir-n)
|
||||
__subdir- := $(patsubst %/,%,$(filter %/, $(obj-)))
|
||||
subdir- += $(__subdir-)
|
||||
|
||||
# Subdirectories we need to descend into
|
||||
|
||||
subdir-ym := $(sort $(subdir-y) $(subdir-m))
|
||||
subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-))
|
||||
|
||||
# Add subdir path
|
||||
|
||||
subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn))
|
||||
|
||||
# build a list of files to remove, usually releative to the current
|
||||
# directory
|
||||
|
||||
__clean-files := $(extra-y) $(EXTRA_TARGETS) $(always) \
|
||||
$(targets) $(clean-files) \
|
||||
$(host-progs) \
|
||||
$(hostprogs-y) $(hostprogs-m) $(hostprogs-)
|
||||
|
||||
# as clean-files is given relative to the current directory, this adds
|
||||
# a $(obj) prefix, except for absolute paths
|
||||
|
||||
__clean-files := $(wildcard \
|
||||
$(addprefix $(obj)/, $(filter-out /%, $(__clean-files))) \
|
||||
$(filter /%, $(__clean-files)))
|
||||
|
||||
# as clean-dirs is given relative to the current directory, this adds
|
||||
# a $(obj) prefix, except for absolute paths
|
||||
|
||||
__clean-dirs := $(wildcard \
|
||||
$(addprefix $(obj)/, $(filter-out /%, $(clean-dirs))) \
|
||||
$(filter /%, $(clean-dirs)))
|
||||
|
||||
# ==========================================================================
|
||||
|
||||
quiet_cmd_clean = CLEAN $(obj)
|
||||
cmd_clean = rm -f $(__clean-files)
|
||||
quiet_cmd_cleandir = CLEAN $(__clean-dirs)
|
||||
cmd_cleandir = rm -rf $(__clean-dirs)
|
||||
|
||||
|
||||
__clean: $(subdir-ymn)
|
||||
ifneq ($(strip $(__clean-files)),)
|
||||
+$(call cmd,clean)
|
||||
endif
|
||||
ifneq ($(strip $(__clean-dirs)),)
|
||||
+$(call cmd,cleandir)
|
||||
endif
|
||||
ifneq ($(strip $(clean-rule)),)
|
||||
+$(clean-rule)
|
||||
endif
|
||||
@:
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
# Generic stuff
|
||||
# ===========================================================================
|
||||
|
||||
# Descending
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
.PHONY: $(subdir-ymn)
|
||||
$(subdir-ymn):
|
||||
$(Q)$(MAKE) $(clean)=$@
|
||||
|
||||
# If quiet is set, only print short version of command
|
||||
|
||||
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1))
|
||||
|
|
@ -1,156 +0,0 @@
|
|||
# ==========================================================================
|
||||
# Building binaries on the host system
|
||||
# Binaries are used during the compilation of the kernel, for example
|
||||
# to preprocess a data file.
|
||||
#
|
||||
# Both C and C++ is supported, but preferred language is C for such utilities.
|
||||
#
|
||||
# Samle syntax (see Documentation/kbuild/makefile.txt for reference)
|
||||
# hostprogs-y := bin2hex
|
||||
# Will compile bin2hex.c and create an executable named bin2hex
|
||||
#
|
||||
# hostprogs-y := lxdialog
|
||||
# lxdialog-objs := checklist.o lxdialog.o
|
||||
# Will compile lxdialog.c and checklist.c, and then link the executable
|
||||
# lxdialog, based on checklist.o and lxdialog.o
|
||||
#
|
||||
# hostprogs-y := qconf
|
||||
# qconf-cxxobjs := qconf.o
|
||||
# qconf-objs := menu.o
|
||||
# Will compile qconf as a C++ program, and menu as a C program.
|
||||
# They are linked as C++ code to the executable qconf
|
||||
|
||||
# hostprogs-y := conf
|
||||
# conf-objs := conf.o libkconfig.so
|
||||
# libkconfig-objs := expr.o type.o
|
||||
# Will create a shared library named libkconfig.so that consist of
|
||||
# expr.o and type.o (they are both compiled as C code and the object file
|
||||
# are made as position independent code).
|
||||
# conf.c is compiled as a c program, and conf.o is linked together with
|
||||
# libkconfig.so as the executable conf.
|
||||
# Note: Shared libraries consisting of C++ files are not supported
|
||||
|
||||
__hostprogs := $(sort $(hostprogs-y)$(hostprogs-m))
|
||||
|
||||
# hostprogs-y := tools/build may have been specified. Retreive directory
|
||||
obj-dirs += $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f))))
|
||||
obj-dirs := $(strip $(sort $(filter-out ./,$(obj-dirs))))
|
||||
|
||||
|
||||
# C code
|
||||
# Executables compiled from a single .c file
|
||||
host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
|
||||
|
||||
# C executables linked based on several .o files
|
||||
host-cmulti := $(foreach m,$(__hostprogs),\
|
||||
$(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m))))
|
||||
|
||||
# Object (.o) files compiled from .c files
|
||||
host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs)))
|
||||
|
||||
# C++ code
|
||||
# C++ executables compiled from at least on .cc file
|
||||
# and zero or more .c files
|
||||
host-cxxmulti := $(foreach m,$(__hostprogs),$(if $($(m)-cxxobjs),$(m)))
|
||||
|
||||
# C++ Object (.o) files compiled from .cc files
|
||||
host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs)))
|
||||
|
||||
# Shared libaries (only .c supported)
|
||||
# Shared libraries (.so) - all .so files referenced in "xxx-objs"
|
||||
host-cshlib := $(sort $(filter %.so, $(host-cobjs)))
|
||||
# Remove .so files from "xxx-objs"
|
||||
host-cobjs := $(filter-out %.so,$(host-cobjs))
|
||||
|
||||
#Object (.o) files used by the shared libaries
|
||||
host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
|
||||
|
||||
__hostprogs := $(addprefix $(obj)/,$(__hostprogs))
|
||||
host-csingle := $(addprefix $(obj)/,$(host-csingle))
|
||||
host-cmulti := $(addprefix $(obj)/,$(host-cmulti))
|
||||
host-cobjs := $(addprefix $(obj)/,$(host-cobjs))
|
||||
host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti))
|
||||
host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs))
|
||||
host-cshlib := $(addprefix $(obj)/,$(host-cshlib))
|
||||
host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs))
|
||||
obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
|
||||
|
||||
#####
|
||||
# Handle options to gcc. Support building with separate output directory
|
||||
|
||||
_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(*F).o)
|
||||
_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o)
|
||||
|
||||
ifeq ($(KBUILD_SRC),)
|
||||
__hostc_flags = $(_hostc_flags)
|
||||
__hostcxx_flags = $(_hostcxx_flags)
|
||||
else
|
||||
__hostc_flags = -I$(obj) $(call flags,_hostc_flags)
|
||||
__hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags)
|
||||
endif
|
||||
|
||||
hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags)
|
||||
hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags)
|
||||
|
||||
#####
|
||||
# Compile programs on the host
|
||||
|
||||
# Create executable from a single .c file
|
||||
# host-csingle -> Executable
|
||||
quiet_cmd_host-csingle = HOSTCC $@
|
||||
cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@ $< \
|
||||
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
|
||||
$(host-csingle): %: %.c FORCE
|
||||
$(call if_changed_dep,host-csingle)
|
||||
|
||||
# Link an executable based on list of .o files, all plain c
|
||||
# host-cmulti -> executable
|
||||
quiet_cmd_host-cmulti = HOSTLD $@
|
||||
cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
|
||||
$(addprefix $(obj)/,$($(@F)-objs)) \
|
||||
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
|
||||
$(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE
|
||||
$(call if_changed,host-cmulti)
|
||||
|
||||
# Create .o file from a single .c file
|
||||
# host-cobjs -> .o
|
||||
quiet_cmd_host-cobjs = HOSTCC $@
|
||||
cmd_host-cobjs = $(HOSTCC) $(hostc_flags) -c -o $@ $<
|
||||
$(host-cobjs): %.o: %.c FORCE
|
||||
$(call if_changed_dep,host-cobjs)
|
||||
|
||||
# Link an executable based on list of .o files, a mixture of .c and .cc
|
||||
# host-cxxmulti -> executable
|
||||
quiet_cmd_host-cxxmulti = HOSTLD $@
|
||||
cmd_host-cxxmulti = $(HOSTCXX) $(HOSTLDFLAGS) -o $@ \
|
||||
$(foreach o,objs cxxobjs,\
|
||||
$(addprefix $(obj)/,$($(@F)-$(o)))) \
|
||||
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
|
||||
$(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
|
||||
$(call if_changed,host-cxxmulti)
|
||||
|
||||
# Create .o file from a single .cc (C++) file
|
||||
quiet_cmd_host-cxxobjs = HOSTCXX $@
|
||||
cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $<
|
||||
$(host-cxxobjs): %.o: %.cc FORCE
|
||||
$(call if_changed_dep,host-cxxobjs)
|
||||
|
||||
# Compile .c file, create position independent .o file
|
||||
# host-cshobjs -> .o
|
||||
quiet_cmd_host-cshobjs = HOSTCC -fPIC $@
|
||||
cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
|
||||
$(host-cshobjs): %.o: %.c FORCE
|
||||
$(call if_changed_dep,host-cshobjs)
|
||||
|
||||
# Link a shared library, based on position independent .o files
|
||||
# *.o -> .so shared library (host-cshlib)
|
||||
quiet_cmd_host-cshlib = HOSTLLD -shared $@
|
||||
cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \
|
||||
$(addprefix $(obj)/,$($(@F:.so=-objs))) \
|
||||
$(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
|
||||
$(host-cshlib): %: $(host-cshobjs) FORCE
|
||||
$(call if_changed,host-cshlib)
|
||||
|
||||
targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\
|
||||
$(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs)
|
||||
|
||||
|
|
@ -1,170 +0,0 @@
|
|||
# Backward compatibility - to be removed...
|
||||
extra-y += $(EXTRA_TARGETS)
|
||||
# Figure out what we need to build from the various variables
|
||||
# ===========================================================================
|
||||
|
||||
# When an object is listed to be built compiled-in and modular,
|
||||
# only build the compiled-in version
|
||||
|
||||
obj-m := $(filter-out $(obj-y),$(obj-m))
|
||||
|
||||
# Libraries are always collected in one lib file.
|
||||
# Filter out objects already built-in
|
||||
|
||||
lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
|
||||
|
||||
|
||||
# Handle objects in subdirs
|
||||
# ---------------------------------------------------------------------------
|
||||
# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.o
|
||||
# and add the directory to the list of dirs to descend into: $(subdir-y)
|
||||
# o if we encounter foo/ in $(obj-m), remove it from $(obj-m)
|
||||
# and add the directory to the list of dirs to descend into: $(subdir-m)
|
||||
|
||||
__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
|
||||
subdir-y += $(__subdir-y)
|
||||
__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
|
||||
subdir-m += $(__subdir-m)
|
||||
obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
|
||||
obj-m := $(filter-out %/, $(obj-m))
|
||||
|
||||
# Subdirectories we need to descend into
|
||||
|
||||
subdir-ym := $(sort $(subdir-y) $(subdir-m))
|
||||
|
||||
# if $(foo-objs) exists, foo.o is a composite object
|
||||
multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
|
||||
multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
|
||||
multi-used := $(multi-used-y) $(multi-used-m)
|
||||
single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m)))
|
||||
|
||||
# Build list of the parts of our composite objects, our composite
|
||||
# objects depend on those (obviously)
|
||||
multi-objs-y := $(foreach m, $(multi-used-y), $($(m:.o=-objs)) $($(m:.o=-y)))
|
||||
multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y)))
|
||||
multi-objs := $(multi-objs-y) $(multi-objs-m)
|
||||
|
||||
# $(subdir-obj-y) is the list of objects in $(obj-y) which do not live
|
||||
# in the local directory
|
||||
subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o)))
|
||||
|
||||
# $(obj-dirs) is a list of directories that contain object files
|
||||
obj-dirs := $(dir $(multi-objs) $(subdir-obj-y))
|
||||
|
||||
# Replace multi-part objects by their individual parts, look at local dir only
|
||||
real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y)
|
||||
real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
|
||||
|
||||
# Add subdir path
|
||||
|
||||
extra-y := $(addprefix $(obj)/,$(extra-y))
|
||||
always := $(addprefix $(obj)/,$(always))
|
||||
targets := $(addprefix $(obj)/,$(targets))
|
||||
obj-y := $(addprefix $(obj)/,$(obj-y))
|
||||
obj-m := $(addprefix $(obj)/,$(obj-m))
|
||||
lib-y := $(addprefix $(obj)/,$(lib-y))
|
||||
subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y))
|
||||
real-objs-y := $(addprefix $(obj)/,$(real-objs-y))
|
||||
real-objs-m := $(addprefix $(obj)/,$(real-objs-m))
|
||||
single-used-m := $(addprefix $(obj)/,$(single-used-m))
|
||||
multi-used-y := $(addprefix $(obj)/,$(multi-used-y))
|
||||
multi-used-m := $(addprefix $(obj)/,$(multi-used-m))
|
||||
multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y))
|
||||
multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m))
|
||||
subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
|
||||
obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
|
||||
|
||||
# These flags are needed for modversions and compiling, so we define them here
|
||||
# already
|
||||
# $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
|
||||
# end up in (or would, if it gets compiled in)
|
||||
# Note: It's possible that one object gets potentially linked into more
|
||||
# than one module. In that case KBUILD_MODNAME will be set to foo_bar,
|
||||
# where foo and bar are the name of the modules.
|
||||
name-fix = $(subst $(comma),_,$(subst -,_,$1))
|
||||
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))"
|
||||
modname_flags = $(if $(filter 1,$(words $(modname))),\
|
||||
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
|
||||
|
||||
_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o)
|
||||
_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
|
||||
_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
|
||||
|
||||
# If building the kernel in a separate objtree expand all occurrences
|
||||
# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
|
||||
|
||||
ifeq ($(KBUILD_SRC),)
|
||||
__c_flags = $(_c_flags)
|
||||
__a_flags = $(_a_flags)
|
||||
__cpp_flags = $(_cpp_flags)
|
||||
else
|
||||
|
||||
# Prefix -I with $(srctree) if it is not an absolute path
|
||||
addtree = $(1) $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)))
|
||||
# Find all -I options and call addtree
|
||||
flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
|
||||
|
||||
# -I$(obj) locates generated .h files
|
||||
# $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files
|
||||
# and locates generated .h files
|
||||
# FIXME: Replace both with specific CFLAGS* statements in the makefiles
|
||||
__c_flags = $(call addtree,-I$(obj)) $(call flags,_c_flags)
|
||||
__a_flags = $(call flags,_a_flags)
|
||||
__cpp_flags = $(call flags,_cpp_flags)
|
||||
endif
|
||||
|
||||
c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
|
||||
$(__c_flags) $(modkern_cflags) \
|
||||
-D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
|
||||
|
||||
a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
|
||||
$(__a_flags) $(modkern_aflags)
|
||||
|
||||
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
|
||||
|
||||
ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
|
||||
|
||||
# Finds the multi-part object the current object will be linked into
|
||||
modname-multi = $(sort $(foreach m,$(multi-used),\
|
||||
$(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
|
||||
|
||||
# Shipped files
|
||||
# ===========================================================================
|
||||
|
||||
quiet_cmd_shipped = SHIPPED $@
|
||||
cmd_shipped = cat $< > $@
|
||||
|
||||
$(obj)/%:: $(src)/%_shipped
|
||||
$(call cmd,shipped)
|
||||
|
||||
# Commands useful for building a boot image
|
||||
# ===========================================================================
|
||||
#
|
||||
# Use as following:
|
||||
#
|
||||
# target: source(s) FORCE
|
||||
# $(if_changed,ld/objcopy/gzip)
|
||||
#
|
||||
# and add target to EXTRA_TARGETS so that we know we have to
|
||||
# read in the saved command line
|
||||
|
||||
# Linking
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
quiet_cmd_ld = LD $@
|
||||
cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
|
||||
$(filter-out FORCE,$^) -o $@
|
||||
|
||||
# Objcopy
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
quiet_cmd_objcopy = OBJCOPY $@
|
||||
cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
|
||||
|
||||
# Gzip
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
quiet_cmd_gzip = GZIP $@
|
||||
cmd_gzip = gzip -f -9 < $< > $@
|
||||
|
||||
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Makefile to build lxdialog package
|
||||
#
|
||||
|
||||
check-lxdialog := $(srctree)/$(src)/check-lxdialog.sh
|
||||
|
||||
# Use reursively expanded variables so we do not call gcc unless
|
||||
# we really need to do so. (Do not call gcc as part of make mrproper)
|
||||
HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
|
||||
HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
|
||||
|
||||
HOST_EXTRACFLAGS += -DLOCALE
|
||||
|
||||
.PHONY: dochecklxdialog
|
||||
$(obj)/dochecklxdialog:
|
||||
$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)
|
||||
|
||||
hostprogs-y := lxdialog
|
||||
always := $(hostprogs-y) dochecklxdialog
|
||||
|
||||
lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \
|
||||
util.o lxdialog.o msgbox.o
|
||||
|
|
@ -1,7 +1,27 @@
|
|||
###
|
||||
# util contains sources for various helper programs used throughout
|
||||
# the firmware for the build process.
|
||||
# ---------------------------------------------------------------------------
|
||||
##
|
||||
## This file is part of the LinuxBIOS project.
|
||||
##
|
||||
## Copyright (C) 2007 coresystems GmbH
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program 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 General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
|
||||
include util/lar/Makefile
|
||||
include util/dtc/Makefile
|
||||
include util/kconfig/Makefile
|
||||
|
||||
|
||||
|
||||
# Let clean descend into subdirs
|
||||
subdir- += dtc lar
|
||||
|
|
|
|||
|
|
@ -10,31 +10,50 @@ OBJS = $(DTC_OBJS) libdt.o ftdump.o
|
|||
|
||||
DEPFILES = $(DTC_OBJS:.o=.d)
|
||||
|
||||
all: $(TARGETS)
|
||||
#all: $(TARGETS)
|
||||
|
||||
dtc: $(DTC_OBJS)
|
||||
$(obj)/util/dtc/dtc: $(patsubst %,$(obj)/%,$(DTC_OBJS))
|
||||
mkdir -p $(obj)/util/dtc/
|
||||
$(LINK.c) -o $@ $^
|
||||
|
||||
ftdump: ftdump.o
|
||||
$(LINK.c) -o $@ $^
|
||||
|
||||
dtc-parser.tab.c dtc-parser.tab.h dtc-parser.output: dtc-parser.y
|
||||
$(BISON) -d $<
|
||||
$(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h $(obj)/dtc-parser.output: $(src)/util/dtc/dtc-parser.y
|
||||
cd $(obj); $(BISON) -d $<
|
||||
|
||||
lex.yy.c: dtc-lexer.l
|
||||
$(LEX) $<
|
||||
$(obj)/lex.yy.c: $(src)/util/dtc/dtc-lexer.l
|
||||
cd $(obj); $(LEX) $<
|
||||
|
||||
lex.yy.o: lex.yy.c dtc-parser.tab.h
|
||||
#lex.yy.o: lex.yy.c dtc-parser.tab.h
|
||||
|
||||
check: all
|
||||
cd tests && $(MAKE) check
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o a.out core $(TARGETS)
|
||||
rm -f *.tab.[ch] lex.yy.c
|
||||
rm -f *.i *.output vgcore.*
|
||||
rm -f *.d
|
||||
cd tests && $(MAKE) clean
|
||||
$(obj)/dtc.o: $(src)/util/dtc/dtc.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
|
||||
$(obj)/livetree.o: $(src)/util/dtc/livetree.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
|
||||
$(obj)/flattree.o: $(src)/util/dtc/flattree.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
|
||||
$(obj)/data.o: $(src)/util/dtc/data.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
|
||||
$(obj)/treesource.o: $(src)/util/dtc/treesource.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
|
||||
$(obj)/fstree.o: $(src)/util/dtc/fstree.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
|
||||
$(obj)/dtc-parser.tab.o: $(obj)/dtc-parser.tab.c
|
||||
$(HOSTCC) -I$(src)/util/dtc $(HOSTCFLAGS) -o $@ -c $<
|
||||
$(obj)/lex.yy.o: $(obj)/lex.yy.c $(obj)/dtc-parser.tab.h
|
||||
$(HOSTCC) -I$(src)/util/dtc $(HOSTCFLAGS) -o $@ -c $<
|
||||
|
||||
#clean:
|
||||
# rm -f *~ *.o a.out core $(TARGETS)
|
||||
# rm -f *.tab.[ch] lex.yy.c
|
||||
# rm -f *.i *.output vgcore.*
|
||||
# rm -f *.d
|
||||
# cd tests && $(MAKE) clean
|
||||
|
||||
|
||||
%.d: %.c
|
||||
$(CC) -MM -MG -MT "$*.o $@" $< > $@
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ xconfig: $(obj)/qconf
|
|||
gconfig: $(obj)/gconf
|
||||
$< Kconfig
|
||||
|
||||
menuconfig: $(obj)/mconf
|
||||
$(Q)$(MAKE) $(build)=scripts/kconfig/lxdialog
|
||||
$< Kconfig
|
||||
menuconfig: prepare $(obj)/lxdialog $(obj)/mconf
|
||||
#$(Q)$(MAKE) $(build)=scripts/kconfig/lxdialog
|
||||
$(obj)/mconf Kconfig
|
||||
|
||||
config: $(obj)/conf
|
||||
$< Kconfig
|
||||
|
|
@ -94,6 +94,32 @@ help:
|
|||
@echo ' allyesconfig - New config where all options are accepted with yes'
|
||||
@echo ' allnoconfig - New minimal config'
|
||||
|
||||
|
||||
|
||||
mconf-objects := mconf.o zconf.tab.o
|
||||
$(obj)/mconf: $(patsubst %,$(obj)/%,$(mconf-objects))
|
||||
$(HOSTCC) -lncurses -o $@ $^
|
||||
|
||||
$(obj)/mconf.o: $(src)/util/kconfig/mconf.c
|
||||
$(HOSTCC) -I$(src)/util/kconfig -c -o $@ $<
|
||||
|
||||
$(obj)/zconf.tab.o: $(obj)/zconf.tab.c $(obj)/zconf.hash.c $(obj)/lex.zconf.c
|
||||
$(HOSTCC) -I$(src)/util/kconfig -c -o $@ $(obj)/zconf.tab.c
|
||||
|
||||
$(obj)/lex.zconf.c: $(src)/util/kconfig/lex.zconf.c_shipped
|
||||
cp $< $@
|
||||
|
||||
$(obj)/zconf.hash.c: $(src)/util/kconfig/zconf.hash.c_shipped
|
||||
cp $< $@
|
||||
|
||||
$(obj)/zconf.tab.c: $(src)/util/kconfig/zconf.tab.c_shipped
|
||||
cp $< $@
|
||||
|
||||
include $(src)/util/kconfig/lxdialog/Makefile
|
||||
|
||||
######################
|
||||
# kbuild crap follows
|
||||
|
||||
# ===========================================================================
|
||||
# Shared Makefile for the various kconfig executables:
|
||||
# conf: Used for defconfig, oldconfig and related targets
|
||||
|
|
@ -226,7 +252,7 @@ $(obj)/.tmp_gtkcheck:
|
|||
fi
|
||||
endif
|
||||
|
||||
$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c
|
||||
#$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c
|
||||
|
||||
$(obj)/kconfig_load.o: $(obj)/lkc_defs.h
|
||||
|
||||
|
|
@ -249,9 +275,9 @@ $(obj)/lkc_defs.h: $(src)/lkc_proto.h
|
|||
|
||||
ifdef LKC_GENPARSER
|
||||
|
||||
$(obj)/zconf.tab.c: $(src)/zconf.y
|
||||
$(obj)/lex.zconf.c: $(src)/zconf.l
|
||||
$(obj)/zconf.hash.c: $(src)/zconf.gperf
|
||||
$(obj)/zconf.tab.c: $(src)/util/kconfig/zconf.y
|
||||
$(obj)/lex.zconf.c: $(src)/util/kconfig/zconf.l
|
||||
$(obj)/zconf.hash.c: $(src)/util/kconfig/zconf.gperf
|
||||
|
||||
%.tab.c: %.y
|
||||
bison -l -b $* -p $(notdir $*) $<
|
||||
54
util/kconfig/lxdialog/Makefile
Normal file
54
util/kconfig/lxdialog/Makefile
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# Makefile to build lxdialog package
|
||||
#
|
||||
|
||||
CONFIG_SHELL:=sh
|
||||
|
||||
check-lxdialog := $(src)/util/kconfig/lxdialog/check-lxdialog.sh
|
||||
|
||||
# Use reursively expanded variables so we do not call gcc unless
|
||||
# we really need to do so. (Do not call gcc as part of make mrproper)
|
||||
HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
|
||||
HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
|
||||
|
||||
HOST_EXTRACFLAGS += -DLOCALE
|
||||
|
||||
.PHONY: dochecklxdialog
|
||||
$(obj)/dochecklxdialog:
|
||||
$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)
|
||||
|
||||
hostprogs-y := lxdialog
|
||||
always := $(hostprogs-y) dochecklxdialog
|
||||
|
||||
lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \
|
||||
util.o lxdialog.o msgbox.o
|
||||
|
||||
|
||||
$(obj)/lxdialog: $(obj)/dochecklxdialog $(patsubst %,$(obj)/%,$(lxdialog-objs))
|
||||
$(HOSTCC) $(HOST_LOADLIBES) $(patsubst %,$(obj)/%,$(lxdialog-objs)) -o $@
|
||||
|
||||
$(obj)/checklist.o: $(src)/util/kconfig/lxdialog/checklist.c
|
||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $^ -c -o $@
|
||||
|
||||
$(obj)/menubox.o: $(src)/util/kconfig/lxdialog/menubox.c
|
||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $^ -c -o $@
|
||||
|
||||
$(obj)/textbox.o: $(src)/util/kconfig/lxdialog/textbox.c
|
||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $^ -c -o $@
|
||||
|
||||
$(obj)/yesno.o: $(src)/util/kconfig/lxdialog/yesno.c
|
||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $^ -c -o $@
|
||||
|
||||
$(obj)/inputbox.o: $(src)/util/kconfig/lxdialog/inputbox.c
|
||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $^ -c -o $@
|
||||
|
||||
$(obj)/util.o: $(src)/util/kconfig/lxdialog/util.c
|
||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $^ -c -o $@
|
||||
|
||||
$(obj)/lxdialog.o: $(src)/util/kconfig/lxdialog/lxdialog.c
|
||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $^ -c -o $@
|
||||
|
||||
$(obj)/msgbox.o: $(src)/util/kconfig/lxdialog/msgbox.c
|
||||
$(HOSTCC) $(HOST_EXTRACFLAGS) $^ -c -o $@
|
||||
|
||||
|
||||
|
||||
|
|
@ -25,6 +25,8 @@
|
|||
#define LKC_DIRECT_LINK
|
||||
#include "lkc.h"
|
||||
|
||||
static char *mconf_lxdialogpath;
|
||||
|
||||
static char menu_backtitle[128];
|
||||
static const char mconf_readme[] = N_(
|
||||
"Overview\n"
|
||||
|
|
@ -325,7 +327,7 @@ static void cprint_init(void)
|
|||
memset(args, 0, sizeof(args));
|
||||
indent = 0;
|
||||
child_count = 0;
|
||||
cprint("./scripts/kconfig/lxdialog/lxdialog");
|
||||
cprint("%s/lxdialog", mconf_lxdialogpath);
|
||||
cprint("--backtitle");
|
||||
cprint(menu_backtitle);
|
||||
}
|
||||
|
|
@ -1062,6 +1064,8 @@ int main(int ac, char **av)
|
|||
single_menu_mode = 1;
|
||||
}
|
||||
|
||||
mconf_lxdialogpath = getenv("obj");
|
||||
|
||||
tcgetattr(1, &ios_org);
|
||||
atexit(conf_cleanup);
|
||||
init_wsize();
|
||||
|
|
@ -18,21 +18,28 @@
|
|||
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
|
||||
##
|
||||
|
||||
SOURCE = lar.c create.c extract.c list.c lib.c
|
||||
SOURCE := lar.c create.c extract.c list.c lib.c
|
||||
|
||||
CC=gcc
|
||||
CFLAGS=-O2 -Wall -W
|
||||
|
||||
lar: $(SOURCE)
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
strip -s $@
|
||||
HOSTCC=gcc
|
||||
HOSTCFLAGS=-O2 -Wall -W
|
||||
|
||||
obj:=$(objdir)
|
||||
|
||||
$(obj)/util/lar/lar: $(patsubst %,$(src)/util/lar/%,$(SOURCE))
|
||||
@mkdir -p $(obj)/util/lar
|
||||
@$(HOSTCC) $(HOSTCFLAGS) -o $@ $^
|
||||
@echo "Built LAR."
|
||||
|
||||
|
||||
## --------------------------------------------------------------------
|
||||
## stuff below this line should be fixed or go away
|
||||
|
||||
example: example.c
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -rf lar tree.lar tree tree2 example
|
||||
|
||||
#clean:
|
||||
# rm -rf lar tree.lar tree tree2 example
|
||||
|
||||
tree:
|
||||
@printf "creating sample tree... "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue