2002-08-02 12:17:10 +00:00
|
|
|
############################################################################
|
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
# Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.se>
|
|
|
|
#
|
|
|
|
# All files in this archive are subject to the GNU General Public License.
|
|
|
|
# See the file COPYING in the source tree root for full license agreement.
|
|
|
|
#
|
|
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
# KIND, either express or implied.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
APPDIR = ../../apps
|
|
|
|
RECDIR = $(APPDIR)/recorder
|
2002-09-03 10:13:46 +00:00
|
|
|
PLAYDIR = $(APPDIR)/player
|
2003-06-29 21:57:31 +00:00
|
|
|
PLUGINDIR = $(APPDIR)/plugins
|
2003-12-15 10:33:53 +00:00
|
|
|
SIMCOMMON = ../common
|
2002-09-03 10:13:46 +00:00
|
|
|
|
2004-09-19 21:58:37 +00:00
|
|
|
ISONDIO := $(findstring ONDIO, $(TARGET))
|
2004-09-17 08:45:39 +00:00
|
|
|
ISPLAYER := $(findstring PLAYER, $(TARGET))
|
|
|
|
ifeq ($(ISPLAYER), PLAYER)
|
2002-09-03 10:13:46 +00:00
|
|
|
MACHINEDIR = $(PLAYDIR)
|
2004-09-17 08:45:39 +00:00
|
|
|
else
|
|
|
|
MACHINEDIR = $(RECDIR)
|
2002-09-03 10:13:46 +00:00
|
|
|
endif
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
PREVAPPDIR= ..
|
|
|
|
FIRMWAREDIR = ../../firmware
|
2003-02-07 10:21:50 +00:00
|
|
|
|
|
|
|
# build some sources from these dirs
|
2002-08-02 12:17:10 +00:00
|
|
|
DRIVERS = $(FIRMWAREDIR)/drivers
|
|
|
|
COMMON = $(FIRMWAREDIR)/common
|
2003-02-07 10:21:50 +00:00
|
|
|
|
|
|
|
# include here:
|
|
|
|
EXPORT = $(FIRMWAREDIR)/export
|
2002-09-18 15:06:45 +00:00
|
|
|
TOOLSDIR = ../../tools
|
2002-10-15 08:09:47 +00:00
|
|
|
DOCSDIR = ../../docs
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
RM = rm -f
|
|
|
|
DEBUG = -g
|
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
ifndef OBJDIR
|
|
|
|
no_configure:
|
|
|
|
@echo "Don't run make here. Run the tools/configure script from your own build"
|
|
|
|
@echo "directory, then run make there."
|
|
|
|
@echo
|
|
|
|
@echo "More help on how to build rockbox can be found here:"
|
|
|
|
@echo "http://rockbox.haxx.se/docs/how_to_compile.html"
|
|
|
|
endif
|
|
|
|
|
2002-09-18 14:08:05 +00:00
|
|
|
LANGUAGE = english
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2003-03-17 21:47:43 +00:00
|
|
|
DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
|
2004-09-17 08:45:39 +00:00
|
|
|
$(TARGET) -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES)
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2003-02-19 14:20:16 +00:00
|
|
|
LDFLAGS = -lgdi32 -luser32
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
# Use this for simulator-only files
|
2004-07-21 13:13:59 +00:00
|
|
|
INCLUDES = -I. -I$(EXPORT) -I$(APPDIR) -I$(MACHINEDIR) -I$(SIMCOMMON) -I$(OBJDIR) -I$(PLUGINDIR)/lib
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
# The true Rockbox Applications should use this include path:
|
2003-02-15 00:02:12 +00:00
|
|
|
APPINCLUDES = $(INCLUDES)
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
DEFINES += -DWIN32
|
|
|
|
|
2003-02-19 14:20:16 +00:00
|
|
|
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2003-02-19 14:20:16 +00:00
|
|
|
APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall -mno-cygwin
|
2003-07-09 06:31:55 +00:00
|
|
|
DLLTOOLFLAGS = --export-all
|
|
|
|
DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
|
2003-02-19 14:20:16 +00:00
|
|
|
|
2003-03-05 22:49:29 +00:00
|
|
|
UNAME := $(shell uname|sed -e "s/CYGWIN.*/CYGWIN/")
|
2004-09-17 08:45:39 +00:00
|
|
|
EXEFILE := $(OBJDIR)/rockboxui.exe
|
|
|
|
|
2003-03-05 22:49:29 +00:00
|
|
|
ifeq ($(UNAME),CYGWIN)
|
2003-02-19 14:20:16 +00:00
|
|
|
CC = gcc
|
|
|
|
WINDRES = windres
|
2003-07-09 06:31:55 +00:00
|
|
|
DLLTOOL = dlltool
|
|
|
|
DLLWRAP = dllwrap
|
2004-09-17 08:45:39 +00:00
|
|
|
RANLIB = ranlib
|
2003-02-19 14:20:16 +00:00
|
|
|
DEFINES += -DNOCYGWIN
|
|
|
|
LDFLAGS += -mno-cygwin
|
|
|
|
else
|
|
|
|
CC = i386-mingw32msvc-gcc
|
|
|
|
WINDRES = i386-mingw32msvc-windres
|
2003-07-09 06:31:55 +00:00
|
|
|
DLLTOOL = i386-mingw32msvc-dlltool
|
|
|
|
DLLWRAP = i386-mingw32msvc-dllwrap
|
2004-09-17 08:45:39 +00:00
|
|
|
RANLIB = i386-mingw32msvc-ranlib
|
2003-02-19 14:20:16 +00:00
|
|
|
CFLAGS += -mwindows
|
|
|
|
LDFLAGS += -mwindows
|
|
|
|
APPCFLAGS += -mwindows
|
|
|
|
endif
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-09-17 08:45:39 +00:00
|
|
|
ifeq ($(ISPLAYER),PLAYER)
|
2003-02-19 14:20:16 +00:00
|
|
|
LCDSRSC = lcd-playersim.c lcd-player.c lcd-player-charset.c font-player.c
|
2004-09-17 08:45:39 +00:00
|
|
|
else
|
|
|
|
LCDSRSC = lcd-recorder.c sysfont.c font.c
|
2002-10-18 13:46:58 +00:00
|
|
|
endif
|
2004-07-20 10:52:00 +00:00
|
|
|
COMMONSRCS = io.c stubs.c lcd-common.c sim_icons.c fmradio.c
|
2004-06-10 13:29:52 +00:00
|
|
|
|
2004-01-05 23:42:56 +00:00
|
|
|
FIRMSRCS = $(LCDSRSC) id3.c mp3data.c usb.c mpeg.c mp3_playback.c \
|
2004-07-20 10:52:00 +00:00
|
|
|
powermgmt.c power.c sprintf.c buffer.c strtok.c random.c \
|
2004-04-20 10:23:57 +00:00
|
|
|
timefuncs.c
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-09-24 12:43:52 +00:00
|
|
|
APPS = main.c tree.c menu.c credits.c main_menu.c icons.c language.c \
|
2002-10-12 13:31:22 +00:00
|
|
|
playlist.c wps.c wps-display.c settings.c status.c \
|
2004-07-20 10:52:00 +00:00
|
|
|
screens.c sleeptimer.c keyboard.c onplay.c\
|
|
|
|
misc.c plugin.c playlist_viewer.c bookmark.c filetypes.c \
|
|
|
|
settings_menu.c sound_menu.c playlist_menu.c
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-09-17 08:45:39 +00:00
|
|
|
ifneq ($(ISPLAYER),PLAYER)
|
2004-07-20 10:52:00 +00:00
|
|
|
APPS += peakmeter.c bmp.c widgets.c radio.c
|
2002-08-02 12:17:10 +00:00
|
|
|
endif
|
|
|
|
|
2004-06-10 13:29:52 +00:00
|
|
|
SRCS = button.c lcd-win32.c panic-win32.c thread-win32.c \
|
2004-07-20 10:52:00 +00:00
|
|
|
debug-win32.c kernel.c string-win32.c uisw32.c \
|
|
|
|
$(APPS) $(FIRMSRCS) $(COMMONSRCS)
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-09-18 14:08:05 +00:00
|
|
|
OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) $(OBJDIR)/uisw32-res.o
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-09-19 21:58:37 +00:00
|
|
|
ifneq ($(ISONDIO),ONDIO)
|
2004-07-20 10:52:00 +00:00
|
|
|
ROCKS := $(patsubst $(PLUGINDIR)/%.c,$(OBJDIR)/%.rock,$(wildcard $(PLUGINDIR)/*.c))
|
|
|
|
PLUGINLIBOBJS := $(patsubst $(PLUGINDIR)/lib/%.c,$(OBJDIR)/%.o,$(wildcard $(PLUGINDIR)/lib/*.c))
|
2004-09-19 21:58:37 +00:00
|
|
|
endif
|
2003-06-29 21:57:31 +00:00
|
|
|
|
2004-09-17 08:45:39 +00:00
|
|
|
all: $(TOOLSDIR)/convbdf $(EXEFILE) $(ROCKS)
|
2003-07-10 11:52:42 +00:00
|
|
|
|
2004-07-21 13:13:59 +00:00
|
|
|
$(ROCKS): $(OBJDIR)/libplugin.a
|
|
|
|
|
2003-07-10 11:52:42 +00:00
|
|
|
$(TOOLSDIR)/convbdf:
|
|
|
|
$(MAKE) -C $(TOOLSDIR)
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-09-17 08:45:39 +00:00
|
|
|
$(EXEFILE): $(OBJDIR)/lang.o $(OBJS)
|
|
|
|
@echo LD $@
|
|
|
|
@$(CC) $(OBJS) -o $(EXEFILE) $(LDFLAGS)
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
clean:
|
2004-09-17 08:45:39 +00:00
|
|
|
$(RM) $(OBJS) *~ core $(EXEFILE) $(CLIENTS) $(OBJDIR)/uisw32-res.o \
|
2002-09-25 14:15:07 +00:00
|
|
|
$(OBJDIR)/lang.[cho] $(OBJDIR)/build.lang $(OBJDIR)/*.o \
|
2003-07-09 06:31:55 +00:00
|
|
|
$(OBJDIR)/*.rock $(OBJDIR)/*.def $(OBJDIR)/sysfont.c \
|
2004-07-28 07:38:34 +00:00
|
|
|
$(OBJDIR)/credits.raw $(OBJDIR)/libplugin.a
|
2002-08-02 12:17:10 +00:00
|
|
|
$(RM) -r $(DEPS)
|
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
################## Specific dependencies ##################
|
2002-10-15 07:51:25 +00:00
|
|
|
$(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS
|
|
|
|
perl $(APPDIR)/credits.pl < $< > $@
|
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/uisw32-res.o: uisw32.rc
|
|
|
|
$(WINDRES) -i $< -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/credits.o: $(APPDIR)/credits.c $(APPDIR)/credits.h $(OBJDIR)/credits.raw
|
2004-01-14 00:13:04 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/button.o: button.c
|
2003-06-29 23:38:03 +00:00
|
|
|
$(OBJDIR)/plugin.o: $(APPDIR)/plugin.c plugin-win32.h
|
2002-09-25 14:15:07 +00:00
|
|
|
$(OBJDIR)/build.lang: $(APPDIR)/lang/$(LANGUAGE).lang
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo UPLANG
|
|
|
|
@perl $(TOOLSDIR)/uplang $(APPDIR)/lang/english.lang $< > $@
|
2002-09-25 14:15:07 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/lang.o: $(OBJDIR)/build.lang
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo GENLANG
|
|
|
|
@perl -s $(TOOLSDIR)/genlang -p=$(OBJDIR)/lang $<
|
|
|
|
@$(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@
|
2002-09-17 21:54:47 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/sysfont.o: $(FIRMWAREDIR)/fonts/clR6x8.bdf
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $(OBJDIR)/sysfont.c -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
################## Plugins ##################
|
|
|
|
$(OBJDIR)/libplugin.a: $(PLUGINLIBOBJS)
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo AR $@
|
|
|
|
@$(AR) ru $@ $+
|
|
|
|
@$(RANLIB) $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/%.o: $(PLUGINDIR)/lib/%.c
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(CFLAGS) -DPLUGIN -c $< -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/%.po : $(PLUGINDIR)/%.c
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -DPLUGIN -c $< -o $@
|
2003-02-19 14:20:16 +00:00
|
|
|
|
2004-09-17 08:45:39 +00:00
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.po $(OBJDIR)/libplugin.a
|
|
|
|
@echo DLL $@
|
|
|
|
@$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
|
|
|
|
@$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/libplugin.a -o $@
|
|
|
|
@chmod -x $@
|
2002-08-07 11:45:42 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
################## Patterns for building objects ##################
|
|
|
|
$(OBJDIR)/%.o: %.c
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(CFLAGS) -c $< -o $@
|
2003-02-19 14:20:16 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/%.o: $(SIMCOMMON)/%.c
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/%.o: $(MACHINEDIR)/%.c
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/%.o: $(DRIVERS)/%.c
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-09-24 17:22:12 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/%.o: $(FIRMWAREDIR)/%.c
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-09-27 09:31:31 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/%.o: $(COMMON)/%.c
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2004-07-02 07:43:49 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
$(OBJDIR)/%.o: $(APPDIR)/%.c
|
2004-09-17 08:45:39 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2003-06-29 21:57:31 +00:00
|
|
|
|
2004-07-20 10:52:00 +00:00
|
|
|
################## Auto-dependencies ##################
|
2002-08-02 12:17:10 +00:00
|
|
|
DEPS:=$(OBJDIR)/.deps
|
|
|
|
|
|
|
|
$(DEPS)/%.d: %.c
|
|
|
|
@$(SHELL) -c 'if [ ! -d $(DEPS) ]; then \
|
|
|
|
echo Creating the dependency directory: $(DEPS); \
|
|
|
|
mkdir -p $(DEPS); fi'
|
|
|
|
@echo "Updating Dependencies for $<"
|
|
|
|
@$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
|
|
|
|
|sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \
|
|
|
|
[ -s $@ ] || rm -f $@'
|
|
|
|
|
|
|
|
-include $(SRCS:%.c=$(DEPS)/%.d)
|