-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
59 lines (41 loc) · 1.26 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
ARMGNU ?= arm-linux-gnueabihf
INCLUDEPATH ?= "./h"
COPS = -Wall -O2 -nostdlib -nostartfiles -ffreestanding -mcpu=arm1176jzf-s -I $(INCLUDEPATH)
gcc : kernel.img
OBJS = build/startup.o
OBJS += build/uart.o
OBJS += build/timer.o
OBJS += build/interrupts.o
OBJS += build/OS_Cpu_a.o
OBJS += build/OS_Cpu_c.o
OBJS += build/ucos_ii.o
OBJS += build/main.o
OBJS += build/userApp.o
OBJS += lib/libc.a
OBJS += lib/libgcc.a
clean :
rm -f build/*.o
rm -f *.bin
rm -f *.hex
rm -f *.elf
rm -f *.list
rm -f *.img
rm -f build/*.bc
build/%.o : port/%.s
$(ARMGNU)-gcc $(COPS) -D__ASSEMBLY__ -c -o $@ $<
build/%.o : init/%.s
$(ARMGNU)-gcc $(COPS) -D__ASSEMBLY__ -c -o $@ $<
build/%.o : port/%.c
$(ARMGNU)-gcc $(COPS) -c -o $@ $<
build/%.o : bsp/%.c
$(ARMGNU)-gcc $(COPS) -c -o $@ $<
build/%.o : usrApp/%.c
$(ARMGNU)-gcc $(COPS) -c -o $@ $<
build/ucos_ii.o : ucos/ucos_ii.c
$(ARMGNU)-gcc $(COPS) ucos/ucos_ii.c -c -o build/ucos_ii.o
kernel.img : raspberrypi.ld $(OBJS)
$(ARMGNU)-ld $(OBJS) -T raspberrypi.ld -o ucos_bcm2835.elf
$(ARMGNU)-objdump -D ucos_bcm2835.elf > ucos_bcm2835.list
$(ARMGNU)-objcopy ucos_bcm2835.elf -O ihex ucos_bcm2835.hex
$(ARMGNU)-objcopy ucos_bcm2835.elf -O binary ucos_bcm2835.bin
$(ARMGNU)-objcopy ucos_bcm2835.elf -O binary kernel.img