2013-03-28 00:18:29 -04:00
|
|
|
#
|
2014-02-11 01:18:39 -05:00
|
|
|
# Copyright 2011-2014 Branimir Karadzic. All rights reserved.
|
2013-03-28 00:18:29 -04:00
|
|
|
# License: http://www.opensource.org/licenses/BSD-2-Clause
|
|
|
|
#
|
|
|
|
|
2014-03-03 00:27:22 -05:00
|
|
|
UNAME := $(shell uname)
|
|
|
|
ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin))
|
|
|
|
ifeq ($(UNAME),$(filter $(UNAME),Darwin))
|
|
|
|
OS=darwin
|
|
|
|
else
|
|
|
|
OS=linux
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
OS=windows
|
|
|
|
endif
|
|
|
|
|
2014-09-11 00:51:03 -04:00
|
|
|
GENIE=../bx/tools/bin/$(OS)/genie
|
2014-03-03 00:27:22 -05:00
|
|
|
|
2013-03-28 00:18:29 -04:00
|
|
|
all:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --with-tools --with-shared-lib vs2008
|
|
|
|
$(GENIE) --with-tools --with-shared-lib vs2010
|
|
|
|
$(GENIE) --with-tools --with-shared-lib vs2012
|
|
|
|
$(GENIE) --with-tools --with-shared-lib vs2013
|
|
|
|
$(GENIE) --with-tools --with-shared-lib --gcc=mingw gmake
|
|
|
|
$(GENIE) --with-tools --with-shared-lib --gcc=linux-gcc gmake
|
|
|
|
$(GENIE) --with-tools --with-shared-lib --gcc=osx gmake
|
|
|
|
$(GENIE) --with-tools --with-shared-lib xcode4
|
2014-05-04 18:43:14 -04:00
|
|
|
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=android-arm gmake
|
|
|
|
$(GENIE) --gcc=android-mips gmake
|
|
|
|
$(GENIE) --gcc=android-x86 gmake
|
|
|
|
$(GENIE) --gcc=asmjs gmake
|
|
|
|
$(GENIE) --gcc=ios-arm gmake
|
|
|
|
$(GENIE) --gcc=ios-simulator gmake
|
|
|
|
$(GENIE) --gcc=nacl gmake
|
|
|
|
$(GENIE) --gcc=nacl-arm gmake
|
|
|
|
$(GENIE) --gcc=pnacl gmake
|
|
|
|
$(GENIE) --gcc=rpi gmake
|
2013-03-28 00:18:29 -04:00
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-android-arm:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=android-arm gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
android-arm-debug: .build/projects/gmake-android-arm
|
2013-04-16 02:10:32 -04:00
|
|
|
make -R -C .build/projects/gmake-android-arm config=debug
|
2013-11-22 22:14:50 -05:00
|
|
|
android-arm-release: .build/projects/gmake-android-arm
|
2013-04-16 02:10:32 -04:00
|
|
|
make -R -C .build/projects/gmake-android-arm config=release
|
|
|
|
android-arm: android-arm-debug android-arm-release
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-android-mips:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=android-mips gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
android-mips-debug: .build/projects/gmake-android-mips
|
2013-11-09 13:52:19 -05:00
|
|
|
make -R -C .build/projects/gmake-android-mips config=debug
|
2013-11-22 22:14:50 -05:00
|
|
|
android-mips-release: .build/projects/gmake-android-mips
|
2013-11-09 13:52:19 -05:00
|
|
|
make -R -C .build/projects/gmake-android-mips config=release
|
|
|
|
android-mips: android-mips-debug android-mips-release
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-android-x86:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=android-x86 gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
android-x86-debug: .build/projects/gmake-android-x86
|
2013-11-09 13:52:19 -05:00
|
|
|
make -R -C .build/projects/gmake-android-x86 config=debug
|
2013-11-22 22:14:50 -05:00
|
|
|
android-x86-release: .build/projects/gmake-android-x86
|
2013-11-09 13:52:19 -05:00
|
|
|
make -R -C .build/projects/gmake-android-x86 config=release
|
|
|
|
android-x86: android-x86-debug android-x86-release
|
|
|
|
|
2014-03-16 23:10:25 -04:00
|
|
|
.build/projects/gmake-asmjs:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=asmjs gmake
|
2014-03-16 23:10:25 -04:00
|
|
|
asmjs-debug: .build/projects/gmake-asmjs
|
|
|
|
make -R -C .build/projects/gmake-asmjs config=debug
|
|
|
|
asmjs-release: .build/projects/gmake-asmjs
|
|
|
|
make -R -C .build/projects/gmake-asmjs config=release
|
|
|
|
asmjs: asmjs-debug asmjs-release
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-linux:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --with-tools --with-shared-lib --gcc=linux-gcc gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
linux-debug32: .build/projects/gmake-linux
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-linux config=debug32
|
2013-11-22 22:14:50 -05:00
|
|
|
linux-release32: .build/projects/gmake-linux
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-linux config=release32
|
2013-11-22 22:14:50 -05:00
|
|
|
linux-debug64: .build/projects/gmake-linux
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-linux config=debug64
|
2013-11-22 22:14:50 -05:00
|
|
|
linux-release64: .build/projects/gmake-linux
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-linux config=release64
|
|
|
|
linux: linux-debug32 linux-release32 linux-debug64 linux-release64
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-mingw:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --with-tools --with-shared-lib --gcc=mingw gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
mingw-debug32: .build/projects/gmake-mingw
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-mingw config=debug32
|
2013-11-22 22:14:50 -05:00
|
|
|
mingw-release32: .build/projects/gmake-mingw
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-mingw config=release32
|
2013-11-22 22:14:50 -05:00
|
|
|
mingw-debug64: .build/projects/gmake-mingw
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-mingw config=debug64
|
2013-11-22 22:14:50 -05:00
|
|
|
mingw-release64: .build/projects/gmake-mingw
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-mingw config=release64
|
|
|
|
mingw: mingw-debug32 mingw-release32 mingw-debug64 mingw-release64
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/vs2008:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --with-tools --with-shared-lib vs2008
|
2013-03-28 00:18:29 -04:00
|
|
|
vs2008-debug32:
|
|
|
|
devenv .build/projects/vs2008/bgfx.sln /Build "Debug|Win32"
|
|
|
|
vs2008-release32:
|
|
|
|
devenv .build/projects/vs2008/bgfx.sln /Build "Release|Win32"
|
|
|
|
vs2008-debug64:
|
|
|
|
devenv .build/projects/vs2008/bgfx.sln /Build "Debug|x64"
|
|
|
|
vs2008-release64:
|
|
|
|
devenv .build/projects/vs2008/bgfx.sln /Build "Release|x64"
|
|
|
|
vs2008: vs2008-debug32 vs2008-release32 vs2008-debug64 vs2008-release64
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/vs2010:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --with-tools --with-shared-lib vs2010
|
2013-11-22 22:14:50 -05:00
|
|
|
|
2013-11-26 12:56:03 -05:00
|
|
|
.build/projects/vs2012:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --with-tools --with-shared-lib vs2012
|
2013-11-26 12:56:03 -05:00
|
|
|
|
2014-09-08 23:32:31 -04:00
|
|
|
.build/projects/vs2013:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --with-tools --with-shared-lib vs2013
|
2014-09-08 23:32:31 -04:00
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-nacl:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=nacl gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
nacl-debug32: .build/projects/gmake-nacl
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-nacl config=debug32
|
2013-11-22 22:14:50 -05:00
|
|
|
nacl-release32: .build/projects/gmake-nacl
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-nacl config=release32
|
2013-11-22 22:14:50 -05:00
|
|
|
nacl-debug64: .build/projects/gmake-nacl
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-nacl config=debug64
|
2013-11-22 22:14:50 -05:00
|
|
|
nacl-release64: .build/projects/gmake-nacl
|
2013-03-28 00:18:29 -04:00
|
|
|
make -R -C .build/projects/gmake-nacl config=release64
|
|
|
|
nacl: nacl-debug32 nacl-release32 nacl-debug64 nacl-release64
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-nacl-arm:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=nacl-arm gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
nacl-arm-debug: .build/projects/gmake-nacl-arm
|
2013-04-13 03:26:41 -04:00
|
|
|
make -R -C .build/projects/gmake-nacl-arm config=debug
|
2013-11-22 22:14:50 -05:00
|
|
|
nacl-arm-release: .build/projects/gmake-nacl-arm
|
2013-04-13 03:26:41 -04:00
|
|
|
make -R -C .build/projects/gmake-nacl-arm config=release
|
2013-03-28 00:18:29 -04:00
|
|
|
nacl-arm: nacl-arm-debug32 nacl-arm-release32
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-pnacl:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=pnacl gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
pnacl-debug: .build/projects/gmake-pnacl
|
2013-04-13 03:26:41 -04:00
|
|
|
make -R -C .build/projects/gmake-pnacl config=debug
|
2013-11-22 22:14:50 -05:00
|
|
|
pnacl-release: .build/projects/gmake-pnacl
|
2013-04-13 03:26:41 -04:00
|
|
|
make -R -C .build/projects/gmake-pnacl config=release
|
2013-03-28 00:18:29 -04:00
|
|
|
pnacl: pnacl-debug pnacl-release
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-osx:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --with-tools --with-shared-lib --gcc=osx gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
osx-debug32: .build/projects/gmake-osx
|
2013-03-28 00:18:29 -04:00
|
|
|
make -C .build/projects/gmake-osx config=debug32
|
2013-11-22 22:14:50 -05:00
|
|
|
osx-release32: .build/projects/gmake-osx
|
2013-03-28 00:18:29 -04:00
|
|
|
make -C .build/projects/gmake-osx config=release32
|
2013-11-22 22:14:50 -05:00
|
|
|
osx-debug64: .build/projects/gmake-osx
|
2013-03-28 00:18:29 -04:00
|
|
|
make -C .build/projects/gmake-osx config=debug64
|
2013-11-22 22:14:50 -05:00
|
|
|
osx-release64: .build/projects/gmake-osx
|
2013-03-28 00:18:29 -04:00
|
|
|
make -C .build/projects/gmake-osx config=release64
|
|
|
|
osx: osx-debug32 osx-release32 osx-debug64 osx-release64
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-ios-arm:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=ios-arm gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
ios-arm-debug: .build/projects/gmake-ios-arm
|
2013-07-21 17:44:53 -04:00
|
|
|
make -R -C .build/projects/gmake-ios-arm config=debug
|
2013-11-22 22:14:50 -05:00
|
|
|
ios-arm-release: .build/projects/gmake-ios-arm
|
2013-07-21 17:44:53 -04:00
|
|
|
make -R -C .build/projects/gmake-ios-arm config=release
|
|
|
|
ios-arm: ios-arm-debug ios-arm-release
|
|
|
|
|
2013-11-22 22:14:50 -05:00
|
|
|
.build/projects/gmake-ios-simulator:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=ios-simulator gmake
|
2013-11-22 22:14:50 -05:00
|
|
|
ios-simulator-debug: .build/projects/gmake-ios-simulator
|
2013-07-21 17:44:53 -04:00
|
|
|
make -R -C .build/projects/gmake-ios-simulator config=debug
|
2013-11-22 22:14:50 -05:00
|
|
|
ios-simulator-release: .build/projects/gmake-ios-simulator
|
2013-07-21 17:44:53 -04:00
|
|
|
make -R -C .build/projects/gmake-ios-simulator config=release
|
|
|
|
ios-simulator: ios-simulator-debug ios-simulator-release
|
2013-07-14 16:14:48 -04:00
|
|
|
|
2014-08-24 20:41:41 -04:00
|
|
|
.build/projects/gmake-rpi:
|
2014-09-11 00:40:40 -04:00
|
|
|
$(GENIE) --gcc=rpi gmake
|
2014-08-24 20:41:41 -04:00
|
|
|
rpi-debug: .build/projects/gmake-rpi
|
|
|
|
make -R -C .build/projects/gmake-rpi config=debug
|
|
|
|
rpi-release: .build/projects/gmake-rpi
|
|
|
|
make -R -C .build/projects/gmake-rpi config=release
|
|
|
|
rpi: rpi-debug rpi-release
|
|
|
|
|
2013-03-28 00:18:29 -04:00
|
|
|
rebuild-shaders:
|
2013-04-13 03:26:41 -04:00
|
|
|
make -R -C examples rebuild
|
2013-03-28 00:18:29 -04:00
|
|
|
|
2013-08-11 22:01:17 -04:00
|
|
|
analyze:
|
|
|
|
cppcheck src/
|
|
|
|
cppcheck examples/
|
|
|
|
|
2013-03-28 00:18:29 -04:00
|
|
|
docs:
|
2014-09-11 00:40:40 -04:00
|
|
|
doxygen genie/bgfx.doxygen
|
2013-03-28 00:18:29 -04:00
|
|
|
markdown README.md > .build/docs/readme.html
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo Cleaning...
|
2013-10-18 11:29:11 -04:00
|
|
|
-@rm -rf .build
|
2014-02-09 21:59:49 -05:00
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
SILENT ?= @
|
|
|
|
|
|
|
|
UNAME := $(shell uname)
|
|
|
|
ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin))
|
|
|
|
ifeq ($(UNAME),$(filter $(UNAME),Darwin))
|
|
|
|
OS=darwin
|
|
|
|
BUILD_PROJECT_DIR=gmake-osx
|
2014-02-09 22:05:33 -05:00
|
|
|
BUILD_OUTPUT_DIR=osx64_gcc
|
|
|
|
BUILD_TOOLS_CONFIG=release64
|
2014-02-09 21:59:49 -05:00
|
|
|
EXE=
|
|
|
|
else
|
|
|
|
OS=linux
|
|
|
|
BUILD_PROJECT_DIR=gmake-linux
|
2014-02-09 22:05:33 -05:00
|
|
|
BUILD_OUTPUT_DIR=linux64_gcc
|
|
|
|
BUILD_TOOLS_CONFIG=release64
|
2014-02-09 21:59:49 -05:00
|
|
|
EXE=
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
OS=windows
|
|
|
|
BUILD_PROJECT_DIR=gmake-mingw
|
|
|
|
BUILD_OUTPUT_DIR=win32_mingw
|
|
|
|
BUILD_TOOLS_CONFIG=release32
|
|
|
|
EXE=.exe
|
|
|
|
endif
|
|
|
|
|
|
|
|
.build/$(BUILD_OUTPUT_DIR)/bin/shadercRelease$(EXE): .build/projects/$(BUILD_PROJECT_DIR)
|
|
|
|
$(SILENT) make -C .build/projects/$(BUILD_PROJECT_DIR) -f shaderc.make config=$(BUILD_TOOLS_CONFIG)
|
|
|
|
|
|
|
|
tools/bin/$(OS)/shaderc$(EXE): .build/$(BUILD_OUTPUT_DIR)/bin/shadercRelease$(EXE)
|
|
|
|
$(SILENT) cp $(<) $(@)
|
|
|
|
|
|
|
|
.build/$(BUILD_OUTPUT_DIR)/bin/geometrycRelease$(EXE): .build/projects/$(BUILD_PROJECT_DIR)
|
|
|
|
$(SILENT) make -C .build/projects/$(BUILD_PROJECT_DIR) -f geometryc.make config=$(BUILD_TOOLS_CONFIG)
|
|
|
|
|
|
|
|
tools/bin/$(OS)/geometryc$(EXE): .build/$(BUILD_OUTPUT_DIR)/bin/geometrycRelease$(EXE)
|
|
|
|
$(SILENT) cp $(<) $(@)
|
|
|
|
|
|
|
|
tools: tools/bin/$(OS)/shaderc$(EXE) tools/bin/$(OS)/geometryc$(EXE)
|