Commit 330774d0 authored by Thomas Huth's avatar Thomas Huth Committed by Radim Krčmář
Browse files

Makefiles: Fix up the powerpc build dirs and include/link paths



The changes for out-of-tree builds are here pretty much the same
as for the ARM Makefile.common.
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
parent 4a18bde1
......@@ -13,7 +13,7 @@ tests-common = \
$(TEST_DIR)/sprs.elf
tests-all = $(tests-common) $(tests)
all: $(TEST_DIR)/boot_rom.bin $(tests-all)
all: directories $(TEST_DIR)/boot_rom.bin $(tests-all)
##################################################################
......@@ -21,14 +21,14 @@ CFLAGS += -std=gnu99
CFLAGS += -ffreestanding
CFLAGS += -Wextra
CFLAGS += -O2
CFLAGS += -I lib -I lib/libfdt
CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt -I lib
CFLAGS += -Wa,-mregnames
# We want to keep intermediate files
.PRECIOUS: %.o
asm-offsets = lib/$(ARCH)/asm-offsets.h
include scripts/asm-offsets.mak
include $(SRCDIR)/scripts/asm-offsets.mak
cflatobjs += lib/util.o
cflatobjs += lib/alloc.o
......@@ -41,13 +41,16 @@ cflatobjs += lib/powerpc/processor.o
cflatobjs += lib/powerpc/handlers.o
cflatobjs += lib/powerpc/smp.o
OBJDIRS += lib/powerpc
FLATLIBS = $(libcflat) $(LIBFDT_archive)
%.elf: CFLAGS += $(arch_CFLAGS)
%.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie -n
%.elf: %.o $(FLATLIBS) powerpc/flat.lds $(cstart.o) $(reloc.o)
$(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) lib/auxinfo.c -DPROGNAME=\"$@\"
%.elf: %.o $(FLATLIBS) $(SRCDIR)/powerpc/flat.lds $(cstart.o) $(reloc.o)
$(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) $(SRCDIR)/lib/auxinfo.c \
-DPROGNAME=\"$@\"
$(LD) $(LDFLAGS) -o $@ \
-T powerpc/flat.lds --build-id=none \
-T $(SRCDIR)/powerpc/flat.lds --build-id=none \
$(filter %.o, $^) $(FLATLIBS) $(@:.elf=.aux.o)
$(RM) $(@:.elf=.aux.o)
@echo -n Checking $@ for unsupported reloc types...
......
......@@ -16,6 +16,8 @@ endif
cstart.o = $(TEST_DIR)/cstart64.o
reloc.o = $(TEST_DIR)/reloc64.o
OBJDIRS += lib/ppc64
# ppc64 specific tests
tests =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment