blob: 2641353bc902e7efc8ee710696af81423162cefe [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
Dave Chapman376c9f32011-02-27 11:37:39 +000021ifeq (yes,$(APPLICATION))
Thomas Martitz31b5c472010-07-06 15:11:56 +000022UIBMP=
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 Martitz54e00c12012-03-26 23:16:48 +020033$(BUILDDIR)/$(BINARY): $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) $(SIMLIB)
Frank Gevaerts0adc32d2012-06-20 01:14:40 +020034 $(call PRINTS,LD $(BINARY))$(CC) -o $@ -Wl,--start-group $^ -Wl,--end-group $(LDOPTS) $(GLOBAL_LDOPTS) \
Thomas Martitz6d192752012-01-17 15:08:08 +010035 -Wl,-Map,$(BUILDDIR)/rockbox.map
Thomas Martitz4b56ee02012-04-04 21:43:22 +020036 $(SILENT)$(call objcopy,$@,$@)
Björn Stenbergc6b3d382008-11-20 11:27:31 +000037
38$(BUILDDIR)/uisimulator/%.o: $(ROOTDIR)/uisimulator/%.c
39 $(SILENT)mkdir -p $(dir $@)
40 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SIMFLAGS) -c $< -o $@
41
Rafaël Carré279ce892010-05-18 12:46:09 +000042$(UIBMP): $(ROOTDIR)/uisimulator/bitmaps/UI-$(MODELNAME).bmp
Björn Stenbergc6b3d382008-11-20 11:27:31 +000043 $(call PRINTS,CP $(@F))cp $< $@