From 06b28be5776883d6decc95d4f6126fbb0eb39e4d Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Thu, 16 Apr 2020 17:38:07 +1000 Subject: [PATCH] hello_world: Use Makefile automatic variables Fix a few whitespace issues while here. Signed-off-by: Anton Blanchard --- hello_world/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hello_world/Makefile b/hello_world/Makefile index f7f9497..674095e 100644 --- a/hello_world/Makefile +++ b/hello_world/Makefile @@ -1,28 +1,28 @@ ARCH = $(shell uname -m) ifneq ("$(ARCH)", "ppc64") ifneq ("$(ARCH)", "ppc64le") - CROSS_COMPILE ?= powerpc64le-linux- - endif - endif + CROSS_COMPILE ?= powerpc64le-linux- +endif +endif CC = $(CROSS_COMPILE)gcc LD = $(CROSS_COMPILE)ld OBJCOPY = $(CROSS_COMPILE)objcopy -CFLAGS = -Os -g -Wall -std=c99 -msoft-float -mno-string -mno-multiple -mno-vsx -mno-altivec -mlittle-endian -fno-stack-protector -mstrict-align -ffreestanding -fdata-sections -ffunction-sections +CFLAGS = -Os -g -Wall -std=c99 -msoft-float -mno-string -mno-multiple -mno-vsx -mno-altivec -mlittle-endian -fno-stack-protector -mstrict-align -ffreestanding -fdata-sections -ffunction-sections ASFLAGS = $(CFLAGS) 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 -- 2.30.2