]> rtime.felk.cvut.cz Git - fpga/virtex2/plasma.git/blob - software/Makefile
Added software Makefile.
[fpga/virtex2/plasma.git] / software / Makefile
1 # Annotation
2 #==================================================
3 # Script is capable of building different applications.
4 # Application target is an appropriate *.elf file name, 
5 # (e.g. "opcodes.elf") which must be listed in 
6 # ${ALL_ELF} variable and must have at least one rule
7 # with depending object files.
8 #
9 # See "Rules of different projects".
10 #
11 # WARNING !!!
12 # As the link process is not ideally implemented, when
13 # you are building an app then "boot.o" and "no_os.o"
14 # are usually dependencies. And "boot.o" MUST be listed
15 # as the first dependency!
16
17 AS             = mips-elf-as
18 CC             = mips-elf-gcc
19 LD             = mips-elf-ld
20 OD             = mips-elf-objdump
21
22 LDFLAGS        = -eentry -Ttext=0 -N -s
23 CFLAGS         = -I ${PLASMA_INCLUDE}
24
25 PLASMA_INCLUDE = ../plasma/tools
26
27 ALL_ELF        = opcodes.elf test.elf
28
29
30
31 .PHONY: help clean
32 help:
33
34
35 # Rules of different projects
36 #==================================================
37 opcodes.elf: opcodes.o
38
39 test.elf: boot.o test.o no_os.o
40
41
42 # General rules:
43 #==================================================
44 ${ALL_ELF}:
45         ${LD} ${LDFLAGS} -Map ${@:.elf=.map} -o $@ $^
46         ${OD} -d -t -S  $@ > ${@:.elf=.lst}
47
48 %.o: %.c
49         ${CC} ${CFLAGS} -c -o $@ $<
50
51 %.o: %.asm
52         ${AS} -o $@ $<
53
54 %.o: %.a
55         ${AS} -o $@ $<
56
57
58 # Special .PHONY targets
59 #==================================================
60 clean:
61         rm -r *.o *.elf *.lst *.map
62
63 help:
64         @echo Select one of the targets:
65         @echo ${ALL_ELF}
66
67
68 # Additional rules for "boot.o" and "no_os.o"
69 #==================================================
70 %.o: ${PLASMA_INCLUDE}/%.asm
71         ${AS} -o $@ $<
72
73 %.o: ${PLASMA_INCLUDE}/%.c
74         ${CC} ${CFLAGS} -c -o $@ $<
75