visomat-data-downloader: add an option to enable libusb debug output
[visomat-utils.git] / src / Makefile
1 CFLAGS = -std=c99 -pedantic -pedantic-errors -Wall -g3 -O2 -D_ANSI_SOURCE_
2 CFLAGS += -fno-common \
3         -fvisibility=hidden \
4         -Wall \
5         -Wdeclaration-after-statement \
6         -Wextra \
7         -Wformat=2 \
8         -Winit-self \
9         -Winline \
10         -Wpacked \
11         -Wpointer-arith \
12         -Wlarger-than-65500 \
13         -Wmissing-declarations \
14         -Wmissing-format-attribute \
15         -Wmissing-noreturn \
16         -Wmissing-prototypes \
17         -Wnested-externs \
18         -Wold-style-definition \
19         -Wredundant-decls \
20         -Wsign-compare \
21         -Wstrict-aliasing=2 \
22         -Wstrict-prototypes \
23         -Wswitch-enum \
24         -Wundef \
25         -Wunreachable-code \
26         -Wwrite-strings \
27         -Wp,-D_FORTIFY_SOURCE=2 \
28         -fstack-protector \
29         --param=ssp-buffer-size=4
30
31 ifneq ($(CC),clang)
32   CFLAGS += -Wunsafe-loop-optimizations -Wunused-but-set-variable
33 endif
34
35 ifeq ($(DEBUG),1)
36   CFLAGS += -DDEBUG
37 endif
38
39 # for getopt
40 CFLAGS += -D_POSIX_C_SOURCE=2
41
42 CFLAGS += $(shell pkg-config --cflags libusb-1.0)
43 LDLIBS := $(shell pkg-config --libs libusb-1.0)
44
45 visomat-data-downloader: visomat-data-downloader.o
46
47 clean:
48         rm -f *~ *.o visomat-data-downloader