summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/x11/Makefile7
-rw-r--r--uisimulator/x11/dir.h7
-rw-r--r--uisimulator/x11/io.c15
3 files changed, 27 insertions, 2 deletions
diff --git a/uisimulator/x11/Makefile b/uisimulator/x11/Makefile
index fd53196784..9d73305c57 100644
--- a/uisimulator/x11/Makefile
+++ b/uisimulator/x11/Makefile
@@ -29,7 +29,7 @@ DEBUG = -g
29DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR -DHAVE_LCD_BITMAP -DHAVE_RECORDER_KEYPAD 29DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR -DHAVE_LCD_BITMAP -DHAVE_RECORDER_KEYPAD
30LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl 30LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl
31 31
32INCLUDES = -I$(DRIVERS) -I$(FIRMWAREDIR) 32INCLUDES = -I. -I$(DRIVERS) -I$(FIRMWAREDIR)
33 33
34UNAME := $(shell uname) 34UNAME := $(shell uname)
35ifeq ($(UNAME),Linux) 35ifeq ($(UNAME),Linux)
@@ -44,7 +44,7 @@ CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES)
44#SRCS = $(wildcard *.c) 44#SRCS = $(wildcard *.c)
45 45
46SRCS = screenhack.c uibasic.c resources.c visual.c lcd.c lcd-x11.c \ 46SRCS = screenhack.c uibasic.c resources.c visual.c lcd.c lcd-x11.c \
47 button-x11.c chartables.c tetris.c app.c 47 button-x11.c chartables.c tetris.c app.c tree.c io.c
48 48
49OBJS := $(SRCS:c=o) 49OBJS := $(SRCS:c=o)
50 50
@@ -63,6 +63,9 @@ tetris.o: $(APPDIR)/tetris.c
63app.o: $(APPDIR)/app.c 63app.o: $(APPDIR)/app.c
64 $(CC) $(CFLAGS) -c $< -o $@ 64 $(CC) $(CFLAGS) -c $< -o $@
65 65
66tree.o: $(APPDIR)/tree.c
67 $(CC) $(CFLAGS) -c $< -o $@
68
66lcd.o: $(DRIVERS)/lcd.c 69lcd.o: $(DRIVERS)/lcd.c
67 $(CC) $(CFLAGS) -c $< -o $@ 70 $(CC) $(CFLAGS) -c $< -o $@
68 71
diff --git a/uisimulator/x11/dir.h b/uisimulator/x11/dir.h
new file mode 100644
index 0000000000..560cf103d2
--- /dev/null
+++ b/uisimulator/x11/dir.h
@@ -0,0 +1,7 @@
1#include <sys/types.h>
2#include <dirent.h>
3
4#define opendir(x) x11_opendir(x)
5
6#define DIRENT_DEFINED /* prevent it from getting defined again */
7#include "../../firmware/common/dir.h"
diff --git a/uisimulator/x11/io.c b/uisimulator/x11/io.c
new file mode 100644
index 0000000000..4c1e594047
--- /dev/null
+++ b/uisimulator/x11/io.c
@@ -0,0 +1,15 @@
1
2#include <dirent.h>
3
4#define SIMULATOR_ARCHOS_ROOT "archos"
5
6DIR *x11_opendir(char *name)
7{
8 char buffer[256]; /* sufficiently big */
9
10 if(name[0] == '/') {
11 sprintf(buffer, "%s/%s", SIMULATOR_ARCHOS_ROOT, name);
12 return opendir(buffer);
13 }
14 return opendir(name);
15}