# Makefile lua/samples
# $Id: Makefile 1966 2011-08-16 08:57:00Z satofumi $

# Compile options
CC = $(CXX)
#CXXFLAGS = -g -O0 -Wall -W -Werror $(INCLUDES)
CXXFLAGS = -g -O0 -Wall -W $(INCLUDES)
INCLUDES = -I/usr/include/lua5.1 -I.. -I../../system
LDFLAGS =
#LDLIBS = -llua5.1 -ldl -lluabind -lSDL
LDLIBS = -llua -lluabind -lSDL


# Target
TARGET = \
	dofile \
	dostring \
	callFunction \
	registerSingleton \
	bindCpp \
	partial \
#	toluaSystemSample \

all : $(TARGET)

clean :
	$(RM) *.o $(TARGET) error_log.txt save_data.lua save_data.lc

depend :
	makedepend -Y -- $(INCLUDES) -- $(wildcard *.h *.cpp)

.PHONY : all clean depend
######################################################################
REQUIRE_LIBS = ../lua.a ../lua_luabind.a ../../system/system.a ../../system/sdl/system_sdl.a

$(REQUIRE_LIBS) :
	cd $(@D)/ && $(MAKE) $(@F)

registerSingleton bindCpp partial toluaSystemSample : $(REQUIRE_LIBS)

# DO NOT DELETE

bindCpp.o: ../luabindSystem.h ../luabindInit.h ../LuaHandler.h
partial.o: ../LuaHandler.h ../luabindInit.h
registerSingleton.o: SingletonClass.h ../LuaHandler.h ../luabindInit.h
toluaSystemSample.o: ../LuaHandler.h
