1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-01-11 23:43:15 +00:00
Benjamin Herrenschmidt c5f5f50738 hello_world: Use new headers and frequency from syscon
This uses the new header files for register definitions and
extracts the core frequency from syscon rather than hard coding it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2020-05-08 21:06:16 +10:00

29 lines
765 B
Makefile

ARCH = $(shell uname -m)
ifneq ("$(ARCH)", "ppc64")
ifneq ("$(ARCH)", "ppc64le")
CROSS_COMPILE ?= powerpc64le-linux-gnu-
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 -I../include
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.bin: hello_world.elf
$(OBJCOPY) -O binary $^ $@
hello_world.hex: hello_world.bin
../scripts/bin2hex.py $^ > $@
clean:
@rm -f *.o hello_world.elf hello_world.bin hello_world.hex