blob: b06b48c0d2c9a711fb4932506557dca94bda80ab [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 Martitz59d26032010-06-06 09:11:52 +000010INCLUDES += -I$(ROOTDIR)/uisimulator/bitmaps -I$(ROOTDIR)/uisimulator/common -I$(ROOTDIR)/uisimulator/buttonmap $\
Thomas Martitz3d0cee82010-05-15 21:02:47 +000011 -I$(FIRMDIR)/include -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR)
Björn Stenbergc6b3d382008-11-20 11:27:31 +000012
Thomas Martitz3d0cee82010-05-15 21:02:47 +000013SIMFLAGS += $(INCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS)
Björn Stenbergc6b3d382008-11-20 11:27:31 +000014
Björn Stenbergc6b3d382008-11-20 11:27:31 +000015SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/common/SOURCES)
Thomas Martitz59d26032010-06-06 09:11:52 +000016SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/buttonmap/SOURCES)
Björn Stenbergc6b3d382008-11-20 11:27:31 +000017SIMOBJ = $(call c2obj,$(SIMSRC))
18OTHER_SRC += $(SIMSRC)
19
20SIMLIB = $(BUILDDIR)/uisimulator/libuisimulator.a
Thomas Martitz31b5c472010-07-06 15:11:56 +000021ifeq ($(MODELNAME), application)
22UIBMP=
23else
24UIBMP=$(BUILDDIR)/UI256.bmp
25endif
Björn Stenbergc6b3d382008-11-20 11:27:31 +000026
27.SECONDEXPANSION: # $$(OBJ) is not populated until after this
28
29$(SIMLIB): $$(SIMOBJ) $(UIBMP)
Björn Stenberg7bdf9a32008-11-20 16:51:13 +000030 $(SILENT)$(shell rm -f $@)
Jens Arnold6421f942009-03-01 09:04:15 +000031 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
Björn Stenbergc6b3d382008-11-20 11:27:31 +000032
Thomas Martitz23e505b2009-04-29 22:58:56 +000033# SIMLIB needs to be linked twice for some reason
Jonathan Gordon8d3dbb82010-06-17 12:59:43 +000034$(BUILDDIR)/$(BINARY): $$(OBJ) $(SIMLIB) $(VOICESPEEXLIB) $(FIRMLIB) $(SKINLIB)
Frank Gevaertsb8286d42010-07-03 20:58:22 +000035 $(call PRINTS,LD $(BINARY))$(CC) -o $@ $^ $(SIMLIB) $(LDOPTS) $(GLOBAL_LDOPTS)
Björn Stenbergc6b3d382008-11-20 11:27:31 +000036
37$(BUILDDIR)/uisimulator/%.o: $(ROOTDIR)/uisimulator/%.c
38 $(SILENT)mkdir -p $(dir $@)
39 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SIMFLAGS) -c $< -o $@
40
Rafaël Carré279ce892010-05-18 12:46:09 +000041$(UIBMP): $(ROOTDIR)/uisimulator/bitmaps/UI-$(MODELNAME).bmp
Björn Stenbergc6b3d382008-11-20 11:27:31 +000042 $(call PRINTS,CP $(@F))cp $< $@