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.
9 # See "Rules of different projects".
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!
22 LDFLAGS = -eentry -Ttext=0 -N -s
23 CFLAGS = -I ${PLASMA_INCLUDE}
25 PLASMA_INCLUDE = ../plasma/tools
27 ALL_ELF = opcodes.elf test.elf
35 # Rules of different projects
36 #==================================================
37 opcodes.elf: opcodes.o
39 test.elf: boot.o test.o no_os.o
43 #==================================================
45 ${LD} ${LDFLAGS} -Map ${@:.elf=.map} -o $@ $^
46 ${OD} -d -t -S $@ > ${@:.elf=.lst}
49 ${CC} ${CFLAGS} -c -o $@ $<
58 # Special .PHONY targets
59 #==================================================
61 rm -r *.o *.elf *.lst *.map
64 @echo Select one of the targets:
68 # Additional rules for "boot.o" and "no_os.o"
69 #==================================================
70 %.o: ${PLASMA_INCLUDE}/%.asm
73 %.o: ${PLASMA_INCLUDE}/%.c
74 ${CC} ${CFLAGS} -c -o $@ $<