annotate Makefile.wiz @ 4447:947201caa46e

Added automated test to Xcode project plus needed changes to SDL_RWFromFile to be OS X bundle aware. The Mac OS X project has a new target called testsdl which builds the automated test. I looked at using Xcode's native unit test support, but the impedance mismatch between the existing automated test structure and Apple's was more than I could handle. As such, the testsdl application is a full blown proper OS X application, which means it is a self-contained .app bundle. This immediately revealed some problems from the automated test. The largest problem was the assumption about the current working directory and where to find resources. (I suspect Windows may have a similar problem depending on circumstance.) To open resources, the test was looking in directories relative to the SDL source directory, but this will not work well with self-contained .app bundles and Xcode which can place its built applications almost anywhere. And for real-world situations, this is pretty useless anyway. So I modified SDL_RWFromFile to do special things on OS X. First, it will look for a file in the .app bundle. If not found, it will fallback and just call fopen as it used to do. I also had to modify the automated test itself because it had a contrieved test which called fopen directly to do read from an existing FILE pointer. In addition, there was a write test. Since a .app bundle is likely going to be read-only, I added a special case for OS X to write to NSTemporaryDirectory. I expect these changes should work for both Mac and iPhone OS (which includes iPad). I will update the iPhone Xcode project next. Finally, FYI, the X11 automated test seems to be failing. Below is my output. Pending breakpoint 4 - "-[NSException raise]" resolved Platform : All tests successful (2) SDL_RWops : All tests successful (5) Rect : All tests successful (1) SDL_Surface : All tests successful (6) Rendering with cocoa driver : All tests successful (3) Assert Failed! Blit output not the same. Test Case 'Renderer x11' Test Suite 'Rendering with x11 driver' Last SDL error '' Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150 Rendering with x11 driver : Failed 1 out of 4 testcases! Rendering with dummy driver : All tests successful (3) SDL_Audio : All tests successful (1) Tests run with SDL 1.3.0 revision 1095906 System is running Mac OS X and is little endian
author Eric Wing <ewing . public |-at-| gmail . com>
date Sat, 08 May 2010 00:54:22 -0700
parents ca5663493497
children
rev   line source
3438
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 # Makefile to build the pandora SDL library
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 WIZSDK = /mythtv/media/devel/toolchains/openwiz/arm-openwiz-linux-gnu
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
3
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4 AR = $(WIZSDK)/bin/arm-openwiz-linux-gnu-ar
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 RANLIB = $(WIZSDK)/bin/arm-openwiz-linux-gnu-ranlib
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
6 CC = $(WIZSDK)/bin/arm-openwiz-linux-gnu-gcc
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 CXX = $(WIZSDK)/bin/arm-openwiz-linux-gnu-g++
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
8 STRIP = $(WIZSDK)/bin/arm-openwiz-linux-gnu-strip
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 CFLAGS = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 TARGET_STATIC = libSDL13.a
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
13 TARGET_SHARED = libSDL13.so
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
15 SOURCES = ./src/*.c ./src/audio/*.c ./src/cdrom/*.c ./src/cpuinfo/*.c ./src/events/*.c \
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
16 ./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
17 ./src/joystick/*.c ./src/haptic/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18 ./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c ./src/audio/dma/*.c \
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19 ./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 ./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 ./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c ./src/cdrom/dummy/*.c \
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
22 ./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25 OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
27 all: config_copy $(TARGET_STATIC) $(TARGET_SHARED)
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29 $(TARGET_STATIC): $(OBJECTS)
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
30 $(AR) crv $@ $^
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
31 $(RANLIB) $@
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
32
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
33 $(TARGET_SHARED):
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
34 $(CC) -shared -Wl,-soname,$(TARGET_SHARED).0 -o $(TARGET_SHARED).0.0.1 $(OBJECTS)
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35 ln -s $(TARGET_SHARED).0.0.1 $(TARGET_SHARED).0
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
36 ln -s $(TARGET_SHARED).0 $(TARGET_SHARED)
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
37
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
38 config_copy:
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
39 cp include/SDL_config_wiz.h include/SDL_config.h
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
40
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
41 clean:
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
42 rm -f $(TARGET_STATIC) $(TARGET_SHARED)* $(OBJECTS)
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
43
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
44 install:
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
45 mkdir -p $(WIZSDK)/lib
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
46 mkdir -p $(WIZSDK)/include/SDL13
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
47 cp -f $(TARGET_STATIC) $(WIZSDK)/lib
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
48 cp -f $(TARGET_SHARED).0.0.1 $(WIZSDK)/lib
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
49 rm -f $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
50 ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0.0.1 $(WIZSDK)/lib/$(TARGET_SHARED).0
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
51 ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED)
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
52
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
53 cp $(TARGET_STATIC) ../../toolchain/libs
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
54 cp $(TARGET_SHARED).0.0.1 ../../toolchain/libs
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
55 rm -f ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
56 ln -s ../../toolchain/libs/$(TARGET_SHARED).0.0.1 ../../toolchain/libs/$(TARGET_SHARED).0
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
57 ln -s ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED)
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
58
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
59 cp $(TARGET_SHARED).0.0.1 ../nehe_demos/build/$(TARGET_SHARED).0
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
60 cp -f include/*.h $(WIZSDK)/include/SDL13/
ca5663493497 Scott to slouken
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
61 cp -f include/*.h ../../toolchain/include/SDL13/