Skip to content

Commit 141ffac

Browse files
committed
Fix libusb flags handling on FreeBSD
- Link to libusb directly, pkg-config is not always available - Append, instead of overriding, system compiler/linker flags
1 parent c579cf3 commit 141ffac

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lm4flash/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
EXE := lm4flash
22

33
CC ?= gcc
4+
CFLAGS += -Wall
45

5-
CFLAGS := -Wall $(shell pkg-config --cflags libusb-1.0)
6-
LDFLAGS := $(shell pkg-config --libs libusb-1.0)
6+
ifeq ($(shell uname),FreeBSD)
7+
LDFLAGS += -lusb
8+
else
9+
CFLAGS += $(shell pkg-config --cflags libusb-1.0)
10+
LDFLAGS += $(shell pkg-config --libs libusb-1.0)
11+
endif
712

813
all: CFLAGS += -O2
914
all: $(EXE)

0 commit comments

Comments
 (0)