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
|
|
|
|
2002-05-17 12:23:11 +00:00
|
|
|
APPDIR = ../../apps
|
2002-05-17 14:39:42 +00:00
|
|
|
RECDIR = $(APPDIR)/recorder
|
2002-05-17 12:23:11 +00:00
|
|
|
|
|
|
|
PREVAPPDIR= ..
|
2002-04-28 00:00:02 +00:00
|
|
|
FIRMWAREDIR = ../../firmware
|
2002-04-25 08:06:38 +00:00
|
|
|
DRIVERS = $(FIRMWAREDIR)/drivers
|
2002-05-02 14:12:08 +00:00
|
|
|
COMMON = $(FIRMWAREDIR)/common
|
2002-05-17 12:23:11 +00:00
|
|
|
LIBMADDIR = $(PREVAPPDIR)/common/libmad
|
2002-04-11 12:41:27 +00:00
|
|
|
|
2002-03-25 14:21:30 +00:00
|
|
|
CC = gcc
|
2002-04-25 08:06:38 +00:00
|
|
|
RM = rm -f
|
|
|
|
DEBUG = -g
|
2002-05-04 12:26:21 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
# where to put all output files
|
|
|
|
OBJDIR = .
|
|
|
|
|
|
|
|
TARGET = $(OBJDIR)/rockboxui
|
|
|
|
|
2002-05-17 12:23:11 +00:00
|
|
|
#DISPLAY = -DHAVE_LCD_CHARCELLS
|
|
|
|
DISPLAY = -DHAVE_LCD_BITMAP
|
2002-05-16 14:46:58 +00:00
|
|
|
|
2002-05-17 12:23:11 +00:00
|
|
|
#KEYPAD = -DHAVE_PLAYER_KEYPAD
|
|
|
|
KEYPAD = -DHAVE_RECORDER_KEYPAD
|
2002-05-04 12:26:21 +00:00
|
|
|
|
|
|
|
DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
|
2002-08-06 18:09:23 +00:00
|
|
|
$(KEYPAD) $(DISPLAY) #-DLCD_PROPFONTS
|
2002-05-04 12:26:21 +00:00
|
|
|
|
2002-04-24 09:14:16 +00:00
|
|
|
LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl
|
2002-04-25 08:06:38 +00:00
|
|
|
|
2002-06-17 13:33:47 +00:00
|
|
|
# Use this for simulator-only files
|
2002-05-21 14:35:18 +00:00
|
|
|
INCLUDES = -I. -I$(DRIVERS) -I$(COMMON) -I$(FIRMWAREDIR) -I$(APPDIR) -I$(RECDIR)
|
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:
|
|
|
|
APPINCLUDES = -I$(FIRMWAREDIR)/include $(INCLUDES)
|
|
|
|
|
2002-06-10 10:17:54 +00:00
|
|
|
LIBS = -lpthread
|
2002-05-12 11:34:08 +00:00
|
|
|
|
2002-04-24 09:14:16 +00:00
|
|
|
UNAME := $(shell uname)
|
|
|
|
ifeq ($(UNAME),Linux)
|
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
|
2002-05-17 18:19:01 +00:00
|
|
|
DEFINES += -DLINUX
|
2002-05-27 06:55:31 +00:00
|
|
|
#MPEG_PLAY = 1
|
2002-04-19 14:12:31 +00:00
|
|
|
else
|
2002-05-16 13:02:57 +00:00
|
|
|
DEFINES += -DBIG_ENDIAN
|
2002-04-19 14:12:31 +00:00
|
|
|
LIBDIRS =
|
|
|
|
endif
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2002-05-24 08:10:45 +00:00
|
|
|
ifdef MPEG_PLAY
|
|
|
|
INCLUDES += -I$(PREVAPPDIR)/common
|
|
|
|
endif
|
|
|
|
|
2002-07-16 10:54:37 +00:00
|
|
|
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2002-07-15 13:19:00 +00:00
|
|
|
APPCFLAGS = $(DEBUG) $(DEFINES) -DAPPSVERSION=\"$(VERSION)\" $(APPINCLUDES) -W -Wall
|
2002-06-17 13:33:47 +00:00
|
|
|
|
2002-08-07 11:28:04 +00:00
|
|
|
FIRMSRCS = chartables.c lcd.c sprintf.c id3.c debug.c usb.c mpeg.c power.c powermgmt.c
|
2002-05-02 14:12:08 +00:00
|
|
|
|
2002-06-27 00:06:14 +00:00
|
|
|
APPS = main.c tree.c menu.c credits.c main_menu.c\
|
2002-07-22 22:59:47 +00:00
|
|
|
playlist.c showtext.c wps.c settings.c status.c
|
2002-06-24 21:41:01 +00:00
|
|
|
|
|
|
|
MENUS = games_menu.c screensavers_menu.c settings_menu.c sound_menu.c
|
2002-05-16 13:02:57 +00:00
|
|
|
|
2002-05-21 14:35:18 +00:00
|
|
|
ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP)
|
2002-08-07 10:35:26 +00:00
|
|
|
APPS += tetris.c sokoban.c bounce.c boxes.c icons.c bmp.c widgets.c
|
2002-05-21 14:35:18 +00:00
|
|
|
endif
|
2002-05-02 21:30:58 +00:00
|
|
|
|
2002-07-16 10:54:37 +00:00
|
|
|
SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c stubs.c \
|
2002-06-24 21:41:01 +00:00
|
|
|
button-x11.c io.c thread.c $(APPS) $(MENUS) $(FIRMSRCS)
|
2002-04-25 08:06:38 +00:00
|
|
|
|
2002-05-09 23:54:47 +00:00
|
|
|
ifdef MPEG_PLAY
|
2002-05-12 12:30:14 +00:00
|
|
|
SRCS += mpegplay.c oss_sound.c bit.c decoder.c fixed.c frame.c huffman.c layer12.c layer3.c stream.c synth.c timer.c version.c
|
2002-05-12 11:34:08 +00:00
|
|
|
DEFINES += -DMPEG_PLAY -DFPM_DEFAULT -DHAVE_CONFIG_H
|
|
|
|
INCLUDES += -I$(LIBMADDIR)
|
2002-05-09 23:54:47 +00:00
|
|
|
endif
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
OBJS := $(SRCS:%.c=$(OBJDIR)/%.o)
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2002-04-11 12:41:27 +00:00
|
|
|
all: $(TARGET)
|
2002-03-25 14:21:30 +00:00
|
|
|
|
|
|
|
clean:
|
2002-04-25 08:06:38 +00:00
|
|
|
$(RM) $(OBJS) *~ core $(TARGET) $(CLIENTS)
|
|
|
|
$(RM) -r $(DEPS)
|
2002-03-25 14:21:30 +00:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(RM) config.cache
|
|
|
|
|
2002-05-12 11:34:08 +00:00
|
|
|
ifdef MPEG_PLAY
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/bit.o: $(LIBMADDIR)/bit.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/decoder.o: $(LIBMADDIR)/decoder.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/fixed.o: $(LIBMADDIR)/fixed.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/frame.o: $(LIBMADDIR)/frame.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/huffman.o: $(LIBMADDIR)/huffman.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/layer12.o: $(LIBMADDIR)/layer12.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/layer3.o: $(LIBMADDIR)/layer3.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/stream.o: $(LIBMADDIR)/stream.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/synth.o: $(LIBMADDIR)/synth.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/timer.o: $(LIBMADDIR)/timer.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/version.o: $(LIBMADDIR)/version.c
|
2002-05-12 11:34:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/mpegplay.o: $(PREVAPPDIR)/common/mpegplay.c
|
2002-05-12 12:52:15 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-12 11:34:08 +00:00
|
|
|
endif
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/credits.o: $(APPDIR)/credits.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-05-18 11:43:03 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/menu.o: $(APPDIR)/menu.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-05-06 08:43:00 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/main_menu.o: $(APPDIR)/main_menu.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-05-21 14:35:18 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/sound_menu.o: $(APPDIR)/sound_menu.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-05-27 06:55:31 +00:00
|
|
|
|
2002-06-24 08:49:20 +00:00
|
|
|
$(OBJDIR)/games_menu.o: $(APPDIR)/games_menu.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/screensavers_menu.o: $(APPDIR)/screensavers_menu.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-06-24 21:41:01 +00:00
|
|
|
$(OBJDIR)/settings_menu.o: $(APPDIR)/settings_menu.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/icons.o: $(RECDIR)/icons.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-08-07 10:35:26 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/widgets.o: $(RECDIR)/widgets.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-05-08 11:05:28 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/tetris.o: $(RECDIR)/tetris.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-04-28 00:00:02 +00:00
|
|
|
|
2002-06-16 23:36:08 +00:00
|
|
|
$(OBJDIR)/sokoban.o: $(RECDIR)/sokoban.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-06-16 23:36:08 +00:00
|
|
|
|
2002-06-15 13:31:53 +00:00
|
|
|
$(OBJDIR)/bounce.o: $(RECDIR)/bounce.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-06-15 13:31:53 +00:00
|
|
|
|
2002-06-16 23:36:08 +00:00
|
|
|
$(OBJDIR)/boxes.o: $(RECDIR)/boxes.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-05-02 21:30:58 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/main.o: $(APPDIR)/main.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-04-28 00:00:02 +00:00
|
|
|
|
2002-06-25 13:26:04 +00:00
|
|
|
$(OBJDIR)/wps.o: $(APPDIR)/wps.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/bmp.o: $(RECDIR)/bmp.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-05-16 13:02:57 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/tree.o: $(APPDIR)/tree.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-04-30 13:14:59 +00:00
|
|
|
|
2002-06-04 21:45:51 +00:00
|
|
|
$(OBJDIR)/playlist.o: $(APPDIR)/playlist.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/showtext.o: $(APPDIR)/showtext.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-06-04 21:45:51 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/lcd.o: $(DRIVERS)/lcd.c
|
2002-07-15 13:19:00 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2002-04-11 12:41:27 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/chartables.o: $(FIRMWAREDIR)/chartables.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-04-11 12:41:27 +00:00
|
|
|
|
2002-06-27 00:25:19 +00:00
|
|
|
$(OBJDIR)/settings.o: $(APPDIR)/settings.c
|
2002-06-20 09:42:51 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-07-22 22:59:47 +00:00
|
|
|
$(OBJDIR)/status.o: $(APPDIR)/status.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/id3.o: $(FIRMWAREDIR)/id3.c
|
2002-06-17 13:33:47 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
2002-05-05 10:29:17 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/debug.o: $(FIRMWAREDIR)/debug.c
|
2002-05-06 11:24:08 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-06-30 14:37:40 +00:00
|
|
|
$(OBJDIR)/mpeg.o: $(FIRMWAREDIR)/mpeg.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
$(OBJDIR)/sprintf.o: $(COMMON)/sprintf.c
|
2002-07-15 13:19:00 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2002-06-17 13:33:47 +00:00
|
|
|
|
2002-06-30 14:37:40 +00:00
|
|
|
$(OBJDIR)/usb.o: $(FIRMWAREDIR)/usb.c
|
2002-07-15 13:19:00 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2002-06-30 14:37:40 +00:00
|
|
|
|
2002-08-07 11:28:04 +00:00
|
|
|
$(OBJDIR)/powermgmt.o: $(FIRMWAREDIR)/powermgmt.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-07-16 10:54:37 +00:00
|
|
|
$(OBJDIR)/stubs.o: ../common/stubs.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-07-16 11:11:00 +00:00
|
|
|
$(OBJDIR)/power.o: $(DRIVERS)/power.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
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
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
2002-05-09 23:54:47 +00:00
|
|
|
$(CC) -g -o $(TARGET) $(LIBDIRS) $(LDFLAGS) $(OBJS) $(LIBS)
|
2002-03-25 14:21:30 +00:00
|
|
|
|
2002-05-31 07:23:07 +00:00
|
|
|
DEPS:=$(OBJDIR)/.deps
|
2002-04-25 08:06:38 +00:00
|
|
|
|
|
|
|
$(DEPS)/%.d: %.c
|
|
|
|
@$(SHELL) -c 'if [ ! -d $(DEPS) ]; then \
|
|
|
|
echo Creating the dependency directory: $(DEPS); \
|
2002-05-31 07:23:07 +00:00
|
|
|
mkdir -p $(DEPS); fi'
|
2002-04-25 08:06:38 +00:00
|
|
|
@echo "Updating Dependencies for $<"
|
|
|
|
@$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
|
2002-05-31 07:23:07 +00:00
|
|
|
|sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \
|
2002-04-25 08:06:38 +00:00
|
|
|
[ -s $@ ] || rm -f $@'
|
2002-04-11 12:41:27 +00:00
|
|
|
|
2002-04-25 08:06:38 +00:00
|
|
|
-include $(SRCS:%.c=$(DEPS)/%.d)
|