ovr_sdk

changeset 2:e01da1033ca5

first wave of modifications
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 14 Jan 2015 06:58:21 +0200
parents bd36c61436fa
children f12a8f74fe1f
files LibOVR/Makefile Makefile
diffstat 2 files changed, 40 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/LibOVR/Makefile	Wed Jan 14 06:51:30 2015 +0200
     1.2 +++ b/LibOVR/Makefile	Wed Jan 14 06:58:21 2015 +0200
     1.3 @@ -74,9 +74,19 @@
     1.4  STATIC_TARGET   = $(TARGET_DIR)/$(STATIC_NAME)
     1.5  LIBOVR_INST_HDR = Src/OVR_CAPI.h Src/OVR_CAPI_Keys.h Src/OVR_CAPI_GL.h
     1.6  
     1.7 +SHARED_BASE = libovr.so
     1.8 +SHARED_SONAME = $(SHARED_BASE).$(SHARED_MAJOR)
     1.9 +SHARED_NAME = $(SHARED_BASE).$(SHARED_MAJOR).$(SHARED_MINOR).$(SHARED_RELEASE)
    1.10 +SHARED_TARGET = $(TARGET_DIR)/$(SHARED_NAME)
    1.11 +SHARED_MAJOR = 0
    1.12 +SHARED_MINOR = 2
    1.13 +SHARED_RELEASE = 1
    1.14 +
    1.15 +LIBOVR_INST_HDR = Src/OVR_CAPI.h Src/OVR_CAPI_Keys.h Src/OVR_CAPI_GL.h
    1.16 +
    1.17  ####### Rules
    1.18  
    1.19 -all:    $(STATIC_TARGET)
    1.20 +all:    $(STATIC_TARGET) $(SHARED_TARGET)
    1.21  
    1.22  OTHER_SOURCE =	$(3RDPARTYPATH)/EDID/edid.cpp \
    1.23  				$(3RDPARTYPATH)/TinyXml/tinyxml2.cpp
    1.24 @@ -151,6 +161,25 @@
    1.25  	@mkdir -p $(@D)
    1.26  	ar rvs $(STATIC_TARGET) $(OBJECTS)
    1.27  
    1.28 +$(SHARED_TARGET): $(OBJECTS)
    1.29 +	@mkdir -p $(@D)
    1.30 +	$(CXX) -shared -Wl,-soname,$(SHARED_SONAME) -o $@ $(OBJECTS) $(LDFLAGS)
    1.31 +
    1.32  clean:
    1.33  	-$(DELETEFILE) $(OBJECTS)
    1.34  	-$(DELETEFILE) $(STATIC_TARGET)
    1.35 +	-$(DELETEFILE) $(SHARED_TARGET)
    1.36 +
    1.37 +
    1.38 +install: $(SHARED_TARGET) $(STATIC_TARGET)
    1.39 +	mkdir -p $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib
    1.40 +	cp $(LIBOVR_INST_HDR) $(DESTDIR)$(PREFIX)/include
    1.41 +	cp $(STATIC_TARGET) $(SHARED_TARGET) $(DESTDIR)$(PREFIX)/lib
    1.42 +	cd $(DESTDIR)$(PREFIX)/lib && \
    1.43 +		rm -f $(SHARED_BASE) $(SHARED_SONAME) && \
    1.44 +		ln -s $(SHARED_NAME) $(SHARED_SONAME) && \
    1.45 +		ln -s $(SHARED_SONAME) $(SHARED_BASE)
    1.46 +
    1.47 +uninstall:
    1.48 +	-cd $(DESTDIR)$(PREFIX)/include && rm -f $(LIBOVR_INST_HDR)
    1.49 +	-cd $(DESTDIR)$(PREFIX)/lib && rm -f $(SHARED_BASE) $(SHARED_SONAME) $(SHARED_NAME)
     2.1 --- a/Makefile	Wed Jan 14 06:51:30 2015 +0200
     2.2 +++ b/Makefile	Wed Jan 14 06:58:21 2015 +0200
     2.3 @@ -63,6 +63,7 @@
     2.4  export DEBUG
     2.5  
     2.6  ####### Target settings
     2.7 +PREFIX = /usr/local
     2.8  LIBOVRPATH    = ./LibOVR
     2.9  OWDPATH       = ./Samples/OculusWorldDemo
    2.10  
    2.11 @@ -86,6 +87,15 @@
    2.12  	$(MAKE) -C $(LIBOVRPATH) clean
    2.13  	$(MAKE) -C $(OWDPATH) clean
    2.14  
    2.15 +install: oculusd
    2.16 +	mkdir -p $(DESTDIR)$(PREFIX)/bin
    2.17 +	cp oculusd $(DESTDIR)$(PREFIX)/bin/oculusd
    2.18 +	$(MAKE) -C $(LIBOVRPATH) install
    2.19 +
    2.20 +uninstall:
    2.21 +	rm $(DESTDIR)$(PREFIX)/bin/oculusd
    2.22 +	$(MAKE) -C $(LIBOVRPATH) uninstall
    2.23 +
    2.24  force_look:
    2.25  	true
    2.26