From 6419f43d4a47a763e1ac593f1a63d68a8ac7f04f Mon Sep 17 00:00:00 2001 From: David Cohen Date: Sat, 12 Jan 2008 12:31:54 -0400 Subject: [PATCH] BUILD: Improving build system 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 --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3b0a471..386622d 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,7 @@ clean: cleanobjs="$$cleanobjs $$dir*.o"; \ done; \ echo "rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps"; \ + rm -f include/asm/arch rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps; -- 2.11.4.GIT