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

Subversion Repositories potato

[/] [potato/] [trunk/] [benchmarks/] [sha256/] [Makefile] - Blame information for rev 63

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 skordal
# The Potato Processor Benchmark Applications
2
# (c) Kristian Klomsten Skordal 2015 
3 15 skordal
# Report bugs and issues on 
4 13 skordal
 
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 13 skordal
TARGET_SIZE := $(TARGET_PREFIX)-size
11
TARGET_OBJCOPY := $(TARGET_PREFIX)-objcopy
12
HEXDUMP ?= hexdump
13
 
14 20 skordal
TARGET_CFLAGS += -m32 -march=RV32I -Wall -Os -fomit-frame-pointer \
15 61 skordal
        -ffreestanding -fno-builtin -I.. -std=gnu99 \
16
        -Wall -Werror=implicit-function-declaration
17 63 skordal
TARGET_LDFLAGS += -m32 -march=RV32I -nostartfiles -Wl,-m,elf32lriscv \
18
        -Wl,-T../benchmark.ld
19 13 skordal
 
20 61 skordal
OBJECTS := gpio.o main.o seg7.o sha256.o start.o timer.o uart.o utilities.o
21 13 skordal
 
22
all: sha256.coe
23
 
24
sha256.elf: $(OBJECTS)
25
        $(TARGET_LD) -o sha256.elf $(TARGET_LDFLAGS) $(OBJECTS)
26
        $(TARGET_SIZE) sha256.elf
27
 
28
sha256.bin: sha256.elf
29
        $(TARGET_OBJCOPY) -j .text -j .data -O binary sha256.elf sha256.bin
30
 
31
sha256.coe: sha256.bin
32
        echo "memory_initialization_radix=16;" > sha256.coe
33
        echo "memory_initialization_vector=" >> sha256.coe
34 58 skordal
        for i in $$(seq 0 63); do echo 00000013 >> sha256.coe; done
35 13 skordal
        $(HEXDUMP) -v -e '1/4 "%08x\n"' sha256.bin >> sha256.coe
36
        echo ";" >> sha256.coe
37
 
38
clean:
39
        -$(RM) $(OBJECTS)
40
        -$(RM) sha256.elf sha256.bin sha256.coe
41
 
42
# Object file rules:
43
 
44
gpio.o: gpio.c gpio.h ../platform.h
45
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
46
 
47 61 skordal
main.o: main.c gpio.h timer.h seg7.h sha256.h ../platform.h ../potato.h
48 13 skordal
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
49
 
50 61 skordal
seg7.o: seg7.c seg7.h ../platform.h
51
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
52
 
53 13 skordal
sha256.o: sha256.c sha256.h
54
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
55
 
56
start.o: ../start.S ../platform.h
57
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
58
 
59
timer.o: timer.c timer.h ../platform.h
60
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
61
 
62
uart.o: uart.c uart.h ../platform.h
63
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
64
 
65
utilities.o: utilities.c utilities.h
66
        $(TARGET_CC) -c -o $@ $(TARGET_CFLAGS) $<
67
 

powered by: WebSVN 2.1.0

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