Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ OBJS=\
build/main.o

CFLAGS=-std=c11 -O2 -pipe -Wall -Wextra -D_POSIX_C_SOURCE=2 -c
UNAME:=$(shell uname)
ifeq ($(UNAME),FreeBSD)
LDFLAGS=-lusb
else
LDFLAGS=-lusb-1.0
endif

build/%.o: %.c
$(CC) $(CFLAGS) $< -o $@
Expand Down
4 changes: 4 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
// Alas I could not get it to work with the CP2105 chip I needed to reprogram,
// hence this rewrite.

#ifdef __FreeBSD__
#include <libusb.h>
#else
#include <libusb-1.0/libusb.h>
#endif
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down