1
0
mirror of https://github.com/antonblanchard/chiselwatt.git synced 2026-02-28 17:29:58 +00:00
Files
Carlos de Paula 4f1d3e5ae7 Add hello_world sample sources and Makefile targets
Added hello_world sources and new Makefile targets for building
hello_world and Micropython inside containers.

Updated documentation reflecting these changes and moved binaries
to ./samples/binaries/.

Signed-off-by: Carlos de Paula <me@carlosedp.com>
2020-04-28 13:50:50 -03:00

29 lines
847 B
Makefile

ARCH = $(shell uname -m)
ifneq ("$(ARCH)", "ppc64")
ifneq ("$(ARCH)", "ppc64le")
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
ASFLAGS = $(CFLAGS)
LDFLAGS = -T powerpc.lds
all: hello_world.bin
hello_world.elf: hello_world.o head.o
$(LD) $(LDFLAGS) -o hello_world.elf hello_world.o head.o
hello_world.bin: hello_world.elf
$(OBJCOPY) -O binary hello_world.elf hello_world.bin
hello_world.hex: hello_world.bin
../../scripts/bin2hex.py hello_world.bin > hello_world.hex
clean:
@rm -f *.o hello_world.elf hello_world.bin hello_world.hex