2002-03-25 14:42:44 +00:00
|
|
|
############################################################################
|
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
2002-03-25 14:43:36 +00:00
|
|
|
# $Id$
|
2002-03-25 14:42:44 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
############################################################################
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
RECDIR = $(APPSDIR)/recorder
|
|
|
|
PLAYDIR = $(APPSDIR)/player
|
|
|
|
PLUGINDIR = $(APPSDIR)/plugins
|
2004-07-23 21:06:03 +00:00
|
|
|
SIMCOMMON = ../common
|
2002-09-03 08:30:15 +00:00
|
|
|
|
2004-09-19 21:58:37 +00:00
|
|
|
ISONDIO := $(findstring ONDIO, $(TARGET))
|
2005-01-17 21:18:21 +00:00
|
|
|
ISIRIVER := $(findstring IRIVER, $(TARGET))
|
2004-09-16 14:36:08 +00:00
|
|
|
ISPLAYER := $(findstring PLAYER, $(TARGET))
|
|
|
|
ifeq ($(ISPLAYER), PLAYER)
|
2004-07-23 21:06:03 +00:00
|
|
|
MACHINEDIR = $(PLAYDIR)
|
2004-09-16 14:36:08 +00:00
|
|
|
else
|
|
|
|
MACHINEDIR = $(RECDIR)
|
2002-09-03 08:30:15 +00:00
|
|
|
endif
|
2002-05-17 12:23:11 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
PREVAPPSDIR= ..
|
2004-07-23 21:06:03 +00:00
|
|
|
|
|
|
|
# build some sources from these dirs
|
2004-09-22 08:58:50 +00:00
|
|
|
DRIVERS = $(FIRMDIR)/drivers
|
|
|
|
COMMON = $(FIRMDIR)/common
|
2004-07-23 21:06:03 +00:00
|
|
|
|
|
|
|
# include here:
|
2004-09-22 08:58:50 +00:00
|
|
|
EXPORT = $(FIRMDIR)/export
|
2002-04-11 12:41:27 +00:00
|
|
|
|
2002-04-25 08:06:38 +00:00
|
|
|
RM = rm -f
|
|
|
|
DEBUG = -g
|
2002-05-04 12:26:21 +00:00
|
|
|
|
2004-07-23 21:06:03 +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-05-31 07:23:07 +00:00
|
|
|
|
2004-09-16 14:36:08 +00:00
|
|
|
DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
|
2005-02-11 23:56:38 +00:00
|
|
|
$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
|
2002-05-04 12:26:21 +00:00
|
|
|
|
2002-06-17 13:33:47 +00:00
|
|
|
# Use this for simulator-only files
|
2004-09-22 08:58:50 +00:00
|
|
|
INCLUDES = -I. -I$(EXPORT) -I$(APPSDIR) -I$(MACHINEDIR) -I$(SIMCOMMON) -I$(OBJDIR) -I$(PLUGINDIR)/lib
|
2004-07-23 21:06:03 +00:00
|
|
|
|
|
|
|
# The true Rockbox Applications should use this include path:
|
|
|
|
APPINCLUDES = $(INCLUDES)
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
SRCDIRS = . $(DRIVERS) $(FIRMDIR)/export $(APPSDIR) $(MACHINEDIR)
|
2002-04-25 08:06:38 +00:00
|
|
|
|
2002-06-17 13:33:47 +00:00
|
|
|
# The true Rockbox Applications should use this include path:
|
2003-02-07 09:42:57 +00:00
|
|
|
APPINCLUDES = $(INCLUDES)
|
2002-06-17 13:33:47 +00:00
|
|
|
|
2002-06-10 10:17:54 +00:00
|
|
|
LIBS = -lpthread
|
2002-05-12 11:34:08 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall
|
|
|
|
|
|
|
|
APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall
|
|
|
|
|
2003-03-05 22:45:14 +00:00
|
|
|
UNAME := $(shell uname|sed -e "s/CYGWIN.*/CYGWIN/")
|
2004-09-16 14:36:08 +00:00
|
|
|
EXEFILE = $(OBJDIR)/rockboxui
|
2002-04-24 09:14:16 +00:00
|
|
|
ifeq ($(UNAME),Linux)
|
2003-06-29 17:06:16 +00:00
|
|
|
LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl -ldl
|
2002-04-30 07:02:37 +00:00
|
|
|
INCLUDES += -I/usr/X11R6/include
|
2002-04-19 14:12:31 +00:00
|
|
|
LIBDIRS = -L/usr/X11R6/lib
|
2003-07-04 08:30:01 +00:00
|
|
|
DEFINES += -DHAVE_OSS
|
2002-04-19 14:12:31 +00:00
|
|
|
else
|
2003-03-05 22:45:14 +00:00
|
|
|
ifeq ($(UNAME),CYGWIN)
|
2003-06-30 03:43:07 +00:00
|
|
|
LDFLAGS = -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11
|
2003-03-05 22:45:14 +00:00
|
|
|
INCLUDES += -I/usr/X11R6/include
|
|
|
|
LIBDIRS = -L/usr/X11R6/lib
|
2004-01-10 19:29:00 +00:00
|
|
|
DEFINES += -DHAVE_OSS -D_SSIZE_T_
|
2004-09-16 14:36:08 +00:00
|
|
|
EXEFILE = $(OBJDIR)/rockboxui.exe
|
2003-07-04 08:30:01 +00:00
|
|
|
else
|
|
|
|
ifeq ($(UNAME),FreeBSD)
|
|
|
|
LIBS = -pthread
|
|
|
|
LDFLAGS = -lX11 -lm -lXt -lXmu
|
|
|
|
INCLUDES += -I/usr/X11R6/include
|
|
|
|
LIBDIRS = -L/usr/X11R6/lib
|
|
|
|
DEFINES += -DHAVE_OSS
|
2003-03-05 22:45:14 +00:00
|
|
|
else
|
2003-06-29 17:06:16 +00:00
|
|
|
LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl -ldl
|
2002-05-16 13:02:57 +00:00
|
|
|
DEFINES += -DBIG_ENDIAN
|
2002-04-19 14:12:31 +00:00
|
|
|
LIBDIRS =
|
|
|
|
endif
|
2003-03-05 22:45:14 +00:00
|
|
|
endif
|
2003-07-04 08:30:01 +00:00
|
|
|
endif
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2004-07-08 10:12:39 +00:00
|
|
|
ifeq ($(HAVE_MPEG_PLAY),1)
|
2004-07-08 10:39:45 +00:00
|
|
|
SOUNDSRC = mpegplay.c oss_sound.c
|
|
|
|
LDFLAGS += $(SOUND_LDFLAGS)
|
|
|
|
CFLAGS += $(SOUND_CFLAGS) -DHAVE_MPEG_PLAY
|
2004-07-08 10:12:39 +00:00
|
|
|
else
|
2004-07-08 10:39:45 +00:00
|
|
|
SOUNDSRC =
|
2004-07-08 10:12:39 +00:00
|
|
|
endif
|
|
|
|
|
2004-09-16 14:36:08 +00:00
|
|
|
ifeq ($(ISPLAYER), PLAYER)
|
2004-07-23 21:06:03 +00:00
|
|
|
LCDSRSC = lcd-playersim.c lcd-player.c lcd-player-charset.c font-player.c
|
2005-01-17 21:18:21 +00:00
|
|
|
else
|
|
|
|
ifeq ($(ISIRIVER),IRIVER)
|
|
|
|
LCDSRSC = lcd-h100.c sysfont.c font.c
|
2004-09-16 14:36:08 +00:00
|
|
|
else
|
|
|
|
LCDSRSC = lcd-recorder.c sysfont.c font.c
|
2004-07-23 21:06:03 +00:00
|
|
|
endif
|
2005-01-17 21:18:21 +00:00
|
|
|
endif
|
2004-07-23 21:06:03 +00:00
|
|
|
COMMONSRCS = io.c stubs.c lcd-common.c sim_icons.c fmradio.c
|
2002-05-02 14:12:08 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
FIRMSRCS = $(LCDSRSC) id3.c mp3data.c usb.c mpeg.c mp3_playback.c \
|
|
|
|
powermgmt.c power.c sprintf.c buffer.c strtok.c random.c \
|
2005-01-28 15:48:38 +00:00
|
|
|
timefuncs.c panic.c debug.c strcasestr.c
|
2002-06-24 21:41:01 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
APPS = main.c tree.c menu.c credits.c main_menu.c icons.c language.c \
|
|
|
|
playlist.c wps.c wps-display.c settings.c status.c \
|
|
|
|
screens.c sleeptimer.c keyboard.c onplay.c\
|
|
|
|
misc.c plugin.c playlist_viewer.c bookmark.c filetypes.c \
|
2005-01-17 11:49:40 +00:00
|
|
|
settings_menu.c sound_menu.c playlist_menu.c filetree.c dbtree.c
|
2002-05-16 13:02:57 +00:00
|
|
|
|
2004-09-16 14:36:08 +00:00
|
|
|
ifneq ($(ISPLAYER), PLAYER)
|
2004-07-23 21:06:03 +00:00
|
|
|
APPS += peakmeter.c bmp.c widgets.c radio.c
|
2002-05-21 14:35:18 +00:00
|
|
|
endif
|
2002-05-02 21:30:58 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c \
|
|
|
|
button-x11.c thread.c $(APPS) $(MENUS) $(FIRMSRCS) \
|
|
|
|
$(COMMONSRCS) $(SOUNDSRC)
|
2003-06-29 16:43:15 +00:00
|
|
|
|
2002-09-18 14:08:05 +00:00
|
|
|
OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o)
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2004-11-24 16:45:08 +00:00
|
|
|
ifdef ENABLEDPLUGINS
|
|
|
|
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
|
2004-07-23 21:06:03 +00:00
|
|
|
|
2004-09-16 14:36:08 +00:00
|
|
|
all: $(TOOLSDIR)/convbdf $(EXEFILE) $(ROCKS)
|
2004-07-23 21:06:03 +00:00
|
|
|
|
|
|
|
$(ROCKS): $(OBJDIR)/libplugin.a
|
2003-07-10 11:52:42 +00:00
|
|
|
|
|
|
|
$(TOOLSDIR)/convbdf:
|
|
|
|
$(MAKE) -C $(TOOLSDIR)
|
2002-03-25 14:21:30 +00:00
|
|
|
|
|
|
|
clean:
|
2004-09-16 14:36:08 +00:00
|
|
|
$(RM) $(OBJS) *~ core $(EXEFILE) $(CLIENTS) $(OBJDIR)/lang.[cho] \
|
2004-07-23 21:06:03 +00:00
|
|
|
$(OBJDIR)/build.lang $(OBJDIR)/*.o $(OBJDIR)/sysfont.c \
|
|
|
|
$(ROCKS) $(OBJDIR)/credits.raw
|
2002-04-25 08:06:38 +00:00
|
|
|
$(RM) -r $(DEPS)
|
2004-06-20 22:03:15 +00:00
|
|
|
$(RM) -f $(OBJDIR)/libplugin.a $(OBJDIR)/rockbox.zip
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
################## Specific dependencies ##################
|
2002-10-15 07:51:25 +00:00
|
|
|
$(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS
|
2004-09-22 08:58:50 +00:00
|
|
|
perl $(APPSDIR)/credits.pl < $< > $@
|
2002-10-15 07:51:25 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
$(OBJDIR)/uisw32-res.o: uisw32.rc
|
|
|
|
$(WINDRES) -i $< -o $@
|
2002-05-18 11:43:03 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
$(OBJDIR)/credits.o: $(APPSDIR)/credits.c $(APPSDIR)/credits.h $(OBJDIR)/credits.raw
|
2002-05-21 14:35:18 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
$(OBJDIR)/thread.o: ./thread.c
|
2004-09-22 08:58:50 +00:00
|
|
|
$(OBJDIR)/plugin.o: $(APPSDIR)/plugin.c
|
|
|
|
$(OBJDIR)/build.lang: $(APPSDIR)/lang/$(LANGUAGE).lang
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo "UPLANG"
|
2004-09-22 08:58:50 +00:00
|
|
|
@perl $(TOOLSDIR)/uplang $(APPSDIR)/lang/english.lang $< > $@
|
2002-09-25 14:11:47 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/lang.o: $(OBJDIR)/build.lang
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo GENLANG
|
|
|
|
@perl -s $(TOOLSDIR)/genlang -p=$(OBJDIR)/lang $<
|
|
|
|
@echo "CC lang.c"
|
2004-09-22 08:58:50 +00:00
|
|
|
$(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@
|
2002-09-17 21:54:47 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
$(OBJDIR)/sysfont.o: $(FIRMDIR)/fonts/clR6x8.bdf
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $(OBJDIR)/sysfont.c -o $@
|
2002-09-12 13:33:59 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
################## Plugins ##################
|
|
|
|
$(OBJDIR)/libplugin.a: $(PLUGINLIBOBJS)
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo AR $<
|
|
|
|
@$(AR) ru $@ $+
|
2002-09-12 13:33:59 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
$(OBJDIR)/%.o: $(PLUGINDIR)/lib/%.c
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(CFLAGS) -DPLUGIN -c $< -o $@
|
2002-06-20 09:42:51 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
$(OBJDIR)/%.rock: $(APPSDIR)/plugins/%.c $(APPSDIR)/plugin.h
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
2004-10-05 11:45:29 +00:00
|
|
|
@$(CC) $(APPCFLAGS) -DPLUGIN -shared $< -L$(OBJDIR) -lplugin -o $@
|
2004-10-07 06:02:39 +00:00
|
|
|
ifeq ($(UNAME),CYGWIN)
|
|
|
|
# 'x' must be kept or you'll have "Win32 error 5"
|
|
|
|
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
|
|
|
|
# #define ERROR_ACCESS_DENIED 5L
|
|
|
|
else
|
2004-09-16 14:36:08 +00:00
|
|
|
@chmod -x $@
|
2004-10-07 06:02:39 +00:00
|
|
|
endif
|
2002-07-22 22:59:47 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
################## Patterns for building objects ##################
|
|
|
|
$(OBJDIR)/%.o: ../x11/%.c
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(CFLAGS) -c $< -o $@
|
2002-09-24 17:22:12 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
$(OBJDIR)/%.o: $(SIMCOMMON)/%.c
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-09-27 09:31:31 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
$(OBJDIR)/%.o: $(MACHINEDIR)/%.c
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-05-05 10:29:17 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
$(OBJDIR)/%.o: $(DRIVERS)/%.c
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2003-03-10 14:55:31 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
$(OBJDIR)/%.o: $(FIRMDIR)/%.c
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-08-21 10:43:31 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
$(OBJDIR)/%.o: $(COMMON)/%.c
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-06-17 13:33:47 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
$(OBJDIR)/%.o: $(APPSDIR)/%.c
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo CC $<
|
|
|
|
@$(CC) $(APPCFLAGS) -c $< -o $@
|
2004-07-02 07:43:49 +00:00
|
|
|
|
2002-10-28 20:07:37 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
################## Auto-dependencies ##################
|
|
|
|
DEPS:=$(OBJDIR)/.deps
|
2002-10-18 09:21:29 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
$(DEPS)/%.d: %.c
|
|
|
|
@$(SHELL) -c 'if [ ! -d $(DEPS) ]; then \
|
|
|
|
echo Creating the dependency directory: $(DEPS); \
|
|
|
|
mkdir -p $(DEPS); fi'
|
|
|
|
@$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
|
|
|
|
|sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \
|
|
|
|
[ -s $@ ] || rm -f $@'
|
2004-07-02 07:43:49 +00:00
|
|
|
|
2004-07-23 21:06:03 +00:00
|
|
|
-include $(SRCS:%.c=$(DEPS)/%.d)
|
2004-07-08 10:12:39 +00:00
|
|
|
|
2002-06-17 13:33:47 +00:00
|
|
|
# these ones are simulator-specific
|
2002-05-02 14:12:08 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2003-03-05 22:45:14 +00:00
|
|
|
ifeq ($(UNAME),CYGWIN)
|
2004-09-19 21:58:37 +00:00
|
|
|
$(EXEFILE): $(OBJS)
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo LD $@
|
|
|
|
@$(CC) -g -o $(EXEFILE) $(OBJS) $(LIBDIRS) $(LDFLAGS) $(LIBS)
|
2003-03-05 22:45:14 +00:00
|
|
|
else
|
2004-09-19 21:58:37 +00:00
|
|
|
$(EXEFILE): $(OBJS)
|
2004-09-16 14:36:08 +00:00
|
|
|
@echo LD $@
|
|
|
|
@$(CC) -g -o $(EXEFILE) $(LIBDIRS) $(LDFLAGS) $(OBJS) $(LIBS)
|
2003-03-05 22:45:14 +00:00
|
|
|
endif
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2002-08-15 10:04:53 +00:00
|
|
|
tags:
|
|
|
|
@$(SHELL) -c 'for d in $(SRCDIRS); do { etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; }; done'
|
|
|
|
|