1
0
mirror of https://github.com/MatMoul/g810-led.git synced 2025-04-04 15:21:45 +00:00
This commit is contained in:
Digicrat 2023-02-02 15:56:10 +00:00 committed by GitHub
commit fb57f26b9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,6 @@
CXX?=g++
UNAME := $(shell uname)
CXXFLAGS?=-Wall -O2
LIB?=hidapi
ifeq ($(LIB),libusb)
@ -6,9 +8,20 @@ ifeq ($(LIB),libusb)
LIBS=-lusb-1.0
else
CPPFLAGS=-Dhidapi
LIBS=-lhidapi-hidraw
ifeq ($(UNAME),Darwin)
LIBS = -lhidapi
else
LIBS = -lhidapi-hidraw
endif
endif
SYSTEMDDIR?=/usr/lib/systemd
$(warning CXX is $(CXX))
# Handle CLANG-specific link syntax
ifeq ($(UNAME),Darwin)
LINK_FLAGS = -Wl,-install_name,lib$(PROGN).so
else
LINK_FLAGS = -Wl,-soname,lib$(PROGN).so
endif
PREFIX?=$(DESTDIR)/usr
libdir?=$(PREFIX)/lib
@ -39,7 +52,7 @@ debug: bin/$(PROGN)
lib/lib$(PROGN).so: $(LIBSRCS)
@mkdir -p lib
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -fPIC -shared -Wl,-soname,lib$(PROGN).so -o lib/lib$(PROGN).so.$(MAJOR).$(MINOR).$(MICRO) $^ $(LIBS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -fPIC -shared $(LINKFLAGS) -o lib/lib$(PROGN).so.$(MAJOR).$(MINOR).$(MICRO) $^ $(LIBS)
@ln -sf lib$(PROGN).so.$(MAJOR).$(MINOR).$(MICRO) lib/lib$(PROGN).so
bin-linked: lib/lib$(PROGN).so