link executable properly so it can be started from other directories

This commit is contained in:
Crispy 2023-05-03 22:09:59 +02:00
parent ebb52a404d
commit 22496fcc35

View file

@ -1,18 +1,18 @@
VERSION=v0.2.2 VERSION=v0.2.2
CC := g++
# CC := clang++ CXX := g++
# CXX := clang++
CPPFLAGS := -g -Wall -std=c++17
LFLAGS := -lX11 -lXrandr -lXtst -lglfw -lGL LFLAGS := -lX11 -lXrandr -lXtst -lglfw -lGL
LIBS := openvr/libopenvr_api.so OVR := -Lopenvr -lopenvr_api
SRC := src/*.cpp TARGET := ./sinpin_vr
OUT := ./sinpin_vr
CPPFLAGS := -Wall -std=c++17 $(LFLAGS) $(LIBS) $(SRC) -o $(OUT)
build: build:
$(CC) -g $(CPPFLAGS) $(CXX) src/*.cpp $(CPPFLAGS) $(LFLAGS) -Wl,-rpath,'$$ORIGIN/openvr' $(OVR) -o $(TARGET)
release: build release: build
zip -r sinpin_vr-$(VERSION).zip sinpin_vr bindings openvr/libopenvr_api.so zip -r sinpin_vr-$(VERSION).zip sinpin_vr bindings openvr/libopenvr_api.so
run: build run: build
$(OUT) $(TARGET)