From: Thomas Huth <thuth@xxxxxxxxxx> The changes for out-of-tree builds are here pretty much the same as for the ARM Makefile.common. Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx> Signed-off-by: Alex Bennée <alex.bennee@xxxxxxxxxx> --- v2 - OBJDIRS --- powerpc/Makefile.common | 15 +++++++++------ powerpc/Makefile.ppc64 | 2 ++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/powerpc/Makefile.common b/powerpc/Makefile.common index e536ffe..db5ba62 100644 --- a/powerpc/Makefile.common +++ b/powerpc/Makefile.common @@ -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... diff --git a/powerpc/Makefile.ppc64 b/powerpc/Makefile.ppc64 index 3c0294a..dc4e088 100644 --- a/powerpc/Makefile.ppc64 +++ b/powerpc/Makefile.ppc64 @@ -17,6 +17,8 @@ cstart.o = $(TEST_DIR)/cstart64.o reloc.o = $(TEST_DIR)/reloc64.o cflatobjs += lib/ppc64/spinlock.o +OBJDIRS += lib/ppc64 + # ppc64 specific tests tests = -- 2.11.0