diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-12 12:12:34 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-12 12:12:34 +0200 |
commit | d757720766629dcd94af70ea65ccd8ba5eb47e4b (patch) | |
tree | 1263204fa6e46fc3555f232b81e6c9ce2bd13df2 /arch/sandbox/Makefile | |
parent | 2557787389f8ec40381d1201a15badd25d4aab10 (diff) | |
download | barebox-d757720766629dcd94af70ea65ccd8ba5eb47e4b.tar.gz barebox-d757720766629dcd94af70ea65ccd8ba5eb47e4b.tar.xz |
arch/linux -> arch/sandbox
Diffstat (limited to 'arch/sandbox/Makefile')
-rw-r--r-- | arch/sandbox/Makefile | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile new file mode 100644 index 0000000000..5c7db6ddd3 --- /dev/null +++ b/arch/sandbox/Makefile @@ -0,0 +1,73 @@ + +CPPFLAGS += -fno-builtin -ffreestanding -nostdinc -Wall \ + -isystem $(gccincdir) -pipe \ + -fno-strict-aliasing + + +machine-y := linux + +BOARD:= arch/linux/lib +board-y := linux + +TEXT_BASE = $(CONFIG_TEXT_BASE) + +CPPFLAGS += -P +CFLAGS := -fno-common -Os -Dmalloc=u_boot_malloc \ + -Dfree=u_boot_free -Drealloc=u_boot_realloc \ + -Dread=u_boot_read -Dwrite=u_boot_write \ + -Dopen=u_boot_open -Dclose=u_boot_close \ + -Dlseek=u_boot_lseek -Dperror=u_boot_perror \ + -Derrno=u_boot_errno -Dgetc=u_boot_getc \ + -Dputc=u_boot_putc -Dfgetc=u_boot_fgetc \ + -Dfputc=u_boot_fputc -Dfgets=u_boot_fgets \ + -Dfputs=u_boot_fputs -Dsetenv=u_boot_setenv \ + -Dgetenv=u_boot_getenv -Dprintf=u_boot_printf + +LDFLAGS_uboot :=-L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc + +ifeq ($(incdir-y),) +incdir-y := $(machine-y) +endif +INCDIR := arch-$(incdir-y) + +SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ + -e s/arm.*/arm/ -e s/sa110/arm/ \ + -e s/s390x/s390/ -e s/parisc64/parisc/ \ + -e s/ppc.*/powerpc/ -e s/mips.*/mips/ ) + +ifeq ($(SUBARCH),x86_64) +ELF_ARCH := i386:x86-64 +ELF_FORMAT := elf64-x86-64 +endif +ifeq ($(SUBARCH),i386) +ELF_ARCH := $(SUBARCH) +ELF_FORMAT := elf32-$(SUBARCH) +endif + +export ELF_FORMAT ELF_ARCH SUBARCH +# Update machine arch and proc symlinks if something which affects +# them changed. We use .arch to indicate when they were updated +# last, otherwise make uses the target directory mtime. + +include/asm-linux/.arch: $(wildcard include/config/arch/*.h) include/config/auto.conf + @echo ' SYMLINK include/asm-linux/arch -> include/asm-linux/$(INCDIR)' +ifneq ($(KBUILD_SRC),) + $(Q)mkdir -p include/asm-linux + $(Q)ln -fsn $(srctree)/include/asm-linux/$(INCDIR) include/asm-linux/arch +else + $(Q)ln -fsn $(INCDIR) include/asm-linux/arch +endif + @touch $@ + +archprepare: maketools + +PHONY += maketools +maketools: include/asm-linux/.arch + +cmd_uboot__ = $(CC) -o $@ -Wl,-T,$(uboot-lds) \ + -Wl,--start-group $(uboot-common) -Wl,--end-group \ + -lrt -Wl,-rpath,/lib -lrt -lpthread + +common-y += arch/linux/lib/ arch/linux/board/ + +MRPROPER_FILES += include/asm-linux/arch |