You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
859 B
Makefile
29 lines
859 B
Makefile
5 years ago
|
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 -I ../../hello_world
|
||
|
ASFLAGS = $(CFLAGS)
|
||
|
LDFLAGS = -T powerpc.lds
|
||
|
|
||
|
all: $(TEST).hex
|
||
|
|
||
|
$(TEST).elf: $(TEST).o head.o ../../hello_world/console.o
|
||
|
$(LD) $(LDFLAGS) -o $(TEST).elf $(TEST).o head.o ../../hello_world/console.o
|
||
|
|
||
|
$(TEST).bin: $(TEST).elf
|
||
|
$(OBJCOPY) -O binary $(TEST).elf $(TEST).bin
|
||
|
|
||
|
$(TEST).hex: $(TEST).bin
|
||
|
../../scripts/bin2hex.py $(TEST).bin > $(TEST).hex
|
||
|
|
||
|
clean:
|
||
|
@rm -f *.o $(TEST).elf $(TEST).bin $(TEST).hex
|