bgfx/makefile

292 lines
10 KiB
Makefile
Raw Normal View History

#
2015-01-02 17:43:11 -05:00
# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
UNAME := $(shell uname)
2015-04-10 10:46:49 -04:00
ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin FreeBSD GNU/kFreeBSD))
ifeq ($(UNAME),$(filter $(UNAME),Darwin))
OS=darwin
else
2015-04-10 10:46:49 -04:00
ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD))
OS=bsd
else
OS=linux
endif
2015-04-10 10:46:49 -04:00
endif
else
OS=windows
endif
2015-04-10 17:40:47 -04:00
# $(info $(OS))
2015-04-10 10:46:49 -04:00
2016-01-09 23:30:15 -05:00
GENIE?=../bx/tools/bin/$(OS)/genie $(GENIE_FLAGS)
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
2015-04-11 12:45:11 -04:00
$(GENIE) --with-tools --with-shared-lib vs2015
2014-10-18 18:44:45 -04:00
$(GENIE) --with-tools --with-shared-lib --gcc=mingw-gcc gmake
2014-09-11 00:40:40 -04:00
$(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 --xcode=osx xcode4
$(GENIE) --with-tools --with-shared-lib --xcode=ios xcode4
2015-04-10 10:46:49 -04:00
$(GENIE) --with-shared-lib --gcc=freebsd gmake
2015-01-31 18:21:53 -05: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-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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-android-arm config=release
2013-04-16 02:10:32 -04:00
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
2015-04-10 10:46:49 -04: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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-android-mips config=release
2013-11-09 13:52:19 -05:00
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
2015-04-10 10:46:49 -04: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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-android-x86 config=release
2013-11-09 13:52:19 -05:00
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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-asmjs config=debug
2014-03-16 23:10:25 -04:00
asmjs-release: .build/projects/gmake-asmjs
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-asmjs config=release
2014-03-16 23:10:25 -04:00
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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-linux config=release64
linux: linux-debug32 linux-release32 linux-debug64 linux-release64
2015-04-10 10:46:49 -04:00
.build/projects/gmake-freebsd:
$(GENIE) --with-tools --with-shared-lib --gcc=freebsd gmake
freebsd-debug32: .build/projects/gmake-freebsd
$(MAKE) -R -C .build/projects/gmake-freebsd config=debug32
freebsd-release32: .build/projects/gmake-freebsd
$(MAKE) -R -C .build/projects/gmake-freebsd config=release32
freebsd-debug64: .build/projects/gmake-freebsd
$(MAKE) -R -C .build/projects/gmake-freebsd config=debug64
freebsd-release64: .build/projects/gmake-freebsd
$(MAKE) -R -C .build/projects/gmake-freebsd config=release64
freebsd: freebsd-debug32 freebsd-release32 freebsd-debug64 freebsd-release64
2014-10-18 18:44:45 -04:00
.build/projects/gmake-mingw-gcc:
2014-12-15 23:59:22 -05:00
$(GENIE) --with-tools --with-shared-lib --gcc=mingw-gcc gmake
2014-12-13 00:19:13 -05:00
mingw-gcc-debug32: .build/projects/gmake-mingw-gcc
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-mingw-gcc config=debug32
2014-12-13 00:19:13 -05:00
mingw-gcc-release32: .build/projects/gmake-mingw-gcc
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-mingw-gcc config=release32
2014-12-13 00:19:13 -05:00
mingw-gcc-debug64: .build/projects/gmake-mingw-gcc
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-mingw-gcc config=debug64
2014-12-13 00:19:13 -05:00
mingw-gcc-release64: .build/projects/gmake-mingw-gcc
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-mingw-gcc config=release64
2014-12-13 00:19:13 -05:00
mingw-gcc: mingw-gcc-debug32 mingw-gcc-release32 mingw-gcc-debug64 mingw-gcc-release64
.build/projects/gmake-mingw-clang:
2015-01-31 18:21:53 -05:00
$(GENIE) --gcc=mingw-clang gmake
2014-12-13 00:19:13 -05:00
mingw-clang-debug32: .build/projects/gmake-mingw-clang
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-mingw-clang config=debug32
2014-12-13 00:19:13 -05:00
mingw-clang-release32: .build/projects/gmake-mingw-clang
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-mingw-clang config=release32
2014-12-13 00:19:13 -05:00
mingw-clang-debug64: .build/projects/gmake-mingw-clang
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-mingw-clang config=debug64
2014-12-13 00:19:13 -05:00
mingw-clang-release64: .build/projects/gmake-mingw-clang
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-mingw-clang config=release64
2014-12-13 00:19:13 -05:00
mingw-clang: mingw-clang-debug32 mingw-clang-release32 mingw-clang-debug64 mingw-clang-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
2015-04-11 12:45:11 -04:00
vs2008-debug32: .build/projects/vs2008
devenv .build/projects/vs2008/bgfx.sln /Build "Debug|Win32"
2015-04-11 12:45:11 -04:00
vs2008-release32: .build/projects/vs2008
devenv .build/projects/vs2008/bgfx.sln /Build "Release|Win32"
2015-04-11 12:45:11 -04:00
vs2008-debug64: .build/projects/vs2008
devenv .build/projects/vs2008/bgfx.sln /Build "Debug|x64"
2015-04-11 12:45:11 -04:00
vs2008-release64: .build/projects/vs2008
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
2015-04-11 12:45:11 -04:00
.build/projects/vs2015:
$(GENIE) --with-tools --with-shared-lib vs2015
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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-nacl-arm config=release
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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-pnacl config=release
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
2015-04-10 10:46:49 -04:00
$(MAKE) -C .build/projects/gmake-osx config=debug32
2013-11-22 22:14:50 -05:00
osx-release32: .build/projects/gmake-osx
2015-04-10 10:46:49 -04:00
$(MAKE) -C .build/projects/gmake-osx config=release32
2013-11-22 22:14:50 -05:00
osx-debug64: .build/projects/gmake-osx
2015-04-10 10:46:49 -04:00
$(MAKE) -C .build/projects/gmake-osx config=debug64
2013-11-22 22:14:50 -05:00
osx-release64: .build/projects/gmake-osx
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-ios-arm config=release
2013-07-21 17:44:53 -04:00
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
2015-04-10 10:46:49 -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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-ios-simulator config=release
2013-07-21 17:44:53 -04:00
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
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-rpi config=debug
2014-08-24 20:41:41 -04:00
rpi-release: .build/projects/gmake-rpi
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C .build/projects/gmake-rpi config=release
2014-08-24 20:41:41 -04:00
rpi: rpi-debug rpi-release
2016-01-19 22:58:06 -05:00
build-darwin: osx
build-linux: linux-debug64 linux-release64
build-windows: mingw-gcc
build: build-$(OS)
rebuild-shaders:
2015-04-10 10:46:49 -04:00
$(MAKE) -R -C examples rebuild
analyze:
cppcheck src/
cppcheck examples/
docs:
2014-10-03 23:28:31 -04:00
doxygen scripts/bgfx.doxygen
markdown README.md > .build/docs/readme.html
clean:
@echo Cleaning...
2013-10-18 11:29:11 -04:00
-@rm -rf .build
###
SILENT ?= @
UNAME := $(shell uname)
2015-04-10 10:46:49 -04:00
ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin FreeBSD GNU/kFreeBSD))
ifeq ($(UNAME),$(filter $(UNAME),Darwin))
OS=darwin
BUILD_PROJECT_DIR=gmake-osx
2014-11-11 22:28:30 -05:00
BUILD_OUTPUT_DIR=osx64_clang
2014-02-09 22:05:33 -05:00
BUILD_TOOLS_CONFIG=release64
2015-03-31 18:09:43 -04:00
BUILD_TOOLS_SUFFIX=Release
EXE=
else
2015-04-10 10:46:49 -04:00
ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD))
OS=bsd
BUILD_PROJECT_DIR=gmake-freebsd
BUILD_OUTPUT_DIR=freebsd64_gcc
BUILD_TOOLS_CONFIG=release64
BUILD_TOOLS_SUFFIX=Release
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
2015-03-31 18:09:43 -04:00
BUILD_TOOLS_SUFFIX=Release
EXE=
endif
2015-04-10 10:46:49 -04:00
endif
else
OS=windows
2014-10-18 18:44:45 -04:00
BUILD_PROJECT_DIR=gmake-mingw-gcc
BUILD_OUTPUT_DIR=win32_mingw-gcc
BUILD_TOOLS_CONFIG=release32
2015-03-31 18:09:43 -04:00
BUILD_TOOLS_SUFFIX=Release
EXE=.exe
endif
2015-03-31 18:09:43 -04:00
tools/bin/$(OS)/shaderc$(EXE): .build/projects/$(BUILD_PROJECT_DIR)
2015-04-10 10:46:49 -04:00
$(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) -f shaderc.make config=$(BUILD_TOOLS_CONFIG)
2015-03-31 18:09:43 -04:00
$(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/shaderc$(BUILD_TOOLS_SUFFIX)$(EXE) $(@)
2015-03-31 18:09:43 -04:00
tools/bin/$(OS)/geometryc$(EXE): .build/projects/$(BUILD_PROJECT_DIR)
2015-04-10 10:46:49 -04:00
$(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) -f geometryc.make config=$(BUILD_TOOLS_CONFIG)
2015-03-31 18:09:43 -04:00
$(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/geometryc$(BUILD_TOOLS_SUFFIX)$(EXE) $(@)
2015-12-27 23:04:17 -05:00
tools/bin/$(OS)/texturec$(EXE): .build/projects/$(BUILD_PROJECT_DIR)
$(SILENT) $(MAKE) -C .build/projects/$(BUILD_PROJECT_DIR) -f texturec.make config=$(BUILD_TOOLS_CONFIG)
$(SILENT) cp .build/$(BUILD_OUTPUT_DIR)/bin/texturec$(BUILD_TOOLS_SUFFIX)$(EXE) $(@)
tools: tools/bin/$(OS)/shaderc$(EXE) tools/bin/$(OS)/geometryc$(EXE) tools/bin/$(OS)/texturec$(EXE)