Use pkg-config to locate libusb-1.0

This fixes the build on NetBSD (still requires GNU make though).
This commit is contained in:
Pierre Pronchery 2017-10-19 16:16:40 +02:00
parent bc1fe9e833
commit 878bf1d2e9
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,8 @@
CFLAGS = -Wall -Wextra -g `pkg-config --cflags libusb-1.0`
LDFLAGS = `pkg-config --libs libusb-1.0`
rpiboot: main.c
$(CC) -Wall -Wextra -g -o $@ $< -lusb-1.0
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
uninstall:
rm -f /usr/bin/rpiboot

2
main.c
View File

@ -1,4 +1,4 @@
#include <libusb-1.0/libusb.h>
#include <libusb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>