summaryrefslogtreecommitdiffstats
path: root/lib/Makefile
blob: 068a482466e9b351583d275ff2683b10a9775d54 (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
# cqrlogo - CGI QR-Code logo for web services

# commands
CC	:= gcc
LN	:= ln

# flags
CFLAGS	+= -std=c11 -O2 -fPIC -Wall -Werror
CFLAGS	+= -liniparser
CFLAGS	+= $(shell pkg-config --cflags --libs libpng)
CFLAGS	+= $(shell pkg-config --cflags --libs zlib)
CFLAGS	+= $(shell pkg-config --cflags --libs libqrencode)
LDFLAGS	+= -Wl,-z,now -Wl,-z,relro -pie

all: libcqrlogo.so

libcqrlogo.o: libcqrlogo.c libcqrlogo.h ../config.h ../version.h Makefile
	$(CC) libcqrlogo.c $(CFLAGS) -c -o libcqrlogo.o

libcqrlogo.so: libcqrlogo.c libcqrlogo.h ../config.h ../version.h Makefile
	$(CC) libcqrlogo.c $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,libcqrlogo.so.$(SOVERSION) -o libcqrlogo.so.$(SOVERSION)
	$(LN) -sf libcqrlogo.so.$(SOVERSION) libcqrlogo.so

clean:
	$(RM) -f libcqrlogo.o libcqrlogo.so libcqrlogo.so.*

distclean:
	$(RM) -f *~ libcqrlogo.o libcqrlogo.so libcqrlogo.so.*