aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Makefile
blob: 9cd78c56641880ae0b7c41c532d3f9b86c4ff515 (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) $(CFLAGS) -c -o libcqrlogo.o libcqrlogo.c

libcqrlogo.so: libcqrlogo.c libcqrlogo.h ../config.h ../version.h Makefile
	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,libcqrlogo.so.$(SOVERSION) -o libcqrlogo.so.$(SOVERSION) libcqrlogo.c
	$(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.*