|
|
|
@ -2,8 +2,8 @@ ARCH = $(shell uname -m)
|
|
|
|
|
ifneq ("$(ARCH)", "ppc64")
|
|
|
|
|
ifneq ("$(ARCH)", "ppc64le")
|
|
|
|
|
CROSS_COMPILE ?= powerpc64le-linux-
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
CC = $(CROSS_COMPILE)gcc
|
|
|
|
|
LD = $(CROSS_COMPILE)ld
|
|
|
|
@ -16,13 +16,13 @@ LDFLAGS = -T powerpc.lds
|
|
|
|
|
all: hello_world.hex
|
|
|
|
|
|
|
|
|
|
hello_world.elf: hello_world.o head.o console.o
|
|
|
|
|
$(LD) $(LDFLAGS) -o hello_world.elf hello_world.o head.o console.o
|
|
|
|
|
$(LD) $(LDFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
|
|
hello_world.bin: hello_world.elf
|
|
|
|
|
$(OBJCOPY) -O binary hello_world.elf hello_world.bin
|
|
|
|
|
$(OBJCOPY) -O binary $^ $@
|
|
|
|
|
|
|
|
|
|
hello_world.hex: hello_world.bin
|
|
|
|
|
../scripts/bin2hex.py hello_world.bin > hello_world.hex
|
|
|
|
|
../scripts/bin2hex.py $^ > $@
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
@rm -f *.o hello_world.elf hello_world.bin hello_world.hex
|
|
|
|
|