OpenCores
URL https://opencores.org/ocsvn/potato/potato/trunk

Subversion Repositories potato

[/] [potato/] [trunk/] [benchmarks/] [hello/] [Makefile] - Diff between revs 45 and 63

Only display areas with differences | Details | Blame | View Log

Rev 45 Rev 63
# The Potato Processor Benchmark Applications
# The Potato Processor Benchmark Applications
# (c) Kristian Klomsten Skordal 2015 
# (c) Kristian Klomsten Skordal 2015 
# Report bugs and issues on 
# Report bugs and issues on 
.PHONY: all clean
.PHONY: all clean
TARGET_PREFIX ?= riscv64-unknown-elf
TARGET_PREFIX ?= riscv64-unknown-elf
TARGET_CC := $(TARGET_PREFIX)-gcc
TARGET_CC := $(TARGET_PREFIX)-gcc
TARGET_LD := $(TARGET_PREFIX)-ld
TARGET_LD := $(TARGET_PREFIX)-gcc
TARGET_SIZE := $(TARGET_PREFIX)-size
TARGET_SIZE := $(TARGET_PREFIX)-size
TARGET_OBJCOPY := $(TARGET_PREFIX)-objcopy
TARGET_OBJCOPY := $(TARGET_PREFIX)-objcopy
HEXDUMP ?= hexdump
HEXDUMP ?= hexdump
 
 
TARGET_CFLAGS += -m32 -march=RV32I -Wall -O2 -fomit-frame-pointer \
TARGET_CFLAGS += -m32 -march=RV32I -Wall -Os -fomit-frame-pointer \
        -ffreestanding -fno-builtin -I.. -std=gnu99
        -ffreestanding -fno-builtin -I.. -std=gnu99 \
TARGET_LDFLAGS += -m elf32lriscv -T../benchmark.ld
        -Wall -Werror=implicit-function-declaration
 
TARGET_LDFLAGS += -m32 -march=RV32I -nostartfiles -Wl,-m,elf32lriscv \
 
        -Wl,-T../benchmark.ld
 
 
OBJECTS := main.o start.o
OBJECTS := main.o start.o
all: hello.coe
all: hello.coe
hello.elf: $(OBJECTS)
hello.elf: $(OBJECTS)
        $(TARGET_LD) -o hello.elf $(TARGET_LDFLAGS) $(OBJECTS)
        $(TARGET_LD) -o hello.elf $(TARGET_LDFLAGS) $(OBJECTS)
        $(TARGET_SIZE) hello.elf
        $(TARGET_SIZE) hello.elf
hello.bin: hello.elf
hello.bin: hello.elf
        $(TARGET_OBJCOPY) -j .text -j .data -O binary hello.elf hello.bin
        $(TARGET_OBJCOPY) -j .text -j .data -O binary hello.elf hello.bin
hello.coe: hello.bin
hello.coe: hello.bin
        echo "memory_initialization_radix=16;" > hello.coe
        echo "memory_initialization_radix=16;" > hello.coe
        echo "memory_initialization_vector=" >> hello.coe
        echo "memory_initialization_vector=" >> hello.coe
        $(HEXDUMP) -v -e '1/4 "%08x\n"' hello.bin >> hello.coe
        $(HEXDUMP) -v -e '1/4 "%08x\n"' hello.bin >> hello.coe
        echo ";" >> hello.coe
        echo ";" >> hello.coe
clean:
clean:
        -$(RM) $(OBJECTS)
        -$(RM) $(OBJECTS)
        -$(RM) hello.elf hello.bin hello.coe
        -$(RM) hello.elf hello.bin hello.coe
# Object file rules:
# Object file rules:
main.o: main.c ../platform.h ../potato.h
main.o: main.c ../platform.h ../potato.h
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
start.o: ../start.S ../platform.h
start.o: ../start.S ../platform.h
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.