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/] [aeMB/] [sw/] [Makefile] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 alirezamon
SOURCE_LIB =
2
include SOURCE_LIB
3
 
4
HDR_SOURCE_DIR=aemb
5
 
6
TOOLCHAIN=$(PRONOC_WORK)/toolchain/aemb
7
IHEX2MIF =$(PRONOC_WORK)/toolchain/bin/ihex2mif
8
IHEX2BIN =$(PRONOC_WORK)/toolchain/bin/ihex2bin
9
BIN2HEX =$(PRONOC_WORK)/toolchain/bin/bin2str
10
BIN2MIF=$(PRONOC_WORK)/toolchain/bin/bin2mif
11
BIN2MEM=$(PRONOC_WORK)/toolchain/bin/bin2mem
12
 
13
MB_TOOL_PREFIX=${TOOLCHAIN}/bin/mb-
14
MB_LD=$(MB_TOOL_PREFIX)ld
15
MB_AS=$(MB_TOOL_PREFIX)as
16
MB_CC=$(MB_TOOL_PREFIX)g++
17
MB_AR=$(MB_TOOL_PREFIX)ar
18
MB_OBJDUMP=$(MB_TOOL_PREFIX)objdump
19
MB_OBJCOPY=$(MB_TOOL_PREFIX)objcopy
20
MB_LIB1=${TOOLCHAIN}/lib/gcc/microblaze-xilinx-elf/4.1.1
21
 
22
ELFFILE=image
23
XILFLAGS=-mtune=v5.00 -mxl-soft-div -msoft-float -mxl-barrel-shift -mno-xl-soft-mul
24
CXXFLAGS=-O3
25
#LNKFLAGS=-Wl,-defsym -Wl,_STACK_SIZE=$(STACK_SIZE) -Wl,-defsym -Wl,_HEAP_SIZE=$(HEAP_SIZE)
26
LIBFLAGS=
27
INCFLAGS=-Icc/
28
 
29
LDFLAGS ?=    -Tlink.ld  -e 256
30
 
31
LIBRARIES = -L${MB_LIB1} -L. -L./$(HDR_SOURCE_DIR) -lorlib -lgcc
32
#LIBRARIES =  -L. -lorlib -lgcc
33
 
34
# Sources to go into the liborpsoc.a support library
35
COMPILE_SRCS=     $(SOURCE_LIB)
36
 
37
#$(HDR_SOURCE_DIR)/custom_crt/_interrupt_handler.s
38
ASSEMBELS=    $(HDR_SOURCE_DIR)/__main.c  $(HDR_SOURCE_DIR)/custom_crt/_exception_handler.s   $(HDR_SOURCE_DIR)/custom_crt/_hw_exception_handler.s
39
 
40
 
41
 
42
all: image.ihex
43
 
44
lib:
45
#compile all source code
46
        $(MB_CC) -Wall $(XILFLAGS) $(CXXFLAGS) $(LIBFLAGS) $(INCFLAGS) -specs=aemb.specs -c $(COMPILE_SRCS) $(ASSEMBELS)
47
#add them to liborlib.a
48
        $(MB_AR) -cvq liborlib.a *.o
49
 
50
 
51
#compile main file using liborlib.a
52
main.o: lib main.c
53
        $(MB_CC) -Wall $(XILFLAGS) $(CXXFLAGS) $(LIBFLAGS) $(INCFLAGS) -specs=aemb.specs -c main.c  -o main.o
54
        $(MB_CC) -Wall $(XILFLAGS) $(CXXFLAGS) $(LIBFLAGS) $(INCFLAGS) -specs=aemb.specs -c $(HDR_SOURCE_DIR)/custom_crt/crt0.s  -o crt0.o
55
        $(MB_CC) -Wall $(XILFLAGS) $(CXXFLAGS) $(LIBFLAGS) $(INCFLAGS) -specs=aemb.specs -c $(HDR_SOURCE_DIR)/custom_crt/crtinit.s -o crtinit.o
56
        #$(MB_LD) -Ur  crt0.o crtinit.o  main.o -o mm.o
57
image: main.o  Makefile
58
        #$(MB_CC) -Wall $(XILFLAGS) $(CXXFLAGS) $(LNKFLAGS) $(LIBFLAGS) $(INCFLAGS) -specs=aemb.specs main.o  -o $(ELFFILE) $(LIBRARIES)
59
        $(MB_LD) $(LDFLAGS) crt0.o crtinit.o  main.o -Map image.map -N -o  image    $(LIBRARIES)
60
 
61
image.lst: image
62
        $(MB_OBJDUMP) -h -S $< > $@
63
 
64
 
65
image.ihex: image image.lst
66
# Convert the ELF file to an IHEX file
67
        mkdir -p ./RAM
68
        $(MB_OBJCOPY) -O ihex image image.ihex
69
# Generate a MIF & BIN files from the IHEX file
70
#       $(IHEX2MIF) -f image.ihex -e $(RAMSIZE) -o RAM/ram0.mif
71
#       $(IHEX2MIF) -f image.ihex -o RAM/ram0.mif
72
        $(IHEX2BIN) -i image.ihex -o RAM/ram0.bin
73
        $(BIN2MIF)  -f RAM/ram0.bin -o RAM/ram0.mif -w 32
74
        $(BIN2MEM)  -f RAM/ram0.bin -o RAM/ram0.mem -w 32
75
        $(BIN2HEX)  -f RAM/ram0.bin -h
76
        rm *.o *.a
77
 
78
 
79
clean:
80
        rm -f image.ihex  image image.lst image.bin image.srec image.map  image.ram image.hex RAM/* *.o *.a
81
 

powered by: WebSVN 2.1.0

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