Skip to content

Commit

Permalink
Fix libusb flags handling on FreeBSD
Browse files Browse the repository at this point in the history
- Link to libusb directly, pkg-config is not always available
- Append, instead of overriding, system compiler/linker flags
  • Loading branch information
AMDmi3 committed Sep 5, 2016
1 parent c579cf3 commit 141ffac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lm4flash/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
EXE := lm4flash

CC ?= gcc
CFLAGS += -Wall

CFLAGS := -Wall $(shell pkg-config --cflags libusb-1.0)
LDFLAGS := $(shell pkg-config --libs libusb-1.0)
ifeq ($(shell uname),FreeBSD)
LDFLAGS += -lusb
else
CFLAGS += $(shell pkg-config --cflags libusb-1.0)
LDFLAGS += $(shell pkg-config --libs libusb-1.0)
endif

all: CFLAGS += -O2
all: $(EXE)
Expand Down

0 comments on commit 141ffac

Please sign in to comment.