mirror of
https://github.com/antonblanchard/microwatt.git
synced 2026-01-11 23:43:15 +00:00
.oOOo.
." ".
; .mw. ; Microwatt, it works.
. ' ' .
\ || / HDL Git SHA1: 211d23c4ad4fb5-dirty
;..;
;..;
`ww'
Signed-off-by: Dan Horák <dan@danny.cz>
Signed-off-by: Michael Neuling <mikey@neuling.org>
36 lines
923 B
Makefile
36 lines
923 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
|
|
|
|
console.o: ../lib/console.c
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -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.hex: hello_world.bin
|
|
../scripts/bin2hex.py $^ > hello_world.hex.tmp
|
|
mv -f hello_world.hex.tmp hello_world.hex
|
|
|
|
clean:
|
|
@rm -f *.o hello_world.elf hello_world.bin hello_world.hex
|
|
distclean: clean
|
|
rm -f *~
|
|
|