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

Subversion Repositories or1k_soc_on_altera_embedded_dev_kit

[/] [or1k_soc_on_altera_embedded_dev_kit/] [trunk/] [soc/] [sw/] [sd_boot_loader/] [Makefile] - Blame information for rev 22

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 xianfeng
ifndef CROSS_COMPILE
2 22 xianfeng
CROSS_COMPILE = or32-elf-
3
#CROSS_COMPILE = or32-uclinux-
4 12 xianfeng
CC = $(CROSS_COMPILE)gcc
5
LD = $(CROSS_COMPILE)ld
6
NM = $(CROSS_COMPILE)nm
7
OBJ = $(CROSS_COMPILE)objdump
8
OBJC = $(CROSS_COMPILE)objcopy
9
endif
10
 
11
CFLAGS  = -O2 -g -c -Wunknown-pragmas -mhard-mul -msoft-div -msoft-float
12
LD_FLAGS= --stats -Tram.ld
13
INCL    = board.h spr_defs.h
14
OBJECTS = BootReset.o main.o revision.o
15
LIBS    =
16
 
17
export  CROSS_COMPILE
18
 
19
all: boot.or32 boot.ihex System.map
20
 
21
boot.or32: $(OBJECTS) Makefile
22
        @printf "\r\n\t--- Linking ---\r\n"
23
        $(LD) -Map System.map -Bstatic $(OBJECTS) $(LIBS) $(LD_FLAGS) -o $@
24
        @$(NM) $< | \
25
                grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
26
                sort >> System.map
27
                $(OBJ) -x -d -S boot.or32 >> System.map
28
 
29
boot.ihex: boot.or32 Makefile
30
        @printf "\r\n\t--- Creating Ihex file: $@ ---\r\n"
31
        $(OBJC) -O ihex boot.or32 boot.ihex
32
        $(OBJC) -O binary boot.or32 boot.bin
33
        sed "/:04/d" boot.ihex > boot.hex
34
        perl ../utils/hex2mif8.pl < boot.ihex > boot.mif
35
        cp boot.mif '../../prj/altera/bootrom/'
36
 
37
%.o:%.S $(INCL) Makefile
38
        @printf "\r\n\t--- Assembling $(<) ---\r\n"
39
        $(CC) $(CFLAGS) -o $@ $(<)
40
 
41
%.o:%.c $(INCL) Makefile
42
        @printf "\r\n\t--- Compiling $(<) ---\r\n"
43
        $(CC) $(CFLAGS) -o $@ $(<)
44
 
45
 
46
#########################################################################
47
 
48
clean:
49
        @rm *.o
50
        @rm boot.*
51
        @rm System.map
52
 
53
 
54
distclean: clean
55
        find . -type f \
56
                \( -name .depend -o -name '*.srec' -o -name '*.bin' \
57
                -o -name '*.pdf' \) \
58
                -print | xargs rm -f
59
        rm -f $(OBJS) *.bak tags TAGS
60
        rm -fr *.*~
61
 
62
 

powered by: WebSVN 2.1.0

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