Revert tab police as it makes merging upstream changes more annoying and messed up...
[kugel-rb.git] / firmware / firmware.make
blobaab735aa918497a564fce2f067c57ccabc547d7d
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 INCLUDES += -I$(FIRMDIR) -I$(FIRMDIR)/export -I$(FIRMDIR)/drivers -I$(FIRMDIR)/include
11 ifndef APP_TYPE
12 INCLUDES += -I$(FIRMDIR)/libc/include
13 endif
15 FIRMLIB_SRC += $(call preprocess, $(FIRMDIR)/SOURCES)
16 FIRMLIB_OBJ := $(call c2obj, $(FIRMLIB_SRC))
17 ifeq (,$(findstring -DARCHOS_PLAYER,$(TARGET)))
18 FIRMLIB_OBJ += $(BUILDDIR)/sysfont.o
19 endif
20 OTHER_SRC += $(FIRMLIB_SRC)
22 FIRMLIB = $(BUILDDIR)/firmware/libfirmware.a
24 SYSFONT = $(ROOTDIR)/fonts/08-Schumacher-Clean.bdf
26 CLEANOBJS += $(BUILDDIR)/sysfont.* $(BUILDDIR)/version.*
28 # Limits for the built-in sysfont: ASCII for bootloaders, ISO8859-1 for normal builds
29 ifneq (,$(findstring -DBOOTLOADER,$(EXTRA_DEFINES)))
30 MAXCHAR = 127
31 else
32 MAXCHAR = 255
33 endif
35 $(FIRMLIB): $(FIRMLIB_OBJ)
36 $(SILENT)$(shell rm -f $@)
37 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
39 $(BUILDDIR)/sysfont.h: $(SYSFONT) $(TOOLS)
40 $(call PRINTS,CONVBDF $(subst $(ROOTDIR)/,,$<))$(TOOLSDIR)/convbdf -l $(MAXCHAR) -h -o $@ $<
42 $(BUILDDIR)/sysfont.o: $(SYSFONT) $(BUILDDIR)/sysfont.h
43 $(call PRINTS,CONVBDF $(subst $(ROOTDIR)/,,$<))$(TOOLSDIR)/convbdf -l $(MAXCHAR) -c -o $(BUILDDIR)/sysfont.c $<
44 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$(BUILDDIR)/sysfont.c))$(CC) $(CFLAGS) -c $(BUILDDIR)/sysfont.c -o $@
46 SVNVERSION:=$(shell $(TOOLSDIR)/version.sh $(ROOTDIR))
47 OLDSVNVERSION:=$(shell grep 'RBVERSION' $(BUILDDIR)/version.h 2>/dev/null|cut -d '"' -f 2 || echo "NOREVISION")
49 ifneq ($(SVNVERSION),$(OLDSVNVERSION))
50 .PHONY: $(BUILDDIR)/version.h
51 endif
53 $(BUILDDIR)/version.h:
54 $(call PRINTS,GEN $(@F))$(TOOLSDIR)/genversion.sh $(BUILDDIR) $(TOOLSDIR)/version.sh $(ROOTDIR)