forward compiler and linker flags to the subdirectory examples

This commit is contained in:
Stefan Lankes 2011-02-16 14:18:59 +01:00
parent 66b31bfa45
commit 09e637f719

View file

@ -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)