diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..75fecbd --- /dev/null +++ b/Makefile @@ -0,0 +1,188 @@ +CC = gcc +CXX = g++ +LD = g++ +STRIP = strip + +INCLUDES = \ +-I ../Mesa-7.0.2/include \ +-I../mogltk/include \ +-I../Baltisot/include \ +-I../Baltisot/lib/zlib/include \ +-I../Baltisot/lib/lua/include -I../Baltisot/lib/lua/includes \ +-I ../tinyxml \ +-I /usr/include/mysql \ +-I /usr/include/FTGL -I /usr/include/freetype2 \ +-I /usr/include/oracle/11.1.0.1/client/ + +HAVES = -DHAVE_VSSCANF -DHAVE_LIBJPEG -DHAVE_FCNTL -DHAVE_MYSQL -DHAVE_UNISTD_H -DHAVE_FORK -DHAVE_PIPE -DHAVE_FSYNC -DHAVE_MALLOC_H -DHAVE_ASPRINTF -DHAVE_BYTESWAP_H + +CPPFLAGS += $(INCLUDES) -O4 -fexceptions -DSTDC_HEADERS -DREADLINE_STATIC -DHOOK_STDS -DWORDS_LITTLEENDIAN -march=i686 $(HAVES) + +LDFLAGS += -O4 -fexceptions -shared -fPIC -L/usr/lib/oracle/11.1.0.1/client/lib + +vpath %.c ../Baltisot/lib:../Baltisot/src:../Baltisot/lib/zlib/src:../Baltisot/lib/lua/src:../Baltisot/lib/lua/src/LuaLib:src:../paperIdol/src:../mogltk/lib:../tinyxml +vpath %.cc ../Baltisot/lib:../Baltisot/src:../Baltisot/lib/zlib/src:../Baltisot/lib/lua/src:../Baltisot/lib/lua/src/LuaLib:src:../paperIdol/src:../mogltk/lib:../tinyxml +vpath %.cpp ../Baltisot/lib:../Baltisot/src:../Baltisot/lib/zlib/src:../Baltisot/lib/lua/src:../Baltisot/lib/lua/src/LuaLib:src:../paperIdol/src:../mogltk/lib:../tinyxml +vpath %.lua ../Baltisot/lib:../Baltisot/src + +CONFIGFILES_SOURCES = \ +plugin-luaconfigfiles.cc \ +LuaConfigFile.cc \ + +CONFIGFILES_LIBS = + +XML_SOURCES = \ +plugin-luaxml.cc \ +tinystr.cpp \ +tinyxml.cpp \ +tinyxmlerror.cpp \ +tinyxmlparser.cpp \ +LuaXML.cc \ + +XML_LIBS = + +OCCI_SOURCES = \ +plugin-luaocci.cc \ +LuaOCCI.cc \ + +OCCI_LIBS = -locci -lclntsh + +HANDLE_SOURCES = \ +plugin-luahandle.cc \ + +HANDLE_LIBS = + +HTTP_SOURCES = \ +plugin-luahttp.cc \ +LuaHttp.cc \ + +HTTP_LIBS = + +REGEX_SOURCES = \ +plugin-luaregex.cc \ +LuaRegex.cc \ + +REGEX_LIBS = + +TASK_SOURCES = \ +plugin-luatask.cc \ + +TASK_LIBS = + +SQL_SOURCES = \ +plugin-luasql.cc \ +SQL.cc \ +LuaSQL.cc \ + +SQL_LIBS = /usr/lib/libmysqlclient.a + +LUALIBS_SOURCES = \ +plugin-lualibs.cc \ +loadlualibs.cc \ + +LUA_LIB = \ +supportlib.lua \ +tasklib.lua \ +ajaxlib.lua \ +htmllib.lua \ +xmllib.lua \ + +GL_SOURCES = \ +plugin-luagl.cc \ +LuaGL.cc \ + +GL_LIBS = ../Mesa-7.0.2/lib/libGLU.a ../Mesa-7.0.2/lib/libOSMesa.a + +FTGL_SOURCES = \ +plugin-luaftgl.cc \ +LuaFTGL.cc \ + +FTGL_LIBS = -lfreetype -lftgl + +WHOLE_SOURCES = \ +$(CONFIGFILES_SOURCES) \ +$(XML_SOURCES) \ +$(OCCI_SOURCES) \ +$(HANDLE_SOURCES) \ +$(HTTP_SOURCES) \ +$(REGEX_SOURCES) \ +$(TASK_SOURCES) \ +$(SQL_SOURCES) \ +$(LUALIBS_SOURCES) \ +$(GL_SOURCES) \ +$(FTGL_SOURCES) \ + +MODULES_LIST = \ +luaconfigfiles.so \ +luaxml.so \ +luaocci.so \ +luahandle.so \ +luahttp.so \ +luaregex.so \ +luatask.so \ +luasql.so \ +luagl.so \ +luaftgl.so \ +lualibs.so \ + +ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES) $(LUA_LIB)))) +ALL_DEPS = $(addsuffix .dep, $(notdir $(basename $(WHOLE_SOURCES)))) + +all: dep modules + +modules: $(MODULES_LIST) + +dep: $(ALL_DEPS) + +luaconfigfiles.so: $(addsuffix .o, $(notdir $(basename $(CONFIGFILES_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(CONFIGFILES_LIBS) + +luaxml.so: $(addsuffix .o, $(notdir $(basename $(XML_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(XML_LIBS) + +luaocci.so: $(addsuffix .o, $(notdir $(basename $(OCCI_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(OCCI_LIBS) + +luahandle.so: $(addsuffix .o, $(notdir $(basename $(HANDLE_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(HANDLE_LIBS) + +luahttp.so: $(addsuffix .o, $(notdir $(basename $(HTTP_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(HTTP_LIBS) + +luaregex.so: $(addsuffix .o, $(notdir $(basename $(REGEX_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(REGEX_LIBS) + +luatask.so: $(addsuffix .o, $(notdir $(basename $(TASK_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(TASK_LIBS) + +luasql.so: $(addsuffix .o, $(notdir $(basename $(SQL_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(SQL_LIBS) + +luagl.so: $(addsuffix .o, $(notdir $(basename $(GL_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(GL_LIBS) + +luaftgl.so: $(addsuffix .o, $(notdir $(basename $(FTGL_SOURCES)))) + $(LD) $(LDFLAGS) -o $@ $+ $(FTGL_LIBS) + +lualibs.so: $(addsuffix .o, $(notdir $(basename $(LUALIBS_SOURCES) $(LUA_LIB)))) + $(LD) $(LDFLAGS) -o $@ $+ $(LUALIBS_LIBS) + +clean: + rm -f *.o *.dep *.so + +%.dep : %.c + $(CC) $(CPPFLAGS) -M -MF $@ $< + +%.dep : %.cpp + $(CXX) $(CPPFLAGS) -M -MF $@ $< + +%.dep : %.cc + $(CXX) $(CPPFLAGS) -M -MF $@ $< + +%.c : %.clua + bin2c $< $@ $(basename $@) + +%.clua : %.lua + ./luac -o $@ $< + +-include $(ALL_DEPS) |