From: <tch...@us...> - 2009-04-03 14:08:32
|
Revision: 189 http://lambdaroguelike.svn.sourceforge.net/lambdaroguelike/?rev=189&view=rev Author: tchakkazulu Date: 2009-04-03 14:08:21 +0000 (Fri, 03 Apr 2009) Log Message: ----------- Added "curses" target to the Makefile. This will make it easier to test if the curses import works (and saves a *lot* of time by not having to compile the whole game). Modified Paths: -------------- trunk/rogue/Makefile Added Paths: ----------- trunk/rogue/TestCurses.hs Modified: trunk/rogue/Makefile =================================================================== --- trunk/rogue/Makefile 2009-04-03 12:47:45 UTC (rev 188) +++ trunk/rogue/Makefile 2009-04-03 14:08:21 UTC (rev 189) @@ -6,16 +6,22 @@ MAIN=rogue HSFFI=`ghc --print-libdir`/include/ SPECIAL= +TEST=test all: $(MAIN) +curses: Curses/Bindings.hs + @if [ ! -d $(BUILDDIR) ]; then mkdir $(BUILDDIR); fi + $(HC) $(HFLAGS) --make TestCurses.hs -odir $(BUILDDIR) -hidir $(BUILDDIR) -o $(TEST) $(HLIBS) $(SPECIAL) + $(MAIN): Curses/Bindings.hs @if [ ! -d $(BUILDDIR) ]; then mkdir $(BUILDDIR); fi $(HC) $(HFLAGS) --make Main.hs -odir $(BUILDDIR) -hidir $(BUILDDIR) -o $(MAIN) $(HLIBS) $(SPECIAL) -Curses/Bindings.hs: Curses/Bindings.hsc +Curses/Bindings.hs: Curses/Bindings.hsc Curses/curses_wrapper.o + @gcc -D_XOPEN_SOURCE_EXTENDED -lncursesw Curses/curses_wrapper.c -c @if [ -f Curses/Bindings.hs ]; then chmod u+w Curses/Bindings.hs; fi @echo "Resurrecting ncurses interface from some other dimension." @hsc2hs -o Curses/Bindings.hs Curses/Bindings.hsc -D _XOPEN_SOURCE_EXTENDED -L -lncursesw > /dev/null -I $(HSFFI) @@ -34,7 +40,7 @@ @echo "Cleaning up the blood (succes is reached!)" clean: - @-rm -f $(MAIN) Curses/Bindings.hs + @-rm -f $(MAIN) $(TEST) Curses/Bindings.hs @-rm -rf $(BUILDDIR) $(DOCDIR) @-rm .rogue @./clean_goat_blood @@ -43,4 +49,4 @@ @./sacrifice_goat # $(MAIN) is marked phony because ghc --make does the checking. -.PHONY: $(MAIN) docs clean +.PHONY: $(MAIN) curses docs clean Added: trunk/rogue/TestCurses.hs =================================================================== --- trunk/rogue/TestCurses.hs (rev 0) +++ trunk/rogue/TestCurses.hs 2009-04-03 14:08:21 UTC (rev 189) @@ -0,0 +1,9 @@ +module Main where + +import Curses +import Control.Exception + +main :: IO () +main = withCurses "Testing Curses bindings." $ return () + +withCurses str = bracket_ (init_curses >> raw_mode) (cooked_mode >> exit_curses >> putStrLn str ) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |