summaryrefslogtreecommitdiffstats
path: root/LibOVR/Projects
diff options
context:
space:
mode:
Diffstat (limited to 'LibOVR/Projects')
-rw-r--r--LibOVR/Projects/Linux/Makefile85
-rw-r--r--LibOVR/Projects/Linux/Makefile.common37
2 files changed, 122 insertions, 0 deletions
diff --git a/LibOVR/Projects/Linux/Makefile b/LibOVR/Projects/Linux/Makefile
new file mode 100644
index 0000000..008a158
--- /dev/null
+++ b/LibOVR/Projects/Linux/Makefile
@@ -0,0 +1,85 @@
+#############################################################################
+#
+# Filename : Makefile
+# Content : Makefile for building linux version of: libovr
+# Created : 2013
+# Authors : Simon Hallam and Peter Giokaris
+# Copyright : Copyright 2013 OculusVR, Inc. All Rights Reserved
+# Instruction : The g++ compiler and stdndard lib packages need to be
+# installed on the system. Navigate in a shell to the
+# directory where this Makefile is located and enter:
+#
+# make builds the release version for the
+# current architechture
+# make clean delete intermediate release object files
+# and the library file
+# make DEBUG=1 builds the debug version for the current
+# architechture
+# make clean DEBUG=1 deletes intermediate debug object files
+# and the library file
+#
+# Output : Relative to the directory this Makefile lives in, libraries
+# are built at the following locations depending upon the
+# architechture of the system you are running:
+#
+# ./Lib/Linux/Debug/i386/libovr.a
+# ./Lib/Linux/Debug/x86_64/libovr.a
+# ./Lib/Linux/Release/i386/libovr.a
+# ./Lib/Linux/Release/x86_64/libovr.a
+#
+#############################################################################
+
+##### Build flags
+
+DEBUG = 0
+OVR_ROOT = ../../..
+
+include $(OVR_ROOT)/LibOVR/Projects/Linux/Makefile.common
+
+LINK = $(LINK_ARCHIVE)
+INCPATH = $(LIBOVRINCPATH)
+SRCPATH = $(LIBOVRPATH)/Src
+OBJPATH = $(LIBOVRPATH)/Obj/Linux/$(CUSTOM_PATH)
+TARGETPATH = $(LIBOVRPATH)/Lib/Linux/$(CUSTOM_PATH)
+
+CXXBUILD = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJPATH)/
+
+####### Files
+
+TARGET = $(TARGETPATH)/libovr.a
+
+# Filter out Windows and OSX files
+CPP_SRCS = $(filter-out \
+ $(SRCPATH)/OVR_Win32%.cpp \
+ ${SRCPATH}/OVR_OSX%.cpp \
+ ${SRCPATH}/OVR_Posix%.cpp \
+ ${SRCPATH}/Kernel/OVR_ThreadsWinAPI.cpp \
+ , $(shell find ${SRCPATH} -name *.cpp)) \
+
+
+OBJECTS = $(patsubst ${SRCPATH}/%.cpp, ${OBJPATH}/%.o, ${CPP_SRCS}) $(OBJPATH)/tinyxml2.o
+
+DIRS = $(subst /,/,$(sort $(dir $(OBJECTS)))) $(TARGETPATH)
+
+####### Rules
+
+all: $(TARGET)
+
+$(TARGET): $(TARGET_PATH) $(OBJECTS) $(LIBOVRTARGET_PATH)
+ $(MD) -p $(DIRS)
+ $(LINK) $(TARGET) $(OBJECTS)
+
+$(OBJPATH):
+ $(MD) -p $(DIRS)
+
+$(OBJPATH)/%.o: $(SRCPATH)/%.cpp
+ $(MD) -p $(DIRS)
+ $(CXXBUILD) -o "$@" "$<"
+
+$(OBJPATH)/tinyxml2.o: $(3RDPARTYPATH)/TinyXml/tinyxml2.cpp
+ $(CXXBUILD) -o "$@" "$<"
+
+clean:
+ -$(DELETEFILE) $(OBJECTS)
+ -$(DELETEFILE) $(TARGET)
+
diff --git a/LibOVR/Projects/Linux/Makefile.common b/LibOVR/Projects/Linux/Makefile.common
new file mode 100644
index 0000000..1335b87
--- /dev/null
+++ b/LibOVR/Projects/Linux/Makefile.common
@@ -0,0 +1,37 @@
+#############################################################################
+#
+# Filename : Makefile.common
+# Content : Common values for all makefiles in the Oculus SDK
+#
+# You must define OVR_ROOT before including this file
+#
+#############################################################################
+
+CXX = g++
+CXXFLAGS = -fPIC -pipe $(DEFINES)
+MD = mkdir
+DELETEFILE = rm -f
+LINK_ARCHIVE = ar rvs
+LINK_LIBRARY =
+LINK_EXE = g++
+SYSARCH = $(shell uname -m)
+
+####### Detect debug or release
+
+ifeq ($(DEBUG), 1)
+ CXXFLAGS += -DDEBUG -g
+ RELEASETYPE = Debug
+else
+ CXXFLAGS += -O2
+ RELEASETYPE = Release
+endif
+
+CUSTOM_PATH = $(RELEASETYPE)/$(SYSARCH)
+
+####### Paths
+LIBOVRPATH = $(OVR_ROOT)/LibOVR
+3RDPARTYPATH = $(OVR_ROOT)/3rdParty
+LIBOVRINCPATH = -I$(LIBOVRPATH)/Include -I$(LIBOVRPATH)/Src
+LIBOVRLIBPATH = $(LIBOVRPATH)/Lib/Linux/$(CUSTOM_PATH)
+LIBOVRARCHIVE = $(LIBOVRLIBPATH)/libovr.a
+