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

Subversion Repositories or1200_soc

[/] [or1200_soc/] [trunk/] [boards/] [de1_board/] [sw/] [tests/] [ecos_debug/] [Makefile] - Blame information for rev 25

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 25 qaztronic
ifndef CROSS_COMPILE
2
# CROSS_COMPILE = or32-elf-
3
CROSS_COMPILE = or32-uclinux-
4
CC = $(CROSS_COMPILE)gcc
5
LD = $(CROSS_COMPILE)ld
6
NM = $(CROSS_COMPILE)nm
7
OBJDUMP = $(CROSS_COMPILE)objdump
8
OBJCOPY = $(CROSS_COMPILE)objcopy
9
endif
10
 
11
export  CROSS_COMPILE
12
 
13
ROOT_DIR = ../../../../..
14
BOARD_DIR = ../../..
15
 
16
 
17
#
18
# main target
19
all: main.or32 System.map main_dis.txt main.hex
20
 
21
 
22
#
23
# compile the code
24
 
25
boot_vector_rom.o: boot_vector_rom.s or_soc.ld Makefile
26
        $(CC) -O2 -g -c -fomit-frame-pointer -o $@ $< $(CFLAGS)
27
 
28
reset.o: reset.s or_soc.ld Makefile
29
        $(CC) -O2 -g -c -fomit-frame-pointer -o $@ $< $(CFLAGS)
30
 
31
serial.o: serial.c serial.h Makefile
32
        $(CC) -O2 -g -c -fomit-frame-pointer -o $@ $< $(CFLAGS)
33
 
34
main.o: main.c Makefile
35
        $(CC) -O2 -g -c -fomit-frame-pointer -o $@ $< $(CFLAGS)
36
 
37
#
38
# link the objects
39
 
40
main.or32: boot_vector_rom.o reset.o serial.o main.o Makefile
41
        $(LD) --warn-common -Tor_soc.ld -o $@ boot_vector_rom.o reset.o main.o serial.o $(LIBS)
42
 
43
#
44
# dump human readable stuff
45
 
46
System.map: main.or32
47
        @$(NM) $< | \
48
                grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
49
                sort > System.map
50
 
51
main_dis.txt: main.or32
52
        $(OBJDUMP) -h -t -D main.or32 >main_dis.txt
53
 
54
#
55
# generate programing files
56
 
57
# main.hex: Makefile main.or32 $(ROOT_DIR)/sw/u-boot-1.3.4/u-boot.bin
58
main.hex: Makefile main.or32
59
        $(OBJCOPY) -O binary  -j .boot_vector_rom main.or32 boot_vector_rom.bin
60
        $(ROOT_DIR)/sw/perl/bin2readmemh.pl -s 32 -f boot_vector_rom.bin > boot_vector_rom.txt
61
        $(OBJCOPY) -O binary  -R .boot_vector_rom main.or32 boot_rom_0.bin
62
        $(ROOT_DIR)/sw/perl/bin2readmemh.pl -s 32 -f boot_rom_0.bin > boot_rom_0.txt
63
        $(OBJCOPY) -O binary $(ROOT_DIR)/sw/ecos_debug/install/bin/redboot.elf redboot.bin
64
        $(ROOT_DIR)/sw/perl/bin2readmemh.pl -s 8 -f ./redboot.bin > boot_rom_2.txt
65
        cp *.txt $(BOARD_DIR)/sw/load_this_to_ram/
66
 
67
 
68
#########################################################################
69
clean:
70
        find . -type f \
71
                \( -name 'core' -o -name '*.bak' -o -name '*~' \
72
                -o -name '*.o'  -o -name '*.a' -o -name '*.tmp' \
73
                -o -name '*.or32' -o -name '*.bin' -o -name '*.srec' \
74
                -o -name '*.mem' -o -name '*.img' -o -name '*.out' \
75
                -o -name '*.aux' -o -name '*.log' \) -print \
76
                | xargs rm -f
77
        rm -f $(BOARD_DIR)/sw/load_this_to_ram/*.txt
78
        rm -f $(BOARD_DIR)/sw/load_this_to_ram/*.mif
79
        rm -f *.hex
80
        rm -f *.mif
81
        rm -f *.txt
82
        rm -f System.map
83
 
84
distclean: clean
85
        find . -type f \
86
                \( -name .depend -o -name '*.srec' -o -name '*.bin' \
87
                -o -name '*.pdf' -o -name '*.hex' \) \
88
                -print | xargs rm -f
89
        rm -f $(OBJS) *.bak tags TAGS
90
        rm -fr *.*~
91
 
92
 

powered by: WebSVN 2.1.0

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