17
|
1 include ../makefile.inc
|
|
2
|
|
3 CC = /usr/local/arm-cbc/bin/arm-none-eabi-gcc -B/usr/local/arm-cbc/bin/arm-none-eabi-
|
|
4 AS = arm-linux-gnu-gcc
|
|
5 LD = arm-linux-gnu-ld
|
|
6 OBJCOPY = arm-linux-gnu-objcopy
|
|
7 OBJDUMP = arm-linux-gnu-objdump
|
|
8 CFLAGS = -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -I. -g -O0
|
|
9
|
|
10 ASFLAGS =
|
|
11
|
|
12 LIBGCC = $(shell $(CC) -print-libgcc-file-name)
|
|
13
|
|
14 LINK_BIN = $(call quiet-command,$(LD) $(LDFLAGS) \
|
|
15 -T $(1) -o $(2) $(3) $(LIBS) -b binary $(4), " LINK $(TARGET_DIR)$@")
|
|
16
|
|
17 LINK_INIT = $(call quiet-command,$(LD) $(LDFLAGS) \
|
|
18 $(1) -o $@.out $<, " LINK $(TARGET_DIR)$@")
|
|
19 OBJCOPY_INIT = $(call quiet-command,$(OBJCOPY) \
|
|
20 -S -O binary --prefix-symbols="_binary_$@" $@.out $@, " OBJCOPY $(TARGET_DIR)$@")
|
|
21 AS_WITH = $(call quiet-command,$(AS) $(ASFLAGS) \
|
|
22 $(1) -c -o $@ $<," AS $(TARGET_DIR)$@")
|
|
23
|
|
24 CFLAGS += -iquote ../
|
|
25 ASFLAGS += -I ../
|
|
26 ULIB = ulib.o usys.o printf.o umalloc.o
|
|
27
|
|
28 MKFS = ../tools/mkfs
|
|
29 FS_IMAGE = ../build/fs.img
|
|
30
|
|
31 UPROGS=\
|
|
32 _cat\
|
|
33 _echo\
|
|
34 _grep\
|
|
35 _init\
|
|
36 _kill\
|
|
37 _ln\
|
|
38 _ls\
|
|
39 _mkdir\
|
|
40 _rm\
|
|
41 _sh\
|
|
42 _stressfs\
|
|
43 _usertests\
|
|
44 _wc\
|
|
45 _zombie\
|
|
46 _hello\
|
|
47 _forktest\
|
|
48
|
|
49
|
|
50 all: $(FS_IMAGE)
|
|
51
|
|
52 _%: %.o $(ULIB)
|
|
53 $(LD) $(LDFLAGS) -N -e main -Ttext 0 -o $@ $^ -L ../ $(LIBGCC)
|
|
54 $(OBJDUMP) -S $@ > $*.asm
|
|
55 $(OBJDUMP) -t $@ | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > $*.sym
|
|
56
|
|
57 _forktest: forktest.o $(ULIB)
|
|
58 # forktest has less library code linked in - needs to be small
|
|
59 # in order to be able to max out the proc table.
|
|
60 $(LD) $(LDFLAGS) -N -e main -Ttext 0 -o _forktest forktest.o ulib.o usys.o
|
|
61 $(OBJDUMP) -S _forktest > forktest.asm
|
|
62
|
|
63 $(FS_IMAGE): $(MKFS) $(UPROGS)
|
|
64 $(MKFS) $@ $(UPROGS) UNIX
|
|
65 $(OBJDUMP) -S usys.o > usys.asm
|
|
66
|
|
67 clean:
|
|
68 rm -f *.o *.d *.asm *.sym $(FS_IMAGE) \
|
|
69 .gdbinit \
|
|
70 $(UPROGS)
|