Skip to content

Commit

Permalink
Markdown cleanup; Makefile: try pkg-config on all OSes, then fall bac…
Browse files Browse the repository at this point in the history
…k on error
  • Loading branch information
bence98 committed Jan 22, 2019
1 parent 139bbd9 commit 379d1cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ else ifneq ($(findstring MINGW, $(UNAME)),)
OS=Windows
else ifneq ($(findstring CYGWIN, $(UNAME)),)
OS=Windows
else ifeq ($(UNAME), Haiku)
OS=Haiku
else
OS=N/A
endif
Expand All @@ -19,19 +21,21 @@ SUBVERSION=0.1
CFLAGS=-I./include -I./libxsvf -g
LDFLAGS_TEST=-L./build -llogsys-drv
ifeq ($(OS), macOS)
LDFLAGS_COMMON=-lusb-1.0
LIBNAME=liblogsys-drv.dylib
LDFLAGS_SO=--shared -Wl,-install_name,$(LIBNAME).$(MAJOR)
else ifeq ($(OS), Windows)
LDFLAGS_COMMON=-lusb-1.0
LIBNAME=liblogsys-drv.dll
LDFLAGS_SO=-shared -Wl,--out-implib,build/$(LIBNAME).a
else
LDFLAGS_COMMON=$(shell pkg-config --libs libusb-1.0)
LIBNAME=liblogsys-drv.so
LDFLAGS_SO=--shared -Wl,-soname,$(LIBNAME).$(MAJOR)
endif

LDFLAGS_COMMON=$(shell pkg-config --libs libusb-1.0)
ifeq ($(LDFLAGS_COMMON),)
LDFLAGS_COMMON=-lusb-1.0
endif

OBJS_SO=build/tmp/shared/usb.o build/tmp/shared/status.o build/tmp/shared/jconf.o

all: build/$(LIBNAME)
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,11 @@ This repository contains the Linux-compatible driver for the [LOGSYS](http://log

* libusb-1.0 (version 0.1 is not supported!)
* (for building) libusb-1.0-dev
* [optional] udev (we provide a udev rule to allow an unprivileged user to use the device)

## Compiling the driver

* You need to clone `libxsvf` by running `git submodule init && git submodule update`
* `make`: The shared object will be created in the `build` folder
* `sudo make install`: install the library to `/usr/local/lib`. You will probably need to do this to run the tests (though you _could technically_ use `$LD_LIBRARY_PATH` to circumvent this)
* tests: `make test`: Test binaries will be created in the `build` folder
* `hotplug-test`: Prints 'Logsys [dis]connected' when you [un]plug the device
* `logsys-test`: Communication protocol test. Exit with the `quit` command or with CTRL+D (EOF). Do not kill with SIGINT (CTRL+C)!
* Using the driver in your app: link with `-llogsys-drv` (assuming you installed the lib)
* Allowing an unprivileged user to access the device (recommended): run `udev-rule.sh` as root
* For a step-by-step guide, see `INSTALLING.md`
For a step-by-step guide, see `INSTALLING.md`

## API

Expand Down

0 comments on commit 379d1cc

Please sign in to comment.