ovr_sdk

diff Makefile @ 0:1b39a1b46319

initial 0.4.4
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 14 Jan 2015 06:51:16 +0200
parents
children e01da1033ca5
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Wed Jan 14 06:51:16 2015 +0200
     1.3 @@ -0,0 +1,104 @@
     1.4 +#############################################################################
     1.5 +#
     1.6 +# Filename    : Makefile
     1.7 +# Content     : Makefile for building linux libovr and OculusWorldDemo
     1.8 +# Created     : 2013
     1.9 +# Authors     : Simon Hallam and Peter Giokaris
    1.10 +# Copyright   : Copyright 2013 OculusVR, Inc. All Rights Reserved
    1.11 +# Instruction : See 'make help'
    1.12 +#
    1.13 +#               make                builds the release versions for the 
    1.14 +#                                   current architechture
    1.15 +#               make clean          delete intermediate release object files 
    1.16 +#                                   and library and executable
    1.17 +#               make DEBUG=1        builds the debug version for the current
    1.18 +#                                   architechture
    1.19 +#               make clean DEBUG=1  deletes intermediate debug object files 
    1.20 +#                                   and the library and executable
    1.21 +#
    1.22 +# Output      : Relative to the directory this Makefile lives in, libraries
    1.23 +#               and executables are built at the following locations 
    1.24 +#               depending upon the architechture of the system you are 
    1.25 +#               running:
    1.26 +#
    1.27 +#           ./LibOVR/Lib/Linux/Debug/i386/libovr.a
    1.28 +#           ./LibOVR/Lib/Linux/Debug/x86_64/libovr.a
    1.29 +#           ./LibOVR/Lib/Linux/Release/i386/libovr.a
    1.30 +#           ./LibOVR/Lib/Linux/Release/x86_64/libovr.a
    1.31 +#           ./Samples/OculusWorldDemo/Release/OculusWorldDemo_i386_Release
    1.32 +#           ./Samples/OculusWorldDemo/Release/OculusWorldDemo_x86_64_Release
    1.33 +#           ./Samples/OculusWorldDemo/Release/OculusWorldDemo_i386_Debug
    1.34 +#           ./Samples/OculusWorldDemo/Release/OculusWorldDemo_x86_64_Debug
    1.35 +#
    1.36 +#############################################################################
    1.37 +
    1.38 +####### Include makefiles in current directory
    1.39 +RELEASESUFFIX =
    1.40 +-include Makefile.*[^~]
    1.41 +
    1.42 +####### Detect system architecture
    1.43 +
    1.44 +SYSARCH       = i386
    1.45 +ifeq ($(shell uname -m),x86_64)
    1.46 +SYSARCH       = x86_64
    1.47 +endif
    1.48 +
    1.49 +####### Compiler, tools and options
    1.50 +
    1.51 +CXX           = g++
    1.52 +LINK          = ar rvs
    1.53 +DELETEFILE    = rm -f
    1.54 +
    1.55 +####### Detect debug or release
    1.56 +
    1.57 +DEBUG         = 0
    1.58 +ifeq ($(DEBUG), 1)
    1.59 +	RELEASETYPE   = Debug$(RELEASESUFFIX)
    1.60 +else
    1.61 +	RELEASETYPE   = Release$(RELEASESUFFIX)
    1.62 +endif
    1.63 +
    1.64 +# Override release types and DEBUG settings in child makefiles.
    1.65 +export RELEASETYPE
    1.66 +export DEBUG
    1.67 +
    1.68 +####### Target settings
    1.69 +LIBOVRPATH    = ./LibOVR
    1.70 +OWDPATH       = ./Samples/OculusWorldDemo
    1.71 +
    1.72 +LIBOVRTARGET  = $(LIBOVRPATH)/Lib/Linux/$(RELEASETYPE)/$(SYSARCH)/libovr.a
    1.73 +OWDTARGET     = $(OWDPATH)/Release/OculusWorldDemo_$(SYSARCH)_$(RELEASETYPE)
    1.74 +
    1.75 +####### Targets
    1.76 +
    1.77 +all:    $(LIBOVRTARGET) $(OWDTARGET)
    1.78 +
    1.79 +$(OWDTARGET): force_look $(LIBOVRTARGET)
    1.80 +	$(MAKE) -C $(OWDPATH)
    1.81 +
    1.82 +$(LIBOVRTARGET): force_look
    1.83 +	$(MAKE) -C $(LIBOVRPATH)
    1.84 +
    1.85 +run: $(OWDTARGET)
    1.86 +	$(MAKE) -C $(OWDPATH) run
    1.87 +
    1.88 +clean:
    1.89 +	$(MAKE) -C $(LIBOVRPATH) clean
    1.90 +	$(MAKE) -C $(OWDPATH) clean
    1.91 +
    1.92 +force_look:
    1.93 +	true
    1.94 +
    1.95 +# Generate help based on descriptions of targets given in this Makefile.
    1.96 +help: 		##- Show this help
    1.97 +	@echo "Targets:"
    1.98 +	@echo "  all      : Build LibOVR and Oculus World Demo"
    1.99 +	@echo "  run      : Run Oculus World Demo"
   1.100 +	@echo "  clean    : Clean selected release (DEBUG=[0,1])"
   1.101 +	@echo "  cleanall : Clean all possible release targets"
   1.102 +	@echo ""
   1.103 +	@echo "Options:"
   1.104 +	@echo "  DEBUG    : 'make DEBUG=1' will build the current target in DEBUG mode"
   1.105 +
   1.106 +# Experimental method of automatically generating help from target names.
   1.107 +#@grep -h "##-" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/^/ /' | sed -e 's/\:\s*##-/:/' | awk '{printf "%+6s\n", $$0}'