summaryrefslogtreecommitdiff
path: root/firmware/test
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2012-05-03 07:08:43 +0200
committerMarcin Bukat <marcin.bukat@gmail.com>2012-05-08 13:00:14 +0200
commit10829b2f78de91f66c7da5f7a2a2fe6d252eb38d (patch)
tree4c7a94d4143d1bff2602fd02cc21d46115ee2111 /firmware/test
parentdae7a29b35db0ac4911007180389cdc0e98d5af5 (diff)
downloadrockbox-10829b2f78de91f66c7da5f7a2a2fe6d252eb38d.zip
rockbox-10829b2f78de91f66c7da5f7a2a2fe6d252eb38d.tar.gz
rockbox-10829b2f78de91f66c7da5f7a2a2fe6d252eb38d.tar.bz2
rockbox-10829b2f78de91f66c7da5f7a2a2fe6d252eb38d.tar.xz
Fix fat test program not compiling (FS#12646).
This changes the way creat() is wrapped around in native builds so more experienced devs should look at it. This patch forces to compile fat test in 32bit mode. Building natively on x86-64 works just fine but our fat code apparently can't deal with 64bit pointers/ints correctly. Change-Id: I000015094f7db957ce826c22672608cd419908b0 Reviewed-on: http://gerrit.rockbox.org/228 Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Diffstat (limited to 'firmware/test')
-rw-r--r--firmware/test/fat/Makefile17
-rw-r--r--firmware/test/fat/main.c5
2 files changed, 9 insertions, 13 deletions
diff --git a/firmware/test/fat/Makefile b/firmware/test/fat/Makefile
index 74d2628..3e04724 100644
--- a/firmware/test/fat/Makefile
+++ b/firmware/test/fat/Makefile
@@ -1,26 +1,21 @@
FIRMWARE = ../..
-export BUILDDATE=$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
-export CPU=arm
-export TARGET=-DIPOD_VIDEO
-export TARGET_INC=-I$(FIRMWARE)/target/arm/ipod/video -I$(FIRMWARE)/target/arm/ipod -I$(FIRMWARE)/target/arm
-
DRIVERS = ../../drivers
EXPORT = ../../export
-INCLUDE = -I$(EXPORT) -I$(FIRMWARE)/include
-
-DEFINES = -DTEST_FAT -DDEBUG -DCRT_DISPLAY -DDISK_WRITE -DHAVE_FAT16SUPPORT -D__PCTOOL__
+BUILDDATE=$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
+INCLUDE = -I$(EXPORT) -I$(FIRMWARE)/include -I$(FIRMWARE)/target/hosted -I$(FIRMWARE)/target/hosted/sdl
+DEFINES = -DTEST_FAT -DDEBUG -DDISK_WRITE -DHAVE_FAT16SUPPORT -D__PCTOOL__
-CFLAGS = -g -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) -I. $(INCLUDE) $(BUILDDATE) -I$(FIRMWARE)/libc/include
-SIMFLAGS = -g -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) -I. $(INCLUDE)
+CFLAGS = -g -m32 -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) $(BUILDDATE) -I. $(INCLUDE) -I$(FIRMWARE)/libc/include
+SIMFLAGS = -g -m32 -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) -I. $(INCLUDE)
TARGET = fat
all: $(TARGET)
$(TARGET): fat.o ata-sim.o main.o disk.o dir.o file.o ctype.o unicode.o strlcpy.o
- gcc -g -o fat $+ -lfl
+ gcc -g -m32 -o fat $+
fat.o: $(DRIVERS)/fat.c $(EXPORT)/fat.h $(EXPORT)/ata.h
$(CC) $(CFLAGS) -c $< -o $@
diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c
index a9220d1..756f326 100644
--- a/firmware/test/fat/main.c
+++ b/firmware/test/fat/main.c
@@ -9,6 +9,7 @@
#include "dir.h"
#include "file.h"
#include "ata.h"
+#include "storage.h"
void dbg_dump_sector(int sec);
void dbg_dump_buffer(unsigned char *buf, int len, int offset);
@@ -432,7 +433,7 @@ void dbg_tail(char* name)
if( rc > 0 )
{
buf[rc]=0;
- printf("%d:\n%s\n", strlen(buf), buf);
+ printf("%d:\n%s\n", (int)strlen(buf), buf);
}
else if ( rc == 0 ) {
DEBUGF("EOF\n");
@@ -463,7 +464,7 @@ int dbg_head(char* name)
if( rc > 0 )
{
buf[rc]=0;
- printf("%d:\n%s\n", strlen(buf), buf);
+ printf("%d:\n%s\n", (int)strlen(buf), buf);
}
else if ( rc == 0 ) {
DEBUGF("EOF\n");