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