From 09e637f719352b2853c316f58a4da0db484247cc Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 16 Feb 2011 14:18:59 +0100 Subject: [PATCH] forward compiler and linker flags to the subdirectory examples --- newlib/Makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/newlib/Makefile b/newlib/Makefile index 9d14a691..635c1385 100644 --- a/newlib/Makefile +++ b/newlib/Makefile @@ -1,5 +1,14 @@ TOPDIR = $(shell pwd) ARCH = x86 + +ifeq ($(ARCH),x86) + TARGET=i586-metalsvm-elf32 +endif +ifeq ($(ARCH),x86_64) + TARGET=x86_64-metalsvm-elf64 +endif + +NEWLIB = $(TOPDIR)/$(ARCH)/$(TARGET) RM = rm -rf CD = cd MKDIR = mkdir @@ -22,17 +31,9 @@ export CXXFLAGS=$(CFLAGS) export CPPFLAGS=$(CFLAGS) export NASMFLAGS -ifeq ($(ARCH),x86) - TARGET=i586-metalsvm-elf32 -endif -ifeq ($(ARCH),x86_64) - TARGET=x86_64-metalsvm-elf64 -endif - - default: $(ARCH) $(MAKE) -C examples depend - $(MAKE) -C examples + $(MAKE) CFLAGS+="-nostdinc -Wall -fno-builtin -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS="-nostdlib -L$(NEWLIB)/lib" -C examples $(ARCH): $(RM) $(TMP)