blob: 6c01250bde884d20b00a15122ec79840af883bfa [file] [log] [blame]
Björn Stenbergc6b3d382008-11-20 11:27:31 +00001# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
Björn Stenberga091d202008-11-25 19:54:23 +00007# $Id$
Björn Stenbergc6b3d382008-11-20 11:27:31 +00008#
9
Thomas Martitz382d1862013-12-04 17:06:17 +010010INCLUDES += -I$(FIRMDIR) -I$(FIRMDIR)/export -I$(FIRMDIR)/drivers \
11 -I$(FIRMDIR)/include -I$(FIRMDIR)/kernel/include
Thomas Martitz57613ea2010-07-10 13:49:49 +000012ifndef APP_TYPE
Thomas Martitz3cca7e82010-05-14 12:37:05 +000013INCLUDES += -I$(FIRMDIR)/libc/include
14endif
Björn Stenbergc6b3d382008-11-20 11:27:31 +000015
Thomas Martitz8e8e9782012-01-07 19:49:02 +010016include $(FIRMDIR)/asm/asm.make
17
Björn Stenbergc6b3d382008-11-20 11:27:31 +000018FIRMLIB_SRC += $(call preprocess, $(FIRMDIR)/SOURCES)
Björn Stenbergc6b3d382008-11-20 11:27:31 +000019FIRMLIB_OBJ := $(call c2obj, $(FIRMLIB_SRC))
Jens Arnold87f88d22009-01-02 12:47:11 +000020ifeq (,$(findstring -DARCHOS_PLAYER,$(TARGET)))
21 FIRMLIB_OBJ += $(BUILDDIR)/sysfont.o
22endif
Björn Stenbergc6b3d382008-11-20 11:27:31 +000023OTHER_SRC += $(FIRMLIB_SRC)
24
25FIRMLIB = $(BUILDDIR)/firmware/libfirmware.a
26
27SYSFONT = $(ROOTDIR)/fonts/08-Schumacher-Clean.bdf
28
Rafaël Carré5d236b22010-05-27 09:41:46 +000029CLEANOBJS += $(BUILDDIR)/sysfont.* $(BUILDDIR)/version.*
Björn Stenbergc6b3d382008-11-20 11:27:31 +000030
31# Limits for the built-in sysfont: ASCII for bootloaders, ISO8859-1 for normal builds
32ifneq (,$(findstring -DBOOTLOADER,$(EXTRA_DEFINES)))
33 MAXCHAR = 127
34else
35 MAXCHAR = 255
36endif
37
38$(FIRMLIB): $(FIRMLIB_OBJ)
Björn Stenberg303b4552008-11-20 16:49:55 +000039 $(SILENT)$(shell rm -f $@)
Jens Arnold6421f942009-03-01 09:04:15 +000040 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
Björn Stenbergc6b3d382008-11-20 11:27:31 +000041
Thomas Martitz77ee2852014-01-26 15:02:11 +010042$(BUILDDIR)/sysfont.h: $(SYSFONT) $(TOOLS) $(BUILDDIR)/firmware/common/config.o
Björn Stenbergc6b3d382008-11-20 11:27:31 +000043 $(call PRINTS,CONVBDF $(subst $(ROOTDIR)/,,$<))$(TOOLSDIR)/convbdf -l $(MAXCHAR) -h -o $@ $<
44
45$(BUILDDIR)/sysfont.o: $(SYSFONT) $(BUILDDIR)/sysfont.h
46 $(call PRINTS,CONVBDF $(subst $(ROOTDIR)/,,$<))$(TOOLSDIR)/convbdf -l $(MAXCHAR) -c -o $(BUILDDIR)/sysfont.c $<
47 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$(BUILDDIR)/sysfont.c))$(CC) $(CFLAGS) -c $(BUILDDIR)/sysfont.c -o $@
48
Amaury Pouly50c1de72016-09-23 21:51:28 +010049# GNU make (at least) has a bug/feature that exported variable are not available
50# in the shell function (but are in recipe). Thus we need to explicitely pass
51# the VERSION environement variable
52SVNVERSION:=$(shell VERSION='$(VERSION)' $(TOOLSDIR)/version.sh $(ROOTDIR))
Michael Sevakis21e2b592014-08-27 20:47:46 -040053OLDSVNVERSION:=$(shell grep 'RBVERSION' $(BUILDDIR)/rbversion.h 2>/dev/null|cut -d '"' -f 2 || echo "NOREVISION")
Frank Gevaerts06865472010-06-20 23:54:21 +000054
Frank Gevaertsb0de98a2019-07-19 15:16:37 +020055CORE_LIBS:=$(FIRMLIB)
56
Frank Gevaerts06865472010-06-20 23:54:21 +000057ifneq ($(SVNVERSION),$(OLDSVNVERSION))
Michael Sevakis21e2b592014-08-27 20:47:46 -040058.PHONY: $(BUILDDIR)/rbversion.h
Frank Gevaerts06865472010-06-20 23:54:21 +000059endif
60
Michael Sevakis21e2b592014-08-27 20:47:46 -040061$(BUILDDIR)/rbversion.h:
Amaury Pouly50c1de72016-09-23 21:51:28 +010062 $(call PRINTS,GEN $(@F))$(TOOLSDIR)/genversion.sh $(BUILDDIR) $(SVNVERSION)