ovr_sdk

view LibOVR/Makefile @ 1:bd36c61436fa

added oculusd too
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 14 Jan 2015 06:51:30 +0200
parents
children e01da1033ca5
line source
1 #############################################################################
2 #
3 # Filename : Makefile
4 # Content : Makefile for building Linux version of: libovr
5 # Created : 2014
6 # Authors : Simon Hallam, Peter Giokaris, Chris Taylor
7 # Copyright : Copyright 2014 OculusVR, Inc. All Rights Reserved
8 # Instruction : The g++ compiler and standard lib packages need to be
9 # installed on the system. Navigate in a shell to the
10 # directory where this Makefile is located and enter:
11 #
12 # make builds the release version for the
13 # current architecture
14 # make clean delete intermediate release object files
15 # and the library file
16 # make DEBUG=1 builds the debug version for the current
17 # architecture
18 # make clean DEBUG=1 deletes intermediate debug object files
19 # and the library file
20 #
21 # Output : Relative to the directory this Makefile lives in, libraries
22 # are built at the following locations depending upon the
23 # architecture of the system you are running:
24 #
25 # ./Lib/Linux/Debug/i386/libovr.a
26 # ./Lib/Linux/Debug/x86_64/libovr.a
27 # ./Lib/Linux/Release/i386/libovr.a
28 # ./Lib/Linux/Release/x86_64/libovr.a
29 #
30 #############################################################################
32 ####### Include auxiliary makefiles in current directory
33 -include Makefile.*[^~]
35 ####### Detect system architecture
37 SYSARCH = i386
38 ifeq ($(shell uname -m),x86_64)
39 SYSARCH = x86_64
40 endif
42 ####### Compiler, tools and options
44 CXX = g++
45 LINK =
46 DELETEFILE = rm -f
48 ####### Detect debug or release
50 COMMONFLAGS = -Wall -Wextra -Werror -pipe -fPIC -msse2
52 DEBUG ?= 0
53 CXXFLAGS ?=
54 ifeq ($(DEBUG), 1)
55 CXXFLAGS += $(COMMONFLAGS) -DDEBUG -DOVR_BUILD_DEBUG -g
56 RELEASETYPE ?= Debug
57 else
58 CXXFLAGS += $(COMMONFLAGS) -O2 -fno-strict-aliasing
59 RELEASETYPE ?= Release
60 endif
62 ####### Paths
64 LIBOVRPATH = .
65 3RDPARTYPATH = ../3rdParty
66 INCPATH = -I. -I.. -I$(LIBOVRPATH)/Include -I$(LIBOVRPATH)/Src
67 OBJPATH = ./Obj/Linux/$(RELEASETYPE)/$(SYSARCH)
68 PREFIX = /usr/local
70 ####### Files
72 TARGET_DIR = ./Lib/Linux/$(RELEASETYPE)/$(SYSARCH)
73 STATIC_NAME = libovr.a
74 STATIC_TARGET = $(TARGET_DIR)/$(STATIC_NAME)
75 LIBOVR_INST_HDR = Src/OVR_CAPI.h Src/OVR_CAPI_Keys.h Src/OVR_CAPI_GL.h
77 ####### Rules
79 all: $(STATIC_TARGET)
81 OTHER_SOURCE = $(3RDPARTYPATH)/EDID/edid.cpp \
82 $(3RDPARTYPATH)/TinyXml/tinyxml2.cpp
84 OTHER_OBJECTS = $(OTHER_SOURCE:.cpp=.o)
86 LIBOVR_SOURCE = $(LIBOVRPATH)/Src/Net/OVR_BitStream.cpp \
87 $(LIBOVRPATH)/Src/Net/OVR_Unix_Socket.cpp \
88 $(LIBOVRPATH)/Src/Net/OVR_NetworkPlugin.cpp \
89 $(LIBOVRPATH)/Src/Net/OVR_PacketizedTCPSocket.cpp \
90 $(LIBOVRPATH)/Src/Net/OVR_RPC1.cpp \
91 $(LIBOVRPATH)/Src/Net/OVR_Session.cpp \
92 $(LIBOVRPATH)/Src/Net/OVR_Socket.cpp \
93 $(LIBOVRPATH)/Src/Service/Service_NetClient.cpp \
94 $(LIBOVRPATH)/Src/Service/Service_NetSessionCommon.cpp \
95 $(LIBOVRPATH)/Src/Tracking/Tracking_SensorStateReader.cpp \
96 $(LIBOVRPATH)/Src/Displays/OVR_Display.cpp \
97 $(LIBOVRPATH)/Src/Displays/OVR_Linux_Display.cpp \
98 $(LIBOVRPATH)/Src/Displays/OVR_Linux_SDKWindow.cpp \
99 $(LIBOVRPATH)/Src/CAPI/CAPI_DistortionRenderer.cpp \
100 $(LIBOVRPATH)/Src/CAPI/CAPI_HSWDisplay.cpp \
101 $(LIBOVRPATH)/Src/CAPI/CAPI_FrameTimeManager.cpp \
102 $(LIBOVRPATH)/Src/CAPI/CAPI_HMDRenderState.cpp \
103 $(LIBOVRPATH)/Src/CAPI/CAPI_HMDState.cpp \
104 $(LIBOVRPATH)/Src/CAPI/CAPI_LatencyStatistics.cpp \
105 $(LIBOVRPATH)/Src/CAPI/GL/CAPI_GL_DistortionRenderer.cpp \
106 $(LIBOVRPATH)/Src/CAPI/GL/CAPI_GL_HSWDisplay.cpp \
107 $(LIBOVRPATH)/Src/CAPI/GL/CAPI_GL_Util.cpp \
108 $(LIBOVRPATH)/Src/CAPI/GL/CAPI_GLE.cpp \
109 $(LIBOVRPATH)/Src/Kernel/OVR_Alg.cpp \
110 $(LIBOVRPATH)/Src/Kernel/OVR_Allocator.cpp \
111 $(LIBOVRPATH)/Src/Kernel/OVR_Atomic.cpp \
112 $(LIBOVRPATH)/Src/Kernel/OVR_CRC32.cpp \
113 $(LIBOVRPATH)/Src/Kernel/OVR_DebugHelp.cpp \
114 $(LIBOVRPATH)/Src/Kernel/OVR_File.cpp \
115 $(LIBOVRPATH)/Src/Kernel/OVR_FileFILE.cpp \
116 $(LIBOVRPATH)/Src/Kernel/OVR_Lockless.cpp \
117 $(LIBOVRPATH)/Src/Kernel/OVR_Log.cpp \
118 $(LIBOVRPATH)/Src/Kernel/OVR_Math.cpp \
119 $(LIBOVRPATH)/Src/Kernel/OVR_RefCount.cpp \
120 $(LIBOVRPATH)/Src/Kernel/OVR_SharedMemory.cpp \
121 $(LIBOVRPATH)/Src/Kernel/OVR_Std.cpp \
122 $(LIBOVRPATH)/Src/Kernel/OVR_String.cpp \
123 $(LIBOVRPATH)/Src/Kernel/OVR_String_FormatUtil.cpp \
124 $(LIBOVRPATH)/Src/Kernel/OVR_String_PathUtil.cpp \
125 $(LIBOVRPATH)/Src/Kernel/OVR_SysFile.cpp \
126 $(LIBOVRPATH)/Src/Kernel/OVR_System.cpp \
127 $(LIBOVRPATH)/Src/Kernel/OVR_ThreadsPthread.cpp \
128 $(LIBOVRPATH)/Src/Kernel/OVR_ThreadCommandQueue.cpp \
129 $(LIBOVRPATH)/Src/Kernel/OVR_Timer.cpp \
130 $(LIBOVRPATH)/Src/Kernel/OVR_UTF8Util.cpp \
131 $(LIBOVRPATH)/Src/Util/Util_Interface.cpp \
132 $(LIBOVRPATH)/Src/Util/Util_LatencyTest2Reader.cpp \
133 $(LIBOVRPATH)/Src/Util/Util_Render_Stereo.cpp \
134 $(LIBOVRPATH)/Src/Util/Util_SystemInfo.cpp \
135 $(LIBOVRPATH)/Src/Util/Util_SystemGUI.cpp \
136 $(LIBOVRPATH)/Src/OVR_CAPI.cpp \
137 $(LIBOVRPATH)/Src/OVR_SerialFormat.cpp \
138 $(LIBOVRPATH)/Src/OVR_JSON.cpp \
139 $(LIBOVRPATH)/Src/OVR_Profile.cpp \
140 $(LIBOVRPATH)/Src/OVR_Stereo.cpp
142 LIBOVR_OBJECTS = $(patsubst $(LIBOVRPATH)%.cpp,$(OBJPATH)%.o,$(LIBOVR_SOURCE))
144 OBJECTS = $(OTHER_OBJECTS) $(LIBOVR_OBJECTS)
146 $(OBJPATH)/%.o: %.cpp
147 @mkdir -p $(dir $@)
148 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
150 $(STATIC_TARGET): $(OBJECTS)
151 @mkdir -p $(@D)
152 ar rvs $(STATIC_TARGET) $(OBJECTS)
154 clean:
155 -$(DELETEFILE) $(OBJECTS)
156 -$(DELETEFILE) $(STATIC_TARGET)