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 = \ ...@@ -13,7 +13,7 @@ tests-common = \
$(TEST_DIR)/sprs.elf $(TEST_DIR)/sprs.elf
tests-all = $(tests-common) $(tests) 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 ...@@ -21,14 +21,14 @@ CFLAGS += -std=gnu99
CFLAGS += -ffreestanding CFLAGS += -ffreestanding
CFLAGS += -Wextra CFLAGS += -Wextra
CFLAGS += -O2 CFLAGS += -O2
CFLAGS += -I lib -I lib/libfdt CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt -I lib
CFLAGS += -Wa,-mregnames CFLAGS += -Wa,-mregnames
# We want to keep intermediate files # We want to keep intermediate files
.PRECIOUS: %.o .PRECIOUS: %.o
asm-offsets = lib/$(ARCH)/asm-offsets.h asm-offsets = lib/$(ARCH)/asm-offsets.h
include scripts/asm-offsets.mak include $(SRCDIR)/scripts/asm-offsets.mak
cflatobjs += lib/util.o cflatobjs += lib/util.o
cflatobjs += lib/alloc.o cflatobjs += lib/alloc.o
...@@ -41,13 +41,16 @@ cflatobjs += lib/powerpc/processor.o ...@@ -41,13 +41,16 @@ cflatobjs += lib/powerpc/processor.o
cflatobjs += lib/powerpc/handlers.o cflatobjs += lib/powerpc/handlers.o
cflatobjs += lib/powerpc/smp.o cflatobjs += lib/powerpc/smp.o
OBJDIRS += lib/powerpc
FLATLIBS = $(libcflat) $(LIBFDT_archive) FLATLIBS = $(libcflat) $(LIBFDT_archive)
%.elf: CFLAGS += $(arch_CFLAGS) %.elf: CFLAGS += $(arch_CFLAGS)
%.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie -n %.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie -n
%.elf: %.o $(FLATLIBS) powerpc/flat.lds $(cstart.o) $(reloc.o) %.elf: %.o $(FLATLIBS) $(SRCDIR)/powerpc/flat.lds $(cstart.o) $(reloc.o)
$(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) lib/auxinfo.c -DPROGNAME=\"$@\" $(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) $(SRCDIR)/lib/auxinfo.c \
-DPROGNAME=\"$@\"
$(LD) $(LDFLAGS) -o $@ \ $(LD) $(LDFLAGS) -o $@ \
-T powerpc/flat.lds --build-id=none \ -T $(SRCDIR)/powerpc/flat.lds --build-id=none \
$(filter %.o, $^) $(FLATLIBS) $(@:.elf=.aux.o) $(filter %.o, $^) $(FLATLIBS) $(@:.elf=.aux.o)
$(RM) $(@:.elf=.aux.o) $(RM) $(@:.elf=.aux.o)
@echo -n Checking $@ for unsupported reloc types... @echo -n Checking $@ for unsupported reloc types...
......
...@@ -16,6 +16,8 @@ endif ...@@ -16,6 +16,8 @@ endif
cstart.o = $(TEST_DIR)/cstart64.o cstart.o = $(TEST_DIR)/cstart64.o
reloc.o = $(TEST_DIR)/reloc64.o reloc.o = $(TEST_DIR)/reloc64.o
OBJDIRS += lib/ppc64
# ppc64 specific tests # ppc64 specific tests
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