OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [src_processor/] [mor1kx-3.1/] [sw/] [Makefile] - Blame information for rev 38

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

Line No. Rev Author Line
1 38 alirezamon
HDR_SOURCE_DIR=mor1kx
2
 
3
TOOLCHAIN=$(PRONOC_WORK)/toolchain/or1k-elf
4
IHEX2MIF =$(PRONOC_WORK)/toolchain/bin/ihex2mif
5
IHEX2BIN =$(PRONOC_WORK)/toolchain/bin/ihex2bin
6
BIN2HEX =$(PRONOC_WORK)/toolchain/bin/bin2str
7
 
8
 
9
OR32_TOOL_PREFIX=${TOOLCHAIN}/bin/or1k-elf-
10
 
11
OR32_LD=$(OR32_TOOL_PREFIX)ld
12
OR32_AS=$(OR32_TOOL_PREFIX)as
13
OR32_CC=$(OR32_TOOL_PREFIX)gcc
14
OR32_AR=$(OR32_TOOL_PREFIX)ar
15
OR32_OBJDUMP=$(OR32_TOOL_PREFIX)objdump
16
OR32_OBJCOPY=$(OR32_TOOL_PREFIX)objcopy
17
OR32_LIB1=${TOOLCHAIN}/lib/gcc/or1k-elf/5.2.0
18
 
19
LIBRARIES = -L${OR32_LIB1} -L. -L./$(HDR_SOURCE_DIR) -lorlib -lgcc
20
 
21
MARCH_FLAGS ?=-msoft-mul -msoft-div -msoft-float
22
CFLAGS ?= -g -nostdlib -O2 $(MARCH_FLAGS)
23
 
24
LDFLAGS ?=    -Tlink.ld  -e 256
25
 
26
RAMSIZE=3FFF
27
 
28
# Sources to go into the liborpsoc.a support library
29
COMPILE_SRCS=$(HDR_SOURCE_DIR)/exceptions.c $(HDR_SOURCE_DIR)/int.c  $(HDR_SOURCE_DIR)/mmu.S  $(HDR_SOURCE_DIR)/$(HDR_SOURCE_DIR)-utils.c $(HDR_SOURCE_DIR)/cache.S
30
 
31
 
32
all: image.ihex
33
 
34
lib:
35
#compile all source code
36
        $(OR32_CC) -Wall $(CFLAGS) -c $(COMPILE_SRCS) -I./$(HDR_SOURCE_DIR)/include/
37
#add them to liborlib.a
38
        $(OR32_AR) -cvq liborlib.a *.o
39
 
40
crt0.o: ./$(HDR_SOURCE_DIR)/crt0.S
41
        $(OR32_CC) $(CFLAGS) -c  ./$(HDR_SOURCE_DIR)/crt0.S -I./$(HDR_SOURCE_DIR)/include/
42
 
43
#compile main file using liborlib.a
44
main.o: lib main.c
45
        $(OR32_CC) -Wall $(CFLAGS) -c main.c  -o main.o
46
 
47
image:  crt0.o main.o   Makefile
48
        $(OR32_LD) $(LDFLAGS) -Map image.map -N -o image crt0.o main.o $(LIBRARIES)
49
 
50
 
51
image.lst: image
52
        $(OR32_OBJDUMP) -h -S $< > $@
53
 
54
 
55
image.ihex: image image.lst
56
# Convert the ELF file to an IHEX file
57
        mkdir -p ./RAM
58
        $(OR32_OBJCOPY) -O ihex image image.ihex
59
# Generate a MIF & BIN files from the IHEX file
60
        $(IHEX2MIF) -f image.ihex -e $(RAMSIZE) -o RAM/ram0.mif
61
        $(IHEX2BIN) -i image.ihex -o RAM/ram0.bin
62
        $(BIN2HEX)  -f RAM/ram0.bin -h
63
        rm *.o *.a
64
 
65
 
66
 
67
 
68
clean:
69
        rm -f image.ihex  image image.lst image.bin image.srec image.map  image.ram image.hex RAM/* *.o *.a
70
 

powered by: WebSVN 2.1.0

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