Re: [Tinyx-devel] [PATCH] BUILD: Improving build system
Status: Planning
Brought to you by:
davidcohen
From: David C. <da...@gm...> - 2008-01-13 04:10:46
|
Puhshing this one, following Felipe's comment for CPU macro. David On Jan 12, 2008 8:08 PM, David Cohen <da...@gm...> wrote: > This patch adds symbolic path to include/asm/arch directory and use gcc > instead of ld to link final tinyx image. > > Signed-off-by: David Cohen <da...@gm...> > --- > Makefile | 14 ++++++++------ > 1 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/Makefile b/Makefile > index 3b0a471..b4e49ed 100644 > --- a/Makefile > +++ b/Makefile > @@ -9,6 +9,7 @@ HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer > CROSS_COMPILE ?= arm-linux- > > ARCH = arm7 > +CPU = lpc2xxx > > AS = $(CROSS_COMPILE)as > LD = $(CROSS_COMPILE)ld > @@ -19,7 +20,7 @@ STRIP = $(CROSS_COMPILE)strip > OBJCOPY = $(CROSS_COMPILE)objcopy > OBJDUMP = $(CROSS_COMPILE)objdump > AWK = awk > -CFLAGS = -Wall -Os -mcpu=arm7tdmi > +CFLAGS = -Wall -Os -mcpu=arm7tdmi -nostdlib > INCLUDES = -Iinclude -Iinclude/libc > > PYTHON = python > @@ -28,14 +29,15 @@ MAKEFLAGS += --no-print-directory > > all-sources = $(shell git-ls-files) > > -export ARCH AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES > +export ARCH CPU AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES > > tinyx.dirs = lib/ arch/ kernel/ > > tinyx.objs = $(patsubst %/, %/tyx_part.o, $(tinyx.dirs)) > > -$(shell rm -f $(tinyx.objs) include/asm) > +$(shell rm -f $(tinyx.objs) include/asm/arch include/asm) > $(shell ln -s asm-$(ARCH) include/asm) > +$(shell ln -s arch-$(CPU) include/asm/arch) > > > _all: > > @@ -52,7 +54,8 @@ tinyx.hex: tinyx.elf > $(OBJCOPY) -O ihex build/$< build/$@ > > tinyx.elf: $(tinyx.objs) > - $(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > + #$(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > + $(CC) -Xlinker --script=arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs) > > $(tinyx.objs): > @$(MAKE) target=$@ -f scripts/Makefile.build > @@ -63,7 +66,6 @@ endef > > tags: > $(call xtags, ctags) > - > .PHONY: clean > clean: > @cleandirs="$(shell $(PYTHON) scripts/expandtree.py $(tinyx.dirs))"; \ > @@ -72,6 +74,6 @@ clean: > cleanobjs="$$cleanobjs $$dir*.o"; \ > done; \ > echo "rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps"; \ > - rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; > + rm -f $$cleanobjs include/asm/arch include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; > > > -- > 1.5.3.7 > > |