BUILD: Removing unused include/Makefile.
[tinyx.git] / Makefile
blob3b0a47143b411159e41a7e68a2849280bc916bd8
1 KFAMILY = 0
2 KVERSION = 0
3 KREVISION = 0
4 KNAME = And we have a coacervate...
6 HOSTCC = gcc
7 HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
9 CROSS_COMPILE ?= arm-linux-
11 ARCH = arm7
13 AS = $(CROSS_COMPILE)as
14 LD = $(CROSS_COMPILE)ld
15 CC = $(CROSS_COMPILE)gcc
16 AR = $(CROSS_COMPILE)ar
17 NM = $(CROSS_COMPILE)nm
18 STRIP = $(CROSS_COMPILE)strip
19 OBJCOPY = $(CROSS_COMPILE)objcopy
20 OBJDUMP = $(CROSS_COMPILE)objdump
21 AWK = awk
22 CFLAGS = -Wall -Os -mcpu=arm7tdmi
23 INCLUDES = -Iinclude -Iinclude/libc
25 PYTHON = python
27 MAKEFLAGS += --no-print-directory
29 all-sources = $(shell git-ls-files)
31 export ARCH AS LD CC AR NM STRIP OBJCOPY OBJDUMP AWK CFLAGS PYTHON INCLUDES
33 tinyx.dirs = lib/ arch/ kernel/
35 tinyx.objs = $(patsubst %/, %/tyx_part.o, $(tinyx.dirs))
37 $(shell rm -f $(tinyx.objs) include/asm)
38 $(shell ln -s asm-$(ARCH) include/asm)
40 _all:
42 all:
43 @$(MAKE) _dep
44 @$(MAKE) _all
46 _dep:
47 @touch build/tinyx.deps
49 _all: tinyx.hex
51 tinyx.hex: tinyx.elf
52 $(OBJCOPY) -O ihex build/$< build/$@
54 tinyx.elf: $(tinyx.objs)
55 $(LD) -EL -T arch/$(ARCH)/kernel/kernel.ld -o build/$@ $(tinyx.objs)
57 $(tinyx.objs):
58 @$(MAKE) target=$@ -f scripts/Makefile.build
60 define xtags
61 ctags -a $(all-sources)
62 endef
64 tags:
65 $(call xtags, ctags)
67 .PHONY: clean
68 clean:
69 @cleandirs="$(shell $(PYTHON) scripts/expandtree.py $(tinyx.dirs))"; \
70 cleanobjs=; \
71 for dir in $$cleandirs; do \
72 cleanobjs="$$cleanobjs $$dir*.o"; \
73 done; \
74 echo "rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps"; \
75 rm -f $$cleanobjs include/asm build/tinyx.hex build/tinyx.elf build/tinyx.deps;