summaryrefslogtreecommitdiff
path: root/uisimulator/x11/Makefile
blob: 996ef6105d6b739862c1e4e58e7293c2b5275f76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
############################################################################
#             __________               __   ___.                  
#   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.
#
############################################################################

TARGET = rockboxui

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

#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$(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

CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES)

#SRCS = $(wildcard *.c)

FIRMSRCS = chartables.c lcd.c sprintf.c id3.c debug.c

APPS = tetris.c screensaver.c tree.c app.c play.c menu.c icons.c bmp.c credits.c


SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.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=o)

all: $(TARGET)

clean:
	$(RM) $(OBJS) *~ core $(TARGET) $(CLIENTS)
	$(RM) -r $(DEPS)

distclean: clean
	$(RM) config.cache

ifdef MPEG_PLAY
bit.o: $(LIBMADDIR)/bit.c
	$(CC) $(CFLAGS) -c $< -o $@

decoder.o: $(LIBMADDIR)/decoder.c
	$(CC) $(CFLAGS) -c $< -o $@

fixed.o: $(LIBMADDIR)/fixed.c
	$(CC) $(CFLAGS) -c $< -o $@

frame.o: $(LIBMADDIR)/frame.c
	$(CC) $(CFLAGS) -c $< -o $@

huffman.o: $(LIBMADDIR)/huffman.c
	$(CC) $(CFLAGS) -c $< -o $@

layer12.o: $(LIBMADDIR)/layer12.c
	$(CC) $(CFLAGS) -c $< -o $@

layer3.o: $(LIBMADDIR)/layer3.c
	$(CC) $(CFLAGS) -c $< -o $@

stream.o: $(LIBMADDIR)/stream.c
	$(CC) $(CFLAGS) -c $< -o $@

synth.o: $(LIBMADDIR)/synth.c
	$(CC) $(CFLAGS) -c $< -o $@

timer.o: $(LIBMADDIR)/timer.c
	$(CC) $(CFLAGS) -c $< -o $@

version.o: $(LIBMADDIR)/version.c
	$(CC) $(CFLAGS) -c $< -o $@

mpegplay.o: $(PREVAPPDIR)/common/mpegplay.c
	$(CC) $(CFLAGS) -c $< -o $@

endif

credits.o: $(APPDIR)/credits.c
	$(CC) $(CFLAGS) -c $< -o $@

menu.o: $(APPDIR)/menu.c
	$(CC) $(CFLAGS) -c $< -o $@

icons.o: $(RECDIR)/icons.c
	$(CC) $(CFLAGS) -c $< -o $@

tetris.o: $(RECDIR)/tetris.c
	$(CC) $(CFLAGS) -c $< -o $@

screensaver.o: $(RECDIR)/screensaver.c
	$(CC) $(CFLAGS) -c $< -o $@

app.o: $(APPDIR)/app.c
	$(CC) $(CFLAGS) -c $< -o $@

bmp.o: $(RECDIR)/bmp.c
	$(CC) $(CFLAGS) -c $< -o $@

play.o: $(APPDIR)/play.c
	$(CC) $(CFLAGS) -c $< -o $@

tree.o: $(APPDIR)/tree.c
	$(CC) $(CFLAGS) -c $< -o $@

lcd.o: $(DRIVERS)/lcd.c
	$(CC) $(CFLAGS) -c $< -o $@

chartables.o: $(FIRMWAREDIR)/chartables.c
	$(CC) $(CFLAGS) -c $< -o $@

id3.o: $(FIRMWAREDIR)/id3.c
	$(CC) $(CFLAGS) -c $< -o $@

debug.o: $(FIRMWAREDIR)/debug.c
	$(CC) $(CFLAGS) -c $< -o $@

sprintf.o: $(COMMON)/sprintf.c
	$(CC) $(CFLAGS) -c $< -o $@

.c.o:
	$(CC) $(CFLAGS) -c $<

$(TARGET): $(OBJS)
	$(CC) -g -o $(TARGET) $(LIBDIRS) $(LDFLAGS) $(OBJS) $(LIBS)

DEPS:=.deps

$(DEPS)/%.d: %.c
		@$(SHELL) -c 'if [ ! -d $(DEPS) ]; then \
			echo Creating the dependency directory: $(DEPS); \
			mkdir $(DEPS); fi'
		@echo "Updating Dependencies for $<"
		@$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
	|sed '\''s/\($*\)\.o[ :]*/\1.o $(<:%.c=%.d) : /g'\'' > $@; \
	[ -s $@ ] || rm -f $@'

-include $(SRCS:%.c=$(DEPS)/%.d)