1 CFLAGS ?= -std=c99 -pedantic -Wall -Wextra -O2
3 # Don't make pedantic checks errors,
4 # as vanilla libusb-1.0.8 can't live with that
5 #CFLAGS += -pedantic-errors
8 #CFLAGS += -Wunused-but-set-variable
10 CFLAGS += -fno-common \
17 -Wp,-D_FORTIFY_SOURCE=2 \
20 -Wmissing-declarations \
21 -Wmissing-format-attribute \
23 -Wmissing-prototypes \
25 -Wold-style-definition \
33 -Wunsafe-loop-optimizations \
36 CFLAGS += $(shell pkg-config --cflags libusb-1.0)
37 LDLIBS += $(shell pkg-config --libs libusb-1.0)
40 bindir := $(PREFIX)/sbin
44 CFLAGS += -D_BSD_SOURCE # for htole32()
45 CFLAGS += -D_POSIX_C_SOURCE=2 # for getopt()
47 picoproj: picoproj.o am7xxx.o
50 install -d $(DESTDIR)$(bindir)
51 install -m 755 picoproj $(DESTDIR)$(bindir)
53 BACKUP_PREFIX=libpicoproj-$(shell date +%Y%m%d%H%M)
56 -o $(BACKUP_PREFIX).tar.gz \
57 --prefix=$(BACKUP_PREFIX)/ \
61 git log --pretty="format:%ai %aN <%aE>%n%n%x09* %s%d%n" > ChangeLog
64 rm -rf *~ *.o picoproj