PollDesfire/Makefile

23 lines
591 B
Makefile

VERSION ?= $(shell git rev-parse --short HEAD)
all: poll_desfire
poll_desfire: poll_desfire.o
$(CC) $(LDFLAGS) $(shell $(PKG_CONFIG) --libs libfreefare) $^ -o $@
%.o: %.c
$(CC) $(CFLAGS) -Wall -pedantic --std=c99 $(shell $(PKG_CONFIG) --cflags libfreefare) -g -O0 -D_POSIX_C_SOURCE=200809L -c $^ -o $@
clean:
rm -f poll_desfire *.o
release: poll_desfire_v$(VERSION).tar.gz
poll_desfire_v$(VERSION).tar.gz: poll_desfire.c Makefile
tar czf $@ --transform='s,^,poll_desfire_v$(VERSION)/,' $^
install: all
install -D -m 0755 -t $(PREFIX)/bin/ poll_desfire
.PHONY: all clean release