rockbox/firmware/test/fat/Makefile
Marcin Bukat 10829b2f78 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>
2012-05-08 13:00:14 +02:00

48 lines
1.3 KiB
Makefile

FIRMWARE = ../..
DRIVERS = ../../drivers
EXPORT = ../../export
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 -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 -m32 -o fat $+
fat.o: $(DRIVERS)/fat.c $(EXPORT)/fat.h $(EXPORT)/ata.h
$(CC) $(CFLAGS) -c $< -o $@
ctype.o: $(FIRMWARE)/libc/ctype.c
$(CC) $(CFLAGS) -c $< -o $@
disk.o: $(FIRMWARE)/common/disk.c
$(CC) $(CFLAGS) -c $< -o $@
dir.o: $(FIRMWARE)/common/dir_uncached.c
$(CC) $(CFLAGS) -c $< -o $@
file.o: $(FIRMWARE)/common/file.c
$(CC) $(CFLAGS) -c $< -o $@
unicode.o: $(FIRMWARE)/common/unicode.c
$(CC) $(CFLAGS) -c $< -o $@
strlcpy.o: $(FIRMWARE)/common/strlcpy.c
$(CC) $(CFLAGS) -c $< -o $@
ata-sim.o: ata-sim.c $(EXPORT)/ata.h
$(CC) $(SIMFLAGS) -c $< -o $@
main.o: main.c $(EXPORT)/ata.h
$(CC) $(SIMFLAGS) -c $< -o $@
clean:
rm -f *.o $(TARGET)