diff options
Diffstat (limited to 'Samples')
-rw-r--r-- | Samples/CommonSrc/Makefile | 7 | ||||
-rw-r--r-- | Samples/OculusWorldDemo/Makefile | 95 |
2 files changed, 47 insertions, 55 deletions
diff --git a/Samples/CommonSrc/Makefile b/Samples/CommonSrc/Makefile deleted file mode 100644 index 8c07a2a..0000000 --- a/Samples/CommonSrc/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -PLATFORM_SRCS := Samples/CommonSrc/Platform/Platform.cpp Samples/CommonSrc/Platform/X11_Platform.cpp - -RENDER_SRCS := Samples/CommonSrc/Render/Render_Device.cpp Samples/CommonSrc/Render/Render_Stereo.cpp \ - Samples/CommonSrc/Render/Render_GL_Device.cpp \ - Samples/CommonSrc/Render/Render_LoadTextureTGA.cpp - diff --git a/Samples/OculusWorldDemo/Makefile b/Samples/OculusWorldDemo/Makefile index c5588bc..e89ed61 100644 --- a/Samples/OculusWorldDemo/Makefile +++ b/Samples/OculusWorldDemo/Makefile @@ -29,12 +29,9 @@ # ############################################################################# -####### Detect system architecture +##### Build flags -SYSARCH = i386 -ifeq ($(shell uname -m),x86_64) -SYSARCH = x86_64 -endif +DEBUG = 0 ####### Compiler, tools and options @@ -43,10 +40,22 @@ LINK = g++ MAKE = make DELETEFILE = rm -f DEFINES = -DQT_WEBKIT -DGL_GLEXT_PROTOTYPES +MD = mkdir + +####### Detect system architecture + +SYSARCH = i386 +ifeq ($(shell uname -m),x86_64) +SYSARCH = x86_64 +endif + +####### Paths + +CUSTOM_PATH = $(RELEASETYPE)/$(SYSARCH) + ####### Detect debug or release -DEBUG = 0 ifeq ($(DEBUG), 1) CXXFLAGS = -pipe -DDEBUG -g $(DEFINES) RELEASETYPE = Debug @@ -58,68 +67,58 @@ endif ####### Compiler, tools and options LIBOVRPATH = ../../LibOVR +SRCPATH = . COMMONSRCPATH = ../CommonSrc 3RDPARTYPATH = ../../3rdParty INCPATH = -I. -I.. -I$(COMMONSRCPATH) -I$(LIBOVRPATH)/Include -I$(LIBOVRPATH)/Src OBJPATH = ./Obj/Linux/$(RELEASETYPE)/$(SYSARCH) -LFLAGS = -Wl -O1 -L$(LIBOVRPATH)/Lib/Linux/$(RELEASETYPE)/$(SYSARCH) +LFLAGS = -O1 -L$(LIBOVRPATH)/Lib/Linux/$(RELEASETYPE)/$(SYSARCH) LIBS = $(SUBLIBS) -lovr -ludev -lpthread -lGL -lX11 -lXinerama CXX_BUILD = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJPATH)/ ####### Files -OBJECTS = $(OBJPATH)/OculusWorldDemo.o \ - $(OBJPATH)/Player.o \ - $(OBJPATH)/Platform.o \ - $(OBJPATH)/Linux_Platform.o \ - $(OBJPATH)/Linux_Gamepad.o \ - $(OBJPATH)/Render_Device.o \ - $(OBJPATH)/Render_GL_Device.o \ - $(OBJPATH)/Render_LoadTextureDDS.o \ - $(OBJPATH)/Render_LoadTextureTGA.o \ - $(OBJPATH)/Render_XmlSceneLoader.o - -TARGET = ./Release/OculusWorldDemo_$(SYSARCH)_$(RELEASETYPE) - -####### Rules +# Filter out Windows and OSX files +COMMON_SRCPATH = ./Common -all: $(TARGET) +ALL_SRCS := $(shell find ${COMMONSRCPATH} -name "*.cpp") +ALL_SRCS += $(shell find . -name "*.cpp") -$(TARGET): $(LIBOVRPATH)/Lib/Linux/$(RELEASETYPE)/$(SYSARCH)/libovr.a - $(MAKE) -C $(LIBOVRPATH) DEBUG=$(DEBUG) +CPP_SRCS = $(filter-out \ + $(COMMONSRCPATH)/Render/Render_D3D%.cpp \ + $(COMMONSRCPATH)/Render/Render_GL_GLUT%.cpp \ + $(COMMONSRCPATH)/Render/Render_GL_Win32%.cpp \ + $(COMMONSRCPATH)/Render/Render_SDL%.cpp \ + $(COMMONSRCPATH)/Platform/OSX_%.cpp \ + $(COMMONSRCPATH)/Platform/Win32_%.cpp \ + $(COMMONSRCPATH)/Platform/SDL_%.cpp \ + $(COMMONSRCPATH)/Platform/GLUT_%.cpp \ + , $(ALL_SRCS)) -$(TARGET): $(OBJECTS) - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) +OBJECTS_1 = $(patsubst ${SRCPATH}/%.cpp, ${OBJPATH}/%.o, ${CPP_SRCS}) +OBJECTS = $(patsubst ${COMMONSRCPATH}/%.cpp, ${OBJPATH}/%.o, ${OBJECTS_1}) -$(OBJPATH)/OculusWorldDemo.o: OculusWorldDemo.cpp - $(CXX_BUILD)OculusWorldDemo.o OculusWorldDemo.cpp +DIRS = $(subst /,/,$(sort $(dir $(OBJECTS)))) ./Release -$(OBJPATH)/Player.o: Player.cpp - $(CXX_BUILD)Player.o Player.cpp - -$(OBJPATH)/Platform.o: ../../Samples/CommonSrc/Platform/Platform.cpp - $(CXX_BUILD)Platform.o ../../Samples/CommonSrc/Platform/Platform.cpp - -$(OBJPATH)/Linux_Platform.o: ../../Samples/CommonSrc/Platform/Linux_Platform.cpp - $(CXX_BUILD)Linux_Platform.o ../../Samples/CommonSrc/Platform/Linux_Platform.cpp +####### Files -$(OBJPATH)/Linux_Gamepad.o: ../../Samples/CommonSrc/Platform/Linux_Gamepad.cpp - $(CXX_BUILD)Linux_Gamepad.o ../../Samples/CommonSrc/Platform/Linux_Gamepad.cpp +TARGET = ./Release/OculusWorldDemo_$(SYSARCH)_$(RELEASETYPE) -$(OBJPATH)/Render_Device.o: ../../Samples/CommonSrc/Render/Render_Device.cpp $ - $(CXX_BUILD)Render_Device.o ../../Samples/CommonSrc/Render/Render_Device.cpp +####### Rules -$(OBJPATH)/Render_GL_Device.o: ../../Samples/CommonSrc/Render/Render_GL_Device.cpp - $(CXX_BUILD)Render_GL_Device.o ../../Samples/CommonSrc/Render/Render_GL_Device.cpp +all: $(TARGET) -$(OBJPATH)/Render_LoadTextureDDS.o: ../../Samples/CommonSrc/Render/Render_LoadTextureDDS.cpp - $(CXX_BUILD)Render_LoadTextureDDS.o ../../Samples/CommonSrc/Render/Render_LoadTextureDDS.cpp +$(TARGET): $(OBJECTS) + mkdir -p $(DIRS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) -$(OBJPATH)/Render_LoadTextureTGA.o: ../../Samples/CommonSrc/Render/Render_LoadTextureTGA.cpp - $(CXX_BUILD)Render_LoadTextureTGA.o ../../Samples/CommonSrc/Render/Render_LoadTextureTGA.cpp +$(OBJPATH)/%.o: $(COMMONSRCPATH)/%.cpp + mkdir -p $(DIRS) + $(CXX_BUILD) -o "$@" "$<" -$(OBJPATH)/Render_XmlSceneLoader.o: ../../Samples/CommonSrc/Render/Render_XmlSceneLoader.cpp - $(CXX_BUILD)Render_XmlSceneLoader.o ../../Samples/CommonSrc/Render/Render_XmlSceneLoader.cpp +$(OBJPATH)/%.o: $(SRCPATH)/%.cpp + mkdir -p $(DIRS) + $(CXX_BUILD) -o "$@" "$<" clean: -$(DELETEFILE) $(OBJECTS) |