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

Subversion Repositories potato

[/] [potato/] [tags/] [v0.1/] [benchmarks/] [hello/] [Makefile] - Blame information for rev 47

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
TARGET_LD := $(TARGET_PREFIX)-ld
10
TARGET_SIZE := $(TARGET_PREFIX)-size
11
TARGET_OBJCOPY := $(TARGET_PREFIX)-objcopy
12
HEXDUMP ?= hexdump
13
 
14
TARGET_CFLAGS += -m32 -march=RV32I -Wall -O2 -fomit-frame-pointer \
15
        -ffreestanding -fno-builtin -I.. -std=gnu99
16
TARGET_LDFLAGS += -m elf32lriscv -T../benchmark.ld
17
 
18
OBJECTS := main.o start.o
19
 
20
all: hello.coe
21
 
22
hello.elf: $(OBJECTS)
23
        $(TARGET_LD) -o hello.elf $(TARGET_LDFLAGS) $(OBJECTS)
24
        $(TARGET_SIZE) hello.elf
25
 
26
hello.bin: hello.elf
27
        $(TARGET_OBJCOPY) -j .text -j .data -O binary hello.elf hello.bin
28
 
29
hello.coe: hello.bin
30
        echo "memory_initialization_radix=16;" > hello.coe
31
        echo "memory_initialization_vector=" >> hello.coe
32
        $(HEXDUMP) -v -e '1/4 "%08x\n"' hello.bin >> hello.coe
33
        echo ";" >> hello.coe
34
 
35
clean:
36
        -$(RM) $(OBJECTS)
37
        -$(RM) hello.elf hello.bin hello.coe
38
 
39
# Object file rules:
40
 
41
main.o: main.c ../platform.h ../potato.h
42
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
43
 
44
start.o: ../start.S ../platform.h
45
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
46
 

powered by: WebSVN 2.1.0

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