annotate src/old_makefiles/makefile-armclang @ 120:ed85941a7514

mv old-makefiel
author anatofuz
date Mon, 02 Dec 2019 19:12:01 +0900
parents src/makefile-armclang@33c9000056b5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 # specify path to QEMU, installed with MacPorts
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 QEMU = qemu-system-arm
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
20
33c9000056b5 use cortex-a15
kono
parents: 18
diff changeset
4 CPU = armv8
33c9000056b5 use cortex-a15
kono
parents: 18
diff changeset
5 QEMUCPU = cortex-a15
0
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 include makefile.inc
14
02a1ce33746e armclang
mir3636
parents: 13
diff changeset
7 CC = /usr/local/cbclang/bin/clang
02a1ce33746e armclang
mir3636
parents: 13
diff changeset
8 AS = arm-linux-gnu-as
02a1ce33746e armclang
mir3636
parents: 13
diff changeset
9 LD = arm-linux-gnu-ld
02a1ce33746e armclang
mir3636
parents: 13
diff changeset
10 OBJCOPY = arm-linux-gnu-objcopy
02a1ce33746e armclang
mir3636
parents: 13
diff changeset
11 OBJDUMP = arm-linux-gnu-objdump
02a1ce33746e armclang
mir3636
parents: 13
diff changeset
12
20
33c9000056b5 use cortex-a15
kono
parents: 18
diff changeset
13 # CFLAGS = -march=${CPU} -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Werror -I. -g -O0
33c9000056b5 use cortex-a15
kono
parents: 18
diff changeset
14 CFLAGS = -target ${CPU}-linux-gnueabihf -march=${CPU} -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -I. -I ../cbclang/arm -g -O0
16
7eb81a3c4b29 kernel.elf
tobaru
parents: 14
diff changeset
15 LDFLAGS = --noinhibit-exec
20
33c9000056b5 use cortex-a15
kono
parents: 18
diff changeset
16 # ASFLAGS = -march=${CPU}
33c9000056b5 use cortex-a15
kono
parents: 18
diff changeset
17 ASFLAGS = -target ${CPU}-linux-gnueabihf
14
02a1ce33746e armclang
mir3636
parents: 13
diff changeset
18
16
7eb81a3c4b29 kernel.elf
tobaru
parents: 14
diff changeset
19 LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
0
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 # link the libgcc.a for __aeabi_idiv. ARM has no native support for div
16
7eb81a3c4b29 kernel.elf
tobaru
parents: 14
diff changeset
22 LIBS =/net/open/RaspberryPi/rasbian-img/usr/lib/gcc/arm-linux-gnueabihf/6/libgcc.a
7eb81a3c4b29 kernel.elf
tobaru
parents: 14
diff changeset
23
0
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 OBJS = \
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 lib/string.o \
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 \
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 arm.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 asm.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 bio.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 buddy.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 console.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 exec.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 file.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 fs.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 log.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 main.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 memide.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 pipe.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 proc.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 spinlock.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 start.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 swtch.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 syscall.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 sysfile.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 sysproc.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 trap_asm.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 trap.o\
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 vm.o \
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 \
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 device/picirq.o \
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 device/timer.o \
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 device/uart.o
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54
13
f28daf1e47c1 clang-arm
mir3636
parents: 0
diff changeset
55 KERN_OBJS = $(OBJS) entry-clang.o
f28daf1e47c1 clang-arm
mir3636
parents: 0
diff changeset
56 kernel.elf: $(addprefix build/,$(KERN_OBJS)) kernel-clang.ld build/initcode build/fs.img
0
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 cp -f build/initcode initcode
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 cp -f build/fs.img fs.img
13
f28daf1e47c1 clang-arm
mir3636
parents: 0
diff changeset
59 $(call LINK_BIN, kernel-clang.ld, kernel.elf, \
0
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 $(addprefix build/,$(KERN_OBJS)), \
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 initcode fs.img)
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 $(OBJDUMP) -S kernel.elf > kernel.asm
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 $(OBJDUMP) -t kernel.elf | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > kernel.sym
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 rm -f initcode fs.img
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 qemu: kernel.elf
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 @clear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 @echo "Press Ctrl-A and then X to terminate QEMU session\n"
20
33c9000056b5 use cortex-a15
kono
parents: 18
diff changeset
69 export QEMU_AUDIO_DRV=none ; $(QEMU) -M versatilepb -m 128 -cpu ${QEMUCPU} -nographic -soundhw hda -kernel kernel.elf
17
c0f6f3eb25ae argccbc
kono
parents: 16
diff changeset
70
c0f6f3eb25ae argccbc
kono
parents: 16
diff changeset
71 qemu-debug : kernel.elf
c0f6f3eb25ae argccbc
kono
parents: 16
diff changeset
72 @clear
c0f6f3eb25ae argccbc
kono
parents: 16
diff changeset
73 @echo "Press Ctrl-A and then X to terminate QEMU session\n"
20
33c9000056b5 use cortex-a15
kono
parents: 18
diff changeset
74 export QEMU_AUDIO_DRV=none ; $(QEMU) -M versatilepb -m 128 -cpu ${QEMUCPU} -nographic -singlestep -d exec,cpu,guest_errors -D qemu.log -kernel kernel.elf -s -S
0
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 INITCODE_OBJ = initcode.o
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 $(addprefix build/,$(INITCODE_OBJ)): initcode.S
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 $(call build-directory)
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 $(call AS_WITH, -nostdinc -I.)
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 #initcode is linked into the kernel, it will be used to craft the first process
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 build/initcode: $(addprefix build/,$(INITCODE_OBJ))
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 $(call LINK_INIT, -N -e start -Ttext 0)
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 $(call OBJCOPY_INIT)
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 $(OBJDUMP) -S $< > initcode.asm
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 build/fs.img:
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 make -C tools
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 make -C usr
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 clean:
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 rm -rf build
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 rm -f *.o *.d *.asm *.sym vectors.S bootblock entryother \
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 initcode initcode.out kernel xv6.img fs.img kernel.elf memfs
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 make -C tools clean
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 make -C usr clean