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

Subversion Repositories or1200_soc

[/] [or1200_soc/] [trunk/] [boards/] [de1_board/] [sw/] [tests/] [debug/] [Makefile] - Blame information for rev 21

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

Line No. Rev Author Line
1 21 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 -x 1 -d 4 -s 32 -f boot_vector_rom.bin > boot_vector_rom.txt
61
        $(ROOT_DIR)/sw/perl/bin2readmemh.pl -s 32 -f boot_vector_rom.bin > boot_vector_rom.txt
62
        $(OBJCOPY) -O binary  -R .boot_vector_rom main.or32 boot_rom_0.bin
63
#       $(ROOT_DIR)/sw/perl/bin2readmemh.pl -x 1 -d 256 -s 32 -f boot_rom_0.bin > boot_rom_0.txt
64
        $(ROOT_DIR)/sw/perl/bin2readmemh.pl -s 32 -f boot_rom_0.bin > boot_rom_0.txt
65
#       $(ROOT_DIR)/sw/perl/bin2readmemh.pl -x 1 -d 32768 -s 32 -f $(ROOT_DIR)/sw/u-boot-2009.03/u-boot.bin > boot_rom_2.txt
66
        $(ROOT_DIR)/sw/perl/bin2readmemh.pl -s 8 -f $(ROOT_DIR)/sw/u-boot-2009.03/u-boot.bin > boot_rom_2.txt
67
        cp *.txt $(BOARD_DIR)/sw/load_this_to_ram/
68
 
69
 
70
#########################################################################
71
clean:
72
        find . -type f \
73
                \( -name 'core' -o -name '*.bak' -o -name '*~' \
74
                -o -name '*.o'  -o -name '*.a' -o -name '*.tmp' \
75
                -o -name '*.or32' -o -name '*.bin' -o -name '*.srec' \
76
                -o -name '*.mem' -o -name '*.img' -o -name '*.out' \
77
                -o -name '*.aux' -o -name '*.log' \) -print \
78
                | xargs rm -f
79
        rm -f $(BOARD_DIR)/sw/load_this_to_ram/*.txt
80
        rm -f $(BOARD_DIR)/sw/load_this_to_ram/*.mif
81
        rm -f *.hex
82
        rm -f *.mif
83
        rm -f *.txt
84
        rm -f System.map
85
 
86
distclean: clean
87
        find . -type f \
88
                \( -name .depend -o -name '*.srec' -o -name '*.bin' \
89
                -o -name '*.pdf' -o -name '*.hex' \) \
90
                -print | xargs rm -f
91
        rm -f $(OBJS) *.bak tags TAGS
92
        rm -fr *.*~
93
 
94
 

powered by: WebSVN 2.1.0

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