packages feed

IrrHaskell-0.2: Makefile

SampleGame = template

IrrlichtHomePath = ~/Desktop/irrlicht
HaskellHomePath = /usr/lib/ghc-6.12.1

USERCXXFLAGS = -O3 -ffast-math -Wno-deprecated -Wno-write-strings

CPPFLAGS = -I$(IrrlichtHomePath)/include -I$(HaskellHomePath)/include -I/usr/X11R6/include
CXXFLAGS = $(USERCXXFLAGS)

LDFLAGS += -L$(IrrlichtHomePath)/lib/Linux -lIrrlicht -lGreenCard
LDFLAGS += -lopengl32 -lm
LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32

SYSTEM=Linux

HASKLIB = -L$(HaskellHomePath) -lHSrts -L$(HaskellHomePath)/base-4.2.0.0 -lHSbase-4.2.0.0

TARGET = main

main: $(SampleGame) aux_files

$(SampleGame): $(SampleGame).hs irrlicht.hs irrlicht_interface_ffi.o irrlicht_interface.o IrrHaskell.hs
	rm -f $(SampleGame).o Irrlicht.o
	ghc --make $(SampleGame).hs -threaded -XViewPatterns -XNoMonomorphismRestriction -XTemplateHaskell -L$(IrrlichtHomePath)/lib/Linux -package greencard irrlicht.hs IrrHaskell.hs -lIrrlicht irrlicht_interface_ffi.o irrlicht_interface.o -lstdc++ -lXxf86vm -lXext -lglut -lGL -lX11 -lXcursor
	
irrlicht.hs irrlicht_interface_ffi.c irrlicht_interface_ffi.h: irrlicht_interface.hs irrlicht_interface.h
	greencard irrlicht_interface.hs -o irrlicht.hs -c irrlicht_interface_ffi.c
	
irrlicht_interface_ffi.o: irrlicht_interface_ffi.c irrlicht_interface_ffi.h
	$(CXX) -c -xc $(CPPFLAGS) $(CXXFLAGS) $< 

irrlicht_interface.o: irrlicht_interface.cpp irrlicht_interface.h
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< 

aux_files: Irrlicht.a

Irrlicht.a:
	cp $(IrrlichtHomePath)/lib/Linux/libIrrlicht.a libIrrlicht.a

.cpp.o:
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< 

.c.o:
	$(CXX) -c -xc $(CPPFLAGS) $(CXXFLAGS) $< 
	
clean:
	rm -f *.o *.hi 
	rm -f irrlicht_interface_ffi.*
	rm -f irrlicht.hs
	

.PHONY: main aux_files clean