ovr_sdk

annotate 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
rev   line source
nuclear@0 1 #############################################################################
nuclear@0 2 #
nuclear@0 3 # Filename : Makefile
nuclear@0 4 # Content : Makefile for building linux libovr and OculusWorldDemo
nuclear@0 5 # Created : 2013
nuclear@0 6 # Authors : Simon Hallam and Peter Giokaris
nuclear@0 7 # Copyright : Copyright 2013 OculusVR, Inc. All Rights Reserved
nuclear@0 8 # Instruction : See 'make help'
nuclear@0 9 #
nuclear@0 10 # make builds the release versions for the
nuclear@0 11 # current architechture
nuclear@0 12 # make clean delete intermediate release object files
nuclear@0 13 # and library and executable
nuclear@0 14 # make DEBUG=1 builds the debug version for the current
nuclear@0 15 # architechture
nuclear@0 16 # make clean DEBUG=1 deletes intermediate debug object files
nuclear@0 17 # and the library and executable
nuclear@0 18 #
nuclear@0 19 # Output : Relative to the directory this Makefile lives in, libraries
nuclear@0 20 # and executables are built at the following locations
nuclear@0 21 # depending upon the architechture of the system you are
nuclear@0 22 # running:
nuclear@0 23 #
nuclear@0 24 # ./LibOVR/Lib/Linux/Debug/i386/libovr.a
nuclear@0 25 # ./LibOVR/Lib/Linux/Debug/x86_64/libovr.a
nuclear@0 26 # ./LibOVR/Lib/Linux/Release/i386/libovr.a
nuclear@0 27 # ./LibOVR/Lib/Linux/Release/x86_64/libovr.a
nuclear@0 28 # ./Samples/OculusWorldDemo/Release/OculusWorldDemo_i386_Release
nuclear@0 29 # ./Samples/OculusWorldDemo/Release/OculusWorldDemo_x86_64_Release
nuclear@0 30 # ./Samples/OculusWorldDemo/Release/OculusWorldDemo_i386_Debug
nuclear@0 31 # ./Samples/OculusWorldDemo/Release/OculusWorldDemo_x86_64_Debug
nuclear@0 32 #
nuclear@0 33 #############################################################################
nuclear@0 34
nuclear@0 35 ####### Include makefiles in current directory
nuclear@0 36 RELEASESUFFIX =
nuclear@0 37 -include Makefile.*[^~]
nuclear@0 38
nuclear@0 39 ####### Detect system architecture
nuclear@0 40
nuclear@0 41 SYSARCH = i386
nuclear@0 42 ifeq ($(shell uname -m),x86_64)
nuclear@0 43 SYSARCH = x86_64
nuclear@0 44 endif
nuclear@0 45
nuclear@0 46 ####### Compiler, tools and options
nuclear@0 47
nuclear@0 48 CXX = g++
nuclear@0 49 LINK = ar rvs
nuclear@0 50 DELETEFILE = rm -f
nuclear@0 51
nuclear@0 52 ####### Detect debug or release
nuclear@0 53
nuclear@0 54 DEBUG = 0
nuclear@0 55 ifeq ($(DEBUG), 1)
nuclear@0 56 RELEASETYPE = Debug$(RELEASESUFFIX)
nuclear@0 57 else
nuclear@0 58 RELEASETYPE = Release$(RELEASESUFFIX)
nuclear@0 59 endif
nuclear@0 60
nuclear@0 61 # Override release types and DEBUG settings in child makefiles.
nuclear@0 62 export RELEASETYPE
nuclear@0 63 export DEBUG
nuclear@0 64
nuclear@0 65 ####### Target settings
nuclear@0 66 LIBOVRPATH = ./LibOVR
nuclear@0 67 OWDPATH = ./Samples/OculusWorldDemo
nuclear@0 68
nuclear@0 69 LIBOVRTARGET = $(LIBOVRPATH)/Lib/Linux/$(RELEASETYPE)/$(SYSARCH)/libovr.a
nuclear@0 70 OWDTARGET = $(OWDPATH)/Release/OculusWorldDemo_$(SYSARCH)_$(RELEASETYPE)
nuclear@0 71
nuclear@0 72 ####### Targets
nuclear@0 73
nuclear@0 74 all: $(LIBOVRTARGET) $(OWDTARGET)
nuclear@0 75
nuclear@0 76 $(OWDTARGET): force_look $(LIBOVRTARGET)
nuclear@0 77 $(MAKE) -C $(OWDPATH)
nuclear@0 78
nuclear@0 79 $(LIBOVRTARGET): force_look
nuclear@0 80 $(MAKE) -C $(LIBOVRPATH)
nuclear@0 81
nuclear@0 82 run: $(OWDTARGET)
nuclear@0 83 $(MAKE) -C $(OWDPATH) run
nuclear@0 84
nuclear@0 85 clean:
nuclear@0 86 $(MAKE) -C $(LIBOVRPATH) clean
nuclear@0 87 $(MAKE) -C $(OWDPATH) clean
nuclear@0 88
nuclear@0 89 force_look:
nuclear@0 90 true
nuclear@0 91
nuclear@0 92 # Generate help based on descriptions of targets given in this Makefile.
nuclear@0 93 help: ##- Show this help
nuclear@0 94 @echo "Targets:"
nuclear@0 95 @echo " all : Build LibOVR and Oculus World Demo"
nuclear@0 96 @echo " run : Run Oculus World Demo"
nuclear@0 97 @echo " clean : Clean selected release (DEBUG=[0,1])"
nuclear@0 98 @echo " cleanall : Clean all possible release targets"
nuclear@0 99 @echo ""
nuclear@0 100 @echo "Options:"
nuclear@0 101 @echo " DEBUG : 'make DEBUG=1' will build the current target in DEBUG mode"
nuclear@0 102
nuclear@0 103 # Experimental method of automatically generating help from target names.
nuclear@0 104 #@grep -h "##-" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/^/ /' | sed -e 's/\:\s*##-/:/' | awk '{printf "%+6s\n", $$0}'