Permalink
Browse files

Merge branch 'linux-lua' of https://github.com/dumganhar/cocos2d-x in…

…to lua-linux

Conflicts:
	scripting/lua/cocos2dx_support/LuaCocos2d.cpp
  • Loading branch information...
2 parents 03f8fad + 998cee7 commit 62c2b50be18e9e73a4cccda5d2d11c8ce4ee62c9 @dumganhar dumganhar committed Dec 10, 2012
@@ -92,6 +92,16 @@ make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux release
check_make_result
cp $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so $OUTPUT_RELEASE
+make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux clean
+make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux debug
+check_make_result
+cp $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so $OUTPUT_DEBUG
+
+make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux clean
+make -C $COCOS2DX20_TRUNK/scripting/lua/proj.linux release
+check_make_result
+cp $COCOS2DX20_TRUNK/scripting/lua/proj.linux/liblua.so $OUTPUT_RELEASE
+
make -C $COCOS2DX20_TRUNK/samples/TestCpp/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/TestCpp/proj.linux debug
check_make_result
@@ -105,3 +115,18 @@ check_make_result
make -C $COCOS2DX20_TRUNK/samples/HelloCpp/proj.linux clean
make -C $COCOS2DX20_TRUNK/samples/HelloCpp/proj.linux release
check_make_result
+
+make -C $COCOS2DX20_TRUNK/samples/TestLua/proj.linux clean
+make -C $COCOS2DX20_TRUNK/samples/TestLua/proj.linux debug
+check_make_result
+make -C $COCOS2DX20_TRUNK/samples/TestLua/proj.linux clean
+make -C $COCOS2DX20_TRUNK/samples/TestLua/proj.linux release
+check_make_result
+
+make -C $COCOS2DX20_TRUNK/samples/HelloLua/proj.linux clean
+make -C $COCOS2DX20_TRUNK/samples/HelloLua/proj.linux debug
+check_make_result
+make -C $COCOS2DX20_TRUNK/samples/HelloLua/proj.linux clean
+make -C $COCOS2DX20_TRUNK/samples/HelloLua/proj.linux release
+check_make_result
+
Oops, something went wrong.
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>HelloLua</name>
+ <comment></comment>
+ <projects>
+ <project>libcocos2d</project>
+ <project>libCocosDenshion</project>
+ <project>liblua</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>Classes</name>
+ <type>2</type>
+ <locationURI>PARENT-1-PROJECT_LOC/Classes</locationURI>
+ </link>
+ <link>
+ <name>cocos2dx_support</name>
+ <type>2</type>
+ <locationURI>PARENT-3-PROJECT_LOC/scripting/lua/cocos2dx_support</locationURI>
+ </link>
+ </linkedResources>
+</projectDescription>
@@ -0,0 +1,95 @@
+CC = gcc
+CXX = g++
+TARGET = HelloLua
+CCFLAGS = -Wall
+CXXFLAGS = -Wall
+VISIBILITY =
+
+COCOS2DX_PATH = ../../../cocos2dx
+INCLUDES = -I../ \
+ -I../Classes \
+ -I$(COCOS2DX_PATH) \
+ -I$(COCOS2DX_PATH)/platform/third_party/linux \
+ -I$(COCOS2DX_PATH)/platform/third_party/linux/libfreetype2 \
+ -I$(COCOS2DX_PATH)/cocoa \
+ -I$(COCOS2DX_PATH)/include \
+ -I$(COCOS2DX_PATH)/platform \
+ -I$(COCOS2DX_PATH)/platform/linux \
+ -I$(COCOS2DX_PATH)/platform/third_party/linux/glew-1.7.0/glew-1.7.0/include/ \
+ -I$(COCOS2DX_PATH)/kazmath/include \
+ -I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
+ -I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg \
+ -I../../../CocosDenshion/include \
+ -I../../../scripting/lua/lua \
+ -I../../../scripting/lua/tolua \
+ -I../../../scripting/lua/cocos2dx_support
+
+DEFINES = -DLINUX
+
+OBJECTS = ./main.o \
+ ../Classes/AppDelegate.o \
+ ../../../scripting/lua/cocos2dx_support/CCLuaEngine.o \
+ ../../../scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.o \
+ ../../../scripting/lua/cocos2dx_support/LuaCocos2d.o \
+ ../../../scripting/lua/cocos2dx_support/tolua_fix.o
+
+LBITS := $(shell getconf LONG_BIT)
+ifeq ($(LBITS),64)
+STATICLIBS_DIR = ../../../cocos2dx/platform/third_party/linux/libraries/lib64
+else
+STATICLIBS_DIR = ../../../cocos2dx/platform/third_party/linux/libraries
+endif
+
+STATICLIBS = $(STATICLIBS_DIR)/libfreetype.a \
+ $(STATICLIBS_DIR)/libxml2.a \
+ $(STATICLIBS_DIR)/libpng.a \
+ $(STATICLIBS_DIR)/libjpeg.a \
+ $(STATICLIBS_DIR)/libtiff.a \
+# $(STATICLIBS_DIR)/libGLEW.a \
+
+SHAREDLIBS += -lglfw -lcurl -llua
+SHAREDLIBS += -Wl,-rpath,../../../../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/lib
+SHAREDLIBS += -L../../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/lib -lGLEW
+SHAREDLIBS += -Wl,-rpath,../../../../../lib/linux/Debug
+
+ifeq ($(LBITS),64)
+SHAREDLIBS += -L../../../CocosDenshion/third_party/fmod/lib64/api/lib -lfmodex64 -Wl,-rpath,../../../../../CocosDenshion/third_party/fmod/lib64/api/lib
+else
+SHAREDLIBS += -L../../../CocosDenshion/third_party/fmod/api/lib -lfmodex -Wl,-rpath,../../../../../CocosDenshion/third_party/fmod/api/lib
+endif
+
+#$(shell ../../build-linux.sh $<)
+
+BIN_DIR_ROOT=bin
+BIN_DIR = $(BIN_DIR_ROOT)
+
+debug: BIN_DIR = $(BIN_DIR_ROOT)/debug
+debug: CCFLAGS += -g3 -O0
+debug: CXXFLAGS += -g3 -O0
+debug: SHAREDLIBS += -L../../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion
+debug: SHAREDLIBS += -Wl,-rpath,../../../../../lib/linux/Debug/
+debug: DEFINES += -DDEBUG
+debug: $(TARGET)
+
+release: BIN_DIR = $(BIN_DIR_ROOT)/release
+release: CCFLAGS += -O3
+release: CXXFLAGS += -O3
+release: SHAREDLIBS += -L../../../lib/linux/Release -lcocos2d -lrt -lz -lcocosdenshion
+release: SHAREDLIBS += -Wl,-rpath,../../../../../lib/linux/Release/
+release: DEFINES += -DNDEBUG
+release: $(TARGET)
+
+####### Build rules
+$(TARGET): $(OBJECTS)
+ mkdir -p $(BIN_DIR)
+ $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(OBJECTS) -o $(BIN_DIR)/$(TARGET) $(SHAREDLIBS) $(STATICLIBS)
+
+####### Compile
+%.o: %.cpp
+ $(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
+
+%.o: %.c
+ $(CC) $(CCFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@
+
+clean:
+ rm -f $(OBJECTS) $(TARGET) core
@@ -0,0 +1,34 @@
+#include "main.h"
+#include "../Classes/AppDelegate.h"
+#include "cocos2d.h"
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string>
+
+USING_NS_CC;
+
+// 500 is enough?
+#define MAXPATHLEN 500
+
+int main(int argc, char **argv)
+{
+ // get application path
+ int length;
+ char fullpath[MAXPATHLEN];
+ length = readlink("/proc/self/exe", fullpath, sizeof(fullpath));
+ fullpath[length] = '\0';
+
+ std::string resourcePath = fullpath;
+ resourcePath = resourcePath.substr(0, resourcePath.find_last_of("/"));
+ resourcePath += "/../../../Resources/";
+
+ // create the application instance
+ AppDelegate app;
+ CCApplication::sharedApplication()->setResourceRootPath(resourcePath.c_str());
+ CCEGLView* eglView = CCEGLView::sharedOpenGLView();
+ eglView->setFrameSize(960, 640);
+ return CCApplication::sharedApplication()->run();
+}
@@ -0,0 +1,7 @@
+#ifndef __MAIN_H__
+#define __MAIN_H__
+
+// C RunTime Header Files
+#include "CCStdC.h"
+
+#endif // __MAIN_H__
Oops, something went wrong.

0 comments on commit 62c2b50

Please sign in to comment.