ovr_sdk

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