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

Subversion Repositories potato

[/] [potato/] [trunk/] [benchmarks/] [hello/] [Makefile] - Blame information for rev 64

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 skordal
# The Potato Processor Benchmark Applications
2
# (c) Kristian Klomsten Skordal 2015 
3
# Report bugs and issues on 
4
 
5
.PHONY: all clean
6
 
7
TARGET_PREFIX ?= riscv64-unknown-elf
8
TARGET_CC := $(TARGET_PREFIX)-gcc
9 63 skordal
TARGET_LD := $(TARGET_PREFIX)-gcc
10 38 skordal
TARGET_SIZE := $(TARGET_PREFIX)-size
11
TARGET_OBJCOPY := $(TARGET_PREFIX)-objcopy
12
HEXDUMP ?= hexdump
13
 
14 63 skordal
TARGET_CFLAGS += -m32 -march=RV32I -Wall -Os -fomit-frame-pointer \
15
        -ffreestanding -fno-builtin -I.. -std=gnu99 \
16
        -Wall -Werror=implicit-function-declaration
17
TARGET_LDFLAGS += -m32 -march=RV32I -nostartfiles -Wl,-m,elf32lriscv \
18
        -Wl,-T../benchmark.ld
19 38 skordal
 
20
OBJECTS := main.o start.o
21
 
22
all: hello.coe
23
 
24
hello.elf: $(OBJECTS)
25
        $(TARGET_LD) -o hello.elf $(TARGET_LDFLAGS) $(OBJECTS)
26
        $(TARGET_SIZE) hello.elf
27
 
28
hello.bin: hello.elf
29
        $(TARGET_OBJCOPY) -j .text -j .data -O binary hello.elf hello.bin
30
 
31
hello.coe: hello.bin
32
        echo "memory_initialization_radix=16;" > hello.coe
33
        echo "memory_initialization_vector=" >> hello.coe
34
        $(HEXDUMP) -v -e '1/4 "%08x\n"' hello.bin >> hello.coe
35
        echo ";" >> hello.coe
36
 
37
clean:
38
        -$(RM) $(OBJECTS)
39
        -$(RM) hello.elf hello.bin hello.coe
40
 
41
# Object file rules:
42
 
43
main.o: main.c ../platform.h ../potato.h
44
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
45
 
46
start.o: ../start.S ../platform.h
47
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
48
 

powered by: WebSVN 2.1.0

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