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
|
|
|
|
|
|
|
|
ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP)
|
|
|
|
MACHINEDIR = $(RECDIR)
|
2002-10-11 20:17:08 +00:00
|
|
|
# not very nice to set RTC like this, but...
|
|
|
|
RTC += -DHAVE_RTC
|
2002-09-03 10:13:46 +00:00
|
|
|
else
|
|
|
|
MACHINEDIR = $(PLAYDIR)
|
|
|
|
endif
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
PREVAPPDIR= ..
|
|
|
|
FIRMWAREDIR = ../../firmware
|
|
|
|
DRIVERS = $(FIRMWAREDIR)/drivers
|
|
|
|
COMMON = $(FIRMWAREDIR)/common
|
|
|
|
LIBMADDIR = $(PREVAPPDIR)/common/libmad
|
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
|
|
|
|
|
|
|
CC = i386-mingw32msvc-gcc
|
|
|
|
WINDRES = i386-mingw32msvc-windres
|
|
|
|
RM = rm -f
|
|
|
|
DEBUG = -g
|
|
|
|
|
|
|
|
# where to put all output files
|
|
|
|
OBJDIR = .
|
2002-09-18 14:08:05 +00:00
|
|
|
LANGUAGE = english
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-08-02 12:54:46 +00:00
|
|
|
TARGET = $(OBJDIR)/uisw32.exe
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
|
2002-10-11 20:17:08 +00:00
|
|
|
$(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) $(RTC)
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-08-21 11:29:54 +00:00
|
|
|
LDFLAGS = -lgdi32 -luser32 -mwindows
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
# Use this for simulator-only files
|
2002-09-18 14:08:05 +00:00
|
|
|
INCLUDES = -I. -I$(DRIVERS) -I$(COMMON) -I$(FIRMWAREDIR) -I$(APPDIR) -I$(MACHINEDIR) -I../common -I$(MACHINEDIR) -I$(OBJDIR)
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
# The true Rockbox Applications should use this include path:
|
|
|
|
APPINCLUDES = -I$(FIRMWAREDIR)/include $(INCLUDES)
|
|
|
|
|
|
|
|
DEFINES += -DWIN32
|
|
|
|
|
2002-08-21 11:29:54 +00:00
|
|
|
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mwindows
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-08-21 11:29:54 +00:00
|
|
|
APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall -mwindows
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-10-18 13:46:58 +00:00
|
|
|
ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP)
|
|
|
|
LCDSRSC = lcd-recorder.c
|
|
|
|
else
|
|
|
|
LCDSRSC = lcd-playersim.c lcd-player.c
|
|
|
|
endif
|
|
|
|
FIRMSRCS = $(LCDSRSC) power.c sprintf.c id3.c usb.c \
|
2002-10-02 16:33:26 +00:00
|
|
|
mpeg.c powermgmt.c font.c sysfont.c ctype.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 \
|
2002-09-30 19:06:29 +00:00
|
|
|
screens.c peakmeter.c viewer.c
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-09-06 23:05:34 +00:00
|
|
|
MENUS = games_menu.c demo_menu.c settings_menu.c sound_menu.c
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP)
|
2002-09-24 18:04:15 +00:00
|
|
|
APPS += tetris.c sokoban.c bounce.c snow.c bmp.c \
|
2002-10-15 07:19:08 +00:00
|
|
|
widgets.c wormlet.c cube.c
|
2002-08-02 12:17:10 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
SRCS = button.c dir-win32.c lcd-win32.c panic-win32.c thread-win32.c \
|
2002-08-13 17:35:53 +00:00
|
|
|
debug-win32.c kernel.c string-win32.c uisw32.c stubs.c \
|
2002-08-21 11:24:51 +00:00
|
|
|
$(APPS) $(MENUS) $(FIRMSRCS) strtok.c sim_icons.c
|
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
|
|
|
|
2002-08-02 12:54:46 +00:00
|
|
|
all: $(TARGET)
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-08-02 12:54:46 +00:00
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/uisw32-res.o: uisw32.rc
|
|
|
|
$(WINDRES) -i $< -o $@
|
|
|
|
|
|
|
|
clean:
|
2002-09-25 14:15:07 +00:00
|
|
|
$(RM) $(OBJS) *~ core $(TARGET) $(CLIENTS) $(OBJDIR)/uisw32-res.o \
|
|
|
|
$(OBJDIR)/lang.[cho] $(OBJDIR)/build.lang $(OBJDIR)/*.o \
|
|
|
|
$(OBJDIR)/sysfont.c
|
2002-08-02 12:17:10 +00:00
|
|
|
$(RM) -r $(DEPS)
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(RM) config.cache
|
|
|
|
|
2002-10-15 07:51:25 +00:00
|
|
|
$(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS
|
|
|
|
perl $(APPDIR)/credits.pl < $< > $@
|
|
|
|
|
|
|
|
$(OBJDIR)/credits.o: $(APPDIR)/credits.c $(APPDIR)/credits.h $(OBJDIR)/credits.raw
|
2002-08-02 12:17:10 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/menu.o: $(APPDIR)/menu.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/main_menu.o: $(APPDIR)/main_menu.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-09-24 12:43:52 +00:00
|
|
|
$(OBJDIR)/language.o: $(APPDIR)/language.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-08-02 12:17:10 +00:00
|
|
|
$(OBJDIR)/sound_menu.o: $(APPDIR)/sound_menu.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/games_menu.o: $(APPDIR)/games_menu.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-09-06 23:05:34 +00:00
|
|
|
$(OBJDIR)/demo_menu.o: $(APPDIR)/demo_menu.c
|
2002-08-02 12:17:10 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/settings_menu.o: $(APPDIR)/settings_menu.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-09-03 10:13:46 +00:00
|
|
|
$(OBJDIR)/icons.o: $(MACHINEDIR)/icons.c
|
2002-08-02 12:17:10 +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-08-02 12:17:10 +00:00
|
|
|
$(OBJDIR)/tetris.o: $(RECDIR)/tetris.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-08-26 09:21:59 +00:00
|
|
|
$(OBJDIR)/wormlet.o: $(RECDIR)/wormlet.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-08-02 12:17:10 +00:00
|
|
|
$(OBJDIR)/sokoban.o: $(RECDIR)/sokoban.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/bounce.o: $(RECDIR)/bounce.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-10-15 07:19:08 +00:00
|
|
|
$(OBJDIR)/cube.o: $(RECDIR)/cube.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-09-06 23:05:34 +00:00
|
|
|
$(OBJDIR)/snow.o: $(RECDIR)/snow.c
|
2002-08-02 12:17:10 +00:00
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/main.o: $(APPDIR)/main.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/wps.o: $(APPDIR)/wps.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-09-30 19:06:29 +00:00
|
|
|
$(OBJDIR)/viewer.o: $(APPDIR)/viewer.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-08-30 11:04:41 +00:00
|
|
|
$(OBJDIR)/wps-display.o: $(APPDIR)/wps-display.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-08-02 12:17:10 +00:00
|
|
|
$(OBJDIR)/bmp.o: $(RECDIR)/bmp.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/tree.o: $(APPDIR)/tree.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/playlist.o: $(APPDIR)/playlist.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-09-25 14:15:07 +00:00
|
|
|
$(OBJDIR)/build.lang: $(APPDIR)/lang/$(LANGUAGE).lang
|
|
|
|
perl $(TOOLSDIR)/uplang $(APPDIR)/lang/english.lang $< > $@
|
|
|
|
|
|
|
|
$(OBJDIR)/lang.o: $(OBJDIR)/build.lang
|
|
|
|
perl -s $(TOOLSDIR)/genlang -p=$(OBJDIR)/lang $<
|
2002-09-18 14:08:05 +00:00
|
|
|
$(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@
|
2002-09-17 21:54:47 +00:00
|
|
|
|
2002-09-23 11:23:13 +00:00
|
|
|
$(OBJDIR)/lcd-recorder.o: $(DRIVERS)/lcd-recorder.c
|
2002-09-23 11:17:52 +00:00
|
|
|
$(CC) $(APPCFLAGS) -DHAVE_LCD_BITMAP -c $< -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/power.o: $(DRIVERS)/power.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/usb.o: $(FIRMWAREDIR)/usb.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-08-07 11:45:42 +00:00
|
|
|
$(OBJDIR)/powermgmt.o: $(FIRMWAREDIR)/powermgmt.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-08-02 12:17:10 +00:00
|
|
|
$(OBJDIR)/settings.o: $(APPDIR)/settings.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/id3.o: $(FIRMWAREDIR)/id3.c
|
2002-09-13 06:06:26 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-09-13 06:06:26 +00:00
|
|
|
$(OBJDIR)/font.o: $(FIRMWAREDIR)/font.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2002-09-12 21:33:33 +00:00
|
|
|
|
2002-09-20 08:07:51 +00:00
|
|
|
$(OBJDIR)/sysfont.o: $(FIRMWAREDIR)/fonts/clR6x8.bdf
|
|
|
|
$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $<
|
|
|
|
$(CC) $(APPCFLAGS) -c $(OBJDIR)/sysfont.c -o $@
|
2002-09-12 21:33:33 +00:00
|
|
|
|
2002-08-02 12:17:10 +00:00
|
|
|
$(OBJDIR)/status.o: $(APPDIR)/status.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-09-24 17:22:12 +00:00
|
|
|
$(OBJDIR)/screens.o: $(APPDIR)/screens.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-09-27 09:31:31 +00:00
|
|
|
$(OBJDIR)/peakmeter.o: $(RECDIR)/peakmeter.c
|
|
|
|
$(CC) $(APPCFLAGS) -c $< -o $@
|
|
|
|
|
2002-09-12 21:33:33 +00:00
|
|
|
$(OBJDIR)/version.o: $(FIRMWAREDIR)/version.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-08-02 12:17:10 +00:00
|
|
|
$(OBJDIR)/debug.o: $(FIRMWAREDIR)/debug.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/mpeg.o: $(FIRMWAREDIR)/mpeg.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/sprintf.o: $(COMMON)/sprintf.c
|
2002-09-13 06:06:26 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-10-02 16:33:26 +00:00
|
|
|
$(OBJDIR)/ctype.o: $(COMMON)/ctype.c
|
|
|
|
$(CC) $(CFLAGS) $(APPINCLUDES) -c $< -o $@
|
|
|
|
|
2002-08-02 12:17:10 +00:00
|
|
|
$(OBJDIR)/strtok.o: $(COMMON)/strtok.c
|
2002-09-13 06:06:26 +00:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-08-13 17:35:53 +00:00
|
|
|
$(OBJDIR)/stubs.o: ../common/stubs.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2002-08-02 12:17:10 +00:00
|
|
|
|
2002-08-21 11:24:51 +00:00
|
|
|
$(OBJDIR)/sim_icons.o: ../common/sim_icons.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-10-18 13:27:55 +00:00
|
|
|
$(OBJDIR)/lcd-playersim.o: ../common/lcd-playersim.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(OBJDIR)/lcd-player.o: $(DRIVERS)/lcd-player.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
2002-08-02 12:17:10 +00:00
|
|
|
# these ones are simulator-specific
|
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
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)
|