aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 40b6d6ede6944af50d3188a878485a00037d9c09 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# cqrlogo - CGI QR-Code logo for web services

CC	:= gcc
INSTALL	:= install
CP	:= cp
RM	:= rm
ZBARIMG	:= zbarimg
SED	:= sed
GREP	:= grep
CFLAGS	+= -O2 -Wall -Werror
CFLAGS	+= $(shell pkg-config --cflags --libs libpng) \
	   $(shell pkg-config --cflags --libs zlib) \
	   $(shell pkg-config --cflags --libs libqrencode)
VERSION	= $(shell git describe --tags --long)

all: cqrlogo.c config.h
	$(CC) $(CFLAGS) -o cqrlogo cqrlogo.c \
		-DVERSION="\"$(VERSION)\""

config.h:
	$(CP) config.def.h config.h

install:
	$(INSTALL) -D -m0755 cqrlogo $(DESTDIR)/usr/share/webapps/cqrlogo/cqrlogo

check:
	$(RM) -f check.png
	SERVER_NAME=www.eworm.de HTTP_REFERER=http://www.eworm.de/ \
		QUERY_STRING='scale=2&border=1' ./cqrlogo | $(SED) '1,2d' > \
		check.png && $(ZBARIMG) --raw -q check.png | $(GREP) -e \
		'^http://www.eworm.de/$$'

clean:
	$(RM) -f *.o *~ cqrlogo