summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Grabsch <vog@notjusthosting.com>2010-01-22 02:53:37 (GMT)
committerVolker Grabsch <vog@notjusthosting.com>2010-01-22 02:53:37 (GMT)
commit045a091b196bd5457ddb78a5bdf33606bd662608 (patch)
treeb01a470959a73100377d66681119e458577c7f4d
parentc92062f14bc494cacb664086bd34f43023258993 (diff)
downloadmxe-045a091b196bd5457ddb78a5bdf33606bd662608.zip
mxe-045a091b196bd5457ddb78a5bdf33606bd662608.tar.gz
mxe-045a091b196bd5457ddb78a5bdf33606bd662608.tar.bz2
test program for package sdl
-rw-r--r--Makefile2
-rw-r--r--src/sdl-test.c19
-rw-r--r--src/sdl.mk5
3 files changed, 25 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 5f6864b..edbf3df 100644
--- a/Makefile
+++ b/Makefile
@@ -140,7 +140,7 @@ build-only-$(1):
cd '$(2)/$($(1)_SUBDIR)'
$(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/$(1)-*.patch)),
(cd '$(2)/$($(1)_SUBDIR)' && patch -p1) < $(PKG_PATCH))
- $$(call $(1)_BUILD,$(2)/$($(1)_SUBDIR))
+ $$(call $(1)_BUILD,$(2)/$($(1)_SUBDIR),$(TOP_DIR)/src/$(1)-test)
rm -rfv '$(2)'
,)
[ -d '$(PREFIX)/installed' ] || mkdir -p '$(PREFIX)/installed'
diff --git a/src/sdl-test.c b/src/sdl-test.c
new file mode 100644
index 0000000..2e205e5
--- /dev/null
+++ b/src/sdl-test.c
@@ -0,0 +1,19 @@
+/* This file is part of mingw-cross-env. */
+/* See doc/index.html or doc/README for further information. */
+
+#include <SDL.h>
+
+int main(int argc, char* argv[])
+{
+ SDL_Surface *screen;
+
+ (void)argc;
+ (void)argv;
+
+ if (SDL_Init(SDL_INIT_EVERYTHING) < 0) return 1;
+
+ screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE);
+
+ SDL_Quit();
+ return 0;
+}
diff --git a/src/sdl.mk b/src/sdl.mk
index a56304a..7c38ee3 100644
--- a/src/sdl.mk
+++ b/src/sdl.mk
@@ -28,4 +28,9 @@ define $(PKG)_BUILD
--prefix='$(PREFIX)/$(TARGET)'
$(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+
+ '$(TARGET)-gcc' \
+ -W -Wall -Werror -ansi -pedantic \
+ `'$(TARGET)-pkg-config' sdl --cflags --static --libs` \
+ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-sdl.exe'
endef