ovr_sdk

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