2021-03-09 14:47:28 +00:00
|
|
|
VERSION ?= $(shell git rev-parse --short HEAD)
|
2022-11-22 16:13:29 +00:00
|
|
|
PKG_CONFIG ?= pkg-config
|
2021-02-21 22:35:53 +00:00
|
|
|
|
|
|
|
all: poll_desfire
|
|
|
|
|
2022-11-22 16:13:29 +00:00
|
|
|
poll_desfire: poll_desfire.o nfc_init.o
|
2021-03-09 15:01:47 +00:00
|
|
|
$(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 $@
|
2021-03-09 14:47:28 +00:00
|
|
|
|
2021-02-21 22:35:53 +00:00
|
|
|
clean:
|
|
|
|
rm -f poll_desfire *.o
|
|
|
|
|
2021-03-09 14:47:28 +00:00
|
|
|
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
|