rockbox/uisimulator/x11/Makefile

203 lines
5 KiB
Makefile
Raw Normal View History

############################################################################
# __________ __ ___.
# 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
PREVAPPDIR= ..
FIRMWAREDIR = ../../firmware
DRIVERS = $(FIRMWAREDIR)/drivers
COMMON = $(FIRMWAREDIR)/common
LIBMADDIR = $(PREVAPPDIR)/common/libmad
CC = gcc
RM = rm -f
DEBUG = -g
# where to put all output files
OBJDIR = .
TARGET = $(OBJDIR)/rockboxui
#DISPLAY = -DHAVE_LCD_CHARCELLS
DISPLAY = -DHAVE_LCD_BITMAP
#KEYPAD = -DHAVE_PLAYER_KEYPAD
KEYPAD = -DHAVE_RECORDER_KEYPAD
DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
$(KEYPAD) $(DISPLAY)
LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl
INCLUDES = -I. -I$(DRIVERS) -I$(COMMON) -I$(FIRMWAREDIR) -I$(APPDIR) -I$(RECDIR)
LIBS =
UNAME := $(shell uname)
ifeq ($(UNAME),Linux)
INCLUDES += -I/usr/X11R6/include
LIBDIRS = -L/usr/X11R6/lib
DEFINES += -DLINUX
#MPEG_PLAY = 1
else
DEFINES += -DBIG_ENDIAN
LIBDIRS =
endif
ifdef MPEG_PLAY
INCLUDES += -I$(PREVAPPDIR)/common
endif
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES)
FIRMSRCS = chartables.c lcd.c sprintf.c id3.c debug.c
APPS = main.c tree.c play.c menu.c credits.c main_menu.c sound_menu.c
ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP)
APPS += tetris.c screensaver.c icons.c bmp.c
endif
SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c mpeg.c \
button-x11.c io.c sleep.c $(APPS) $(FIRMSRCS)
ifdef MPEG_PLAY
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
DEFINES += -DMPEG_PLAY -DFPM_DEFAULT -DHAVE_CONFIG_H
INCLUDES += -I$(LIBMADDIR)
endif
OBJS := $(SRCS:%.c=$(OBJDIR)/%.o)
all: $(TARGET)
clean:
$(RM) $(OBJS) *~ core $(TARGET) $(CLIENTS)
$(RM) -r $(DEPS)
distclean: clean
$(RM) config.cache
ifdef MPEG_PLAY
$(OBJDIR)/bit.o: $(LIBMADDIR)/bit.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/decoder.o: $(LIBMADDIR)/decoder.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/fixed.o: $(LIBMADDIR)/fixed.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/frame.o: $(LIBMADDIR)/frame.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/huffman.o: $(LIBMADDIR)/huffman.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/layer12.o: $(LIBMADDIR)/layer12.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/layer3.o: $(LIBMADDIR)/layer3.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/stream.o: $(LIBMADDIR)/stream.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/synth.o: $(LIBMADDIR)/synth.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/timer.o: $(LIBMADDIR)/timer.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/version.o: $(LIBMADDIR)/version.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/mpegplay.o: $(PREVAPPDIR)/common/mpegplay.c
$(CC) $(CFLAGS) -c $< -o $@
endif
$(OBJDIR)/credits.o: $(APPDIR)/credits.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/menu.o: $(APPDIR)/menu.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/main_menu.o: $(APPDIR)/main_menu.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/sound_menu.o: $(APPDIR)/sound_menu.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/icons.o: $(RECDIR)/icons.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/tetris.o: $(RECDIR)/tetris.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/screensaver.o: $(RECDIR)/screensaver.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/main.o: $(APPDIR)/main.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/bmp.o: $(RECDIR)/bmp.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/play.o: $(APPDIR)/play.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/tree.o: $(APPDIR)/tree.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/lcd.o: $(DRIVERS)/lcd.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/chartables.o: $(FIRMWAREDIR)/chartables.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/id3.o: $(FIRMWAREDIR)/id3.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/debug.o: $(FIRMWAREDIR)/debug.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/sprintf.o: $(COMMON)/sprintf.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
$(TARGET): $(OBJS)
$(CC) -g -o $(TARGET) $(LIBDIRS) $(LDFLAGS) $(OBJS) $(LIBS)
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)