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

Subversion Repositories sardmips

[/] [sardmips/] [trunk/] [PROGRAMMING_CLASSIC/] [Makefile] - Blame information for rev 18

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 igorloi
# **********************************************
2
# Programs to build
3
# **********************************************
4
 
5
PROGS = My_Program
6
 
7
# **********************************************
8
# Endianness EB | EL
9
# **********************************************
10
 
11
#ENDIAN  = EB
12
ENDIAN  = EL
13
 
14
# **********************************************
15
# Bootstrap object file
16
# **********************************************
17
 
18
BOOTSTRAP = crt0.o
19
 
20
# **********************************************
21
# Compiler toolchain
22
# **********************************************
23
 
24
ifeq ($(ENDIAN),EL)
25
CC        = mipsel-linux-gcc
26
LD        = mipsel-linux-ld
27
OBJCOPY   = mipsel-linux-objcopy
28
OBJDUMP   = mipsel-linux-objdump
29
endif
30
 
31
ifeq ($(ENDIAN),EB)
32
CC        = mips-linux-gcc
33
LD        = mips-linux-ld
34
OBJCOPY   = mips-linux-objcopy
35
OBJDUMP   = mips-linux-objdump
36
endif
37
 
38
# **********************************************
39
# Compiler and linker options
40
# **********************************************
41
 
42
W_OPTS    = -Wimplicit -Wformat -Wall -Wstrict-prototypes
43
W_OPTS_A  = -Wformat -Wall -Wstrict-prototypes
44
 
45
 
46
CC_OPTS   = -Wa,-32 -mips1 -mno-abicalls -fno-pic -G 0 -pipe \
47
            -D$(ENDIAN) -fno-strict-aliasing -c -nostdinc
48
 
49
CC_OPTS_A = -Wa,-32 -mips1 -mno-abicalls -fno-pic -G 0 -pipe \
50
            -D$(ENDIAN) -fno-strict-aliasing -c -nostdinc
51
 
52
 
53
LD_SCRIPT = link.xn
54
LD_OPTS   = -G 0 -static -T $(LD_SCRIPT)
55
 
56
ifeq ($(ENDIAN),EB)
57
LD_FORMAT = elf32-tradbigmips
58
endif
59
 
60
ifeq ($(ENDIAN),EL)
61
LD_FORMAT = elf32-tradlittlemips
62
endif
63
 
64
 
65
# **********************************************
66
# Rules
67
# **********************************************
68
 
69
%.o : %.c
70
        $(CC) $(W_OPTS) $(CC_OPTS) -o $@ $<
71
 
72
%.o : %.S
73
        $(CC) $(W_OPTS_A) $(CC_OPTS_A) -o $@ $<
74
 
75
%.o : %.s
76
        $(CC) $(W_OPTS_A) $(CC_OPTS_A) -o $@ $<
77
 
78
all: $(PROGS)
79
 
80
 
81
My_Program : $(BOOTSTRAP) My_Program.o
82
        $(LD) $(LD_OPTS) -o $@ $?
83
        $(OBJCOPY) -O binary $@ $@.bin
84
 
85
clean :
86
        rm -f $(PROGS) *.bin *.o
87
        rm -f *~
88
 

powered by: WebSVN 2.1.0

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