ovr_sdk

annotate Makefile @ 3:f12a8f74fe1f

added the Xcode project
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 21 Jan 2015 11:37:50 +0200
parents 1b39a1b46319
children
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@2 66 PREFIX = /usr/local
nuclear@0 67 LIBOVRPATH = ./LibOVR
nuclear@0 68 OWDPATH = ./Samples/OculusWorldDemo
nuclear@0 69
nuclear@0 70 LIBOVRTARGET = $(LIBOVRPATH)/Lib/Linux/$(RELEASETYPE)/$(SYSARCH)/libovr.a
nuclear@0 71 OWDTARGET = $(OWDPATH)/Release/OculusWorldDemo_$(SYSARCH)_$(RELEASETYPE)
nuclear@0 72
nuclear@0 73 ####### Targets
nuclear@0 74
nuclear@0 75 all: $(LIBOVRTARGET) $(OWDTARGET)
nuclear@0 76
nuclear@0 77 $(OWDTARGET): force_look $(LIBOVRTARGET)
nuclear@0 78 $(MAKE) -C $(OWDPATH)
nuclear@0 79
nuclear@0 80 $(LIBOVRTARGET): force_look
nuclear@0 81 $(MAKE) -C $(LIBOVRPATH)
nuclear@0 82
nuclear@0 83 run: $(OWDTARGET)
nuclear@0 84 $(MAKE) -C $(OWDPATH) run
nuclear@0 85
nuclear@0 86 clean:
nuclear@0 87 $(MAKE) -C $(LIBOVRPATH) clean
nuclear@0 88 $(MAKE) -C $(OWDPATH) clean
nuclear@0 89
nuclear@2 90 install: oculusd
nuclear@2 91 mkdir -p $(DESTDIR)$(PREFIX)/bin
nuclear@2 92 cp oculusd $(DESTDIR)$(PREFIX)/bin/oculusd
nuclear@2 93 $(MAKE) -C $(LIBOVRPATH) install
nuclear@2 94
nuclear@2 95 uninstall:
nuclear@2 96 rm $(DESTDIR)$(PREFIX)/bin/oculusd
nuclear@2 97 $(MAKE) -C $(LIBOVRPATH) uninstall
nuclear@2 98
nuclear@0 99 force_look:
nuclear@0 100 true
nuclear@0 101
nuclear@0 102 # Generate help based on descriptions of targets given in this Makefile.
nuclear@0 103 help: ##- Show this help
nuclear@0 104 @echo "Targets:"
nuclear@0 105 @echo " all : Build LibOVR and Oculus World Demo"
nuclear@0 106 @echo " run : Run Oculus World Demo"
nuclear@0 107 @echo " clean : Clean selected release (DEBUG=[0,1])"
nuclear@0 108 @echo " cleanall : Clean all possible release targets"
nuclear@0 109 @echo ""
nuclear@0 110 @echo "Options:"
nuclear@0 111 @echo " DEBUG : 'make DEBUG=1' will build the current target in DEBUG mode"
nuclear@0 112
nuclear@0 113 # Experimental method of automatically generating help from target names.
nuclear@0 114 #@grep -h "##-" $(MAKEFILE_LIST) | grep -v grep | sed -e 's/^/ /' | sed -e 's/\:\s*##-/:/' | awk '{printf "%+6s\n", $$0}'