7 NASM
=nasm
-f elf
-i
$(INCDIR
)/
8 CFLAGS
=-g
-Wall
-W
-O2
-nostdinc
-fno-builtin
-fno-stack-protector
-Wno-unused-parameter
-I
$(INCDIR
) -I..
/build
/main
9 CCASM
=$(CC
) -D__ASSEMBLY__
-g
-Os
-pipe
-mcpu
=arm926ej-s
-mabi
=apcs-gnu
-fno-strict-aliasing
-fno-common
-ffixed-r8
-msoft-float
-fno-builtin
-ffreestanding
-nostdinc
10 STDIO
=stdio
/doprintf.o stdio
/delay.o stdio
/kprintf.o stdio
/printf.o stdio
/sprintf.o stdio
/open.o stdio
/close.o stdio
/write.o stdio
/read.o
11 STDLIB
=stdlib
/atoi.o stdlib
/abort.o stdlib
/strtol.o
12 STRING
=string
/memsetw.o string
/memcpy.o string
/strlen.o string
/strcpy.o string
/strcat.o string
/memset.o string
/strcmp.o
13 ARCHDEP
=x86
/dma.o x86
/setjmp.o x86
/longjmp.o
15 UNISTD
=unistd
/fcntl.o unistd
/lseek.o unistd
/pipe.o
19 CFLAGS
=-g
-Os
-fno-builtin
-ffreestanding
-nostdinc
-pipe
-mcpu
=arm926ej-s
-mabi
=apcs-gnu
-nostdlib
-nostartfiles
-nodefaultlibs
-ffixed-r8
-msoft-float
-I
$(INCDIR
) -I..
/build
/main
20 ARCHDEP
=arm
/divsi3.o arm
/div0.o arm
/modsi3.o
23 OBJS
=$(STDIO
) $(STDLIB
) $(STRING
) $(ARCHDEP
) $(CTYPE
) $(UNISTD
) $(SYS
) $(ARCHDEP
)
33 $(Q
)rm -f libc.a
$(OBJS
)
38 @printf
" ASM $(subst $(shell pwd)/,,$(@))\n";
42 @printf
" ASM $(subst $(shell pwd)/,,$(@))\n";
43 $(Q
)$(CCASM
) -c
-o
$@
$<
46 @printf
" CC $(subst $(shell pwd)/,,$(@))\n";
47 $(Q
)$(CC
) $(CFLAGS
) -c
-o
$@
$<
50 libc.a
: $(OBJS
) $(MAKEDEP
)
51 @printf
" AR $(subst $(shell pwd)/,,$(@))\n";
52 $(Q
)$(AR
) rcs libc.a
$(OBJS
)