include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/Makefile.def QT=$(QTBASEDIR)/$(QTVER)/$(QT_ARCH) LUA_ENGINE?=luau export LUA_ENGINE ifeq ($(LUA_ENGINE),luau) LUAC=$(BUILDTOOLS)/luauc --compile=binary $(1) >$(2) LUA_INCLUDE=luau/VM/include LUA_INCLUDE_CORE=luau/VM/src else LUAC=$(BUILDTOOLS)/luac -o $(2) $(1) LUA_INCLUDE=lua/src LUA_INCLUDE_CORE=lua/src endif export LUA_INCLUDE export LUA_INCLUDE_CORE #Used in plugin bundle recipes CURRENT_GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) #DEFS PLUGINS_DEFAULT=bitop lsqlite3 luasocket lfs json iad gamekit storekit liquidfun reactphysics3d fastnoise PLUGINS_ALL=lsqlite3 luasocket lpeg lfs json microphone gmedia bump ogg liquidfun gsfxr spine harfbuzz reactphysics3d fastnoise imgui ifneq ($(LUA_ENGINE),luau) PLUGINS_ALL+=bitop endif PLUGINS_WIN=$(PLUGINS_ALL) clipper struct controller camera PLUGINS_WINONLY=spout steam luamidi PLUGINS_MACONLY=steam luamidi PLUGINS_WIN32=lsqlite3 luasocket lfs json lpeg microphone clipper struct controller bump ogg liquidfun gsfxr spine luamidi harfbuzz reactphysics3d fastnoise imgui PLUGINS_ANDROID=$(PLUGINS_ALL) ads clipper controller countly flurry gaming giftiz googlebilling \ googlelicensing googleplay iab native notification storedetector \ struct camera tts megacool map share storereview PLUGINS_HTML5=controller luasocket json ads Facebook lsqlite3 lfs bump ogg liquidfun gsfxr spine harfbuzz reactphysics3d fastnoise imgui ifneq ($(LUA_ENGINE),luau) PLUGINS_WIN+=threads PLUGINS_ANDROID+=threads PLUGINS_WIN32+=bitop threads PLUGINS_HTML5+=bitop endif #Precompiled plugins only below PLUGINS_IOS=luasocket camera ogg liquidfun gsfxr microphone spine harfbuzz reactphysics3d imgui PLUGINS_ATV=luasocket ogg liquidfun gsfxr microphone spine harfbuzz reactphysics3d imgui PLUGINS_MAC=luasocket ogg liquidfun gsfxr microphone spine harfbuzz reactphysics3d imgui PLUGINS_WINRT=luasocket ogg liquidfun gsfxr harfbuzz reactphysics3d imgui ADDONS=GSFXREditor Player TAME ROOT=. SDK=$(ROOT)/Sdk GIDEROS_VERSION:=$(shell grep GIDEROS_VERSION $(ROOT)/libgideros/gideros.h | grep define | sed 's/^[^"]*"\([^"]*\)"/\1/') #TOOLS TARGET_PLF=qtapp BUILDTOOLS=$(ROOT)/Build.Tools ifeq ($(OS),Windows_NT) PATH:=$(QT)/bin:$(QTBASEDIR)/Tools/$(QT_TOOLSARCH)/bin:$(PATH): QMAKE=qmake CC=$(QTBASEDIR)/Tools/$(QT_TOOLSARCH)/bin/gcc CXX=$(QTBASEDIR)/Tools/$(QT_TOOLSARCH)/bin/g++ RELEASE=$(ROOT)/Build.Win TARGET_PLF+=android winrt html5 win32 else QMAKE=$(QT)/bin/qmake UNAME_S := $(shell uname -s) CC=gcc CXX=g++ # looking for a fix plugin's symbol lookup error CXXFLAGS= -std=c++17 LOCAL_CFLAGS += -O2 -DLUA_USE_MKSTEMP -std=c++17 QMAKE_CXX += $${CROSS_COMPILE}g++-posix QMAKE_CXXFLAGS += -c++17 ifeq ($(UNAME_S),Linux) RELEASE=$(ROOT)/Build.Linux else RELEASE=$(ROOT)/Build.Mac TARGET_PLF+=ios endif endif all: versioning qscintilla qlexilla $(addsuffix .install,$(TARGET_PLF) $(TARGET_EXT)) clean: $(addsuffix .clean,$(TARGET_PLF) $(TARGET_EXT)) rm -rf $(RELEASE) versioning: tools A=`git rev-parse HEAD`; if grep -Fq $$A $(ROOT)/libgideros/gid*.h; then echo "VERSION OK"; else echo "#define GIDEROS_GIT_HASH \"$$A\"" >$(ROOT)/libgideros/gideros_build.h; fi $(call LUAC,$(addprefix luabinding/,property.lua texturepack.lua compatibility.lua),luabinding/luabindings.luac) $(BUILDTOOLS)/bin2c luabinding/luabindings.luac >luabinding/luabindings.luac.c #SDK includes vpath %.h libgideros:libgvfs:libgid/include:$(LUA_INCLUDE):libgid/external/openal-soft-1.13/include/AL vpath %.hpp libgideros:libgvfs:libgid/include:$(LUA_INCLUDE):libgid/external/openal-soft-1.13/include/AL $(SDK)/include/%: % cp $^ $(SDK)/include $(SDK)/include/AL/%: % cp $^ $(SDK)/include/AL SDK_INCS=$(addsuffix .h,gideros gplugin gproxy greferenced gexport) \ $(addsuffix .h,gfile gpath gstdio) \ $(addsuffix .h,gglobal glog gapplication gevent) \ $(addsuffix .h,lua luaconf lualib lauxlib) lua.hpp \ $(addprefix AL/,$(addsuffix .h,al alc alext efx efx-creative)) sdk.headers.dir: mkdir -p $(SDK)/include/AL sdk.headers: sdk.headers.dir $(addprefix $(SDK)/include/,$(SDK_INCS)) mkdir -p $(SDK)/include/gideros cp 2dsg/*.h 2dsg/gfxbackends/*.h luabinding/*.h libgid/include/*.h $(SDK)/include/gideros cp libgideros/*.h emscripten/cJSON.h $(SDK)/include/gideros %.plugin.install: @mkdir -p $(RELEASE)/All\ Plugins/$(notdir $*) @for f in $(ROOT)/plugins/$*/*.gplugin; do if [ -f "$$f" ]; then cp $$f $(RELEASE)/All\ Plugins/$(notdir $*); fi; done prep.repo: if [ ! -d $(ROOT)/plugins/spine/spine-runtimes/spine-c ]; then \ git submodule add https://github.com/gideros/spine-runtimes.git plugins/spine/spine-runtimes; \ git reset HEAD .gitmodules; \ git reset HEAD plugins/spine/spine-runtimes; \ fi if [ ! -d $(ROOT)/plugins/harfbuzz/harfbuzz ]; then \ git submodule add https://github.com/gideros/harfbuzz.git plugins/harfbuzz/harfbuzz; \ git reset HEAD .gitmodules; \ git reset HEAD plugins/harfbuzz/harfbuzz; \ fi if [ ! -d $(ROOT)/plugins/reactphysics3d/reactphysics3d ]; then \ git submodule add https://github.com/gideros/reactphysics3d.git plugins/reactphysics3d/reactphysics3d; \ git reset HEAD .gitmodules; \ git reset HEAD plugins/reactphysics3d/reactphysics3d; \ fi if [ ! -d $(ROOT)/luau ]; then \ git submodule add https://github.com/gideros/luau.git luau; \ git reset HEAD .gitmodules; \ git reset HEAD luau; \ fi if [ ! -d $(ROOT)/scintilla ]; then \ git submodule add https://github.com/gideros/scintilla.git scintilla; \ git reset HEAD .gitmodules; \ git reset HEAD scintilla; \ fi if [ ! -d $(ROOT)/lexilla ]; then \ git submodule add https://github.com/gideros/lexilla.git lexilla; \ git reset HEAD .gitmodules; \ git reset HEAD lexilla; \ fi git submodule update --recursive include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidGeneric.mk ifeq ($(OS),Windows_NT) MINGWMAKE=$(MAKE) include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidQtWin.mk include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidWin32.mk include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidAndroid.mk include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidWinRT.mk include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidPkg.mk else ifeq ($(UNAME_S),Linux) include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidQtLinux.mk else include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidQtMac.mk include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidiOS.mk #include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidMac.mk endif endif include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/GidHtml5.mk