4 KNAME
= And we have a coacervate...
7 HOSTCFLAGS
= -Wall
-Wstrict-prototypes
-O2
-fomit-frame-pointer
9 CROSS_COMPILE ?
= arm-linux-
14 AS
= $(CROSS_COMPILE
)as
15 LD
= $(CROSS_COMPILE
)ld
16 CC
= $(CROSS_COMPILE
)gcc
17 AR
= $(CROSS_COMPILE
)ar
18 NM
= $(CROSS_COMPILE
)nm
19 STRIP
= $(CROSS_COMPILE
)strip
20 OBJCOPY
= $(CROSS_COMPILE
)objcopy
21 OBJDUMP
= $(CROSS_COMPILE
)objdump
23 CFLAGS
= -Wall
-Os
-mcpu
=arm7tdmi
-nostdlib
24 INCLUDES
= -Iinclude
-Iinclude
/libc
28 MAKEFLAGS
+= --no-print-directory
30 all-sources
= $(shell git-ls-files
)
32 export ARCH CPU AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES
34 tinyx.dirs
= lib
/ arch
/ kernel
/
36 tinyx.objs
= $(patsubst %/, %/tyx_part.o
, $(tinyx.dirs
))
38 $(shell rm -f
$(tinyx.objs
) include/asm
/arch
include/asm
)
39 $(shell ln
-s asm-
$(ARCH
) include/asm
)
40 $(shell ln
-s arch-
$(CPU
) include/asm
/arch
)
49 @touch build
/tinyx.deps
54 $(OBJCOPY
) -O ihex build
/$< build
/$@
56 tinyx.elf
: $(tinyx.objs
)
57 #$(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs)
58 $(CC
) -Xlinker
--script
=arch
/$(ARCH
)/kernel
/kernel.
ld -o build
/$@
$(tinyx.objs
)
61 @
$(MAKE
) target
=$@
-f scripts
/Makefile.build
64 ctags
-a
$(all-sources
)
71 @cleandirs
="$(shell $(PYTHON) scripts/expandtree.py $(tinyx.dirs))"; \
73 for
dir in
$$cleandirs; do \
74 cleanobjs
="$$cleanobjs $$dir*.o"; \
76 echo
"rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps"; \
77 rm -f
include/asm
/arch
78 rm -f
$$cleanobjs include/asm build
/tinyx.hex build
/tinyx.elf build
/tinyx.deps
;