aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: cf2e6bff143e0f832e1943c94f7082afdbb554cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CFLAGS = -Wall -g
PCRE_CONFIG = pcre-config
#PCRE_CONFIG = pkg-config libpcre
PCRE_CFLAGS := $(shell $(PCRE_CONFIG) --cflags)
PCRE_LIBS := $(shell $(PCRE_CONFIG) --libs)
LIBS = $(PCRE_LIBS)

pcre.so: pcre.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(MAKE_CFLAGS) -fPIC \
		$(LDFLAGS) -shared -o $@ $< $(LIBS)

check: pcre.so
	@if [ -n "`which $(GNUMAKE4)`" ] ; then \
		$(GNUMAKE4) -k -f tests.mk ; \
	else \
		echo 'you need GNU make 4.x to run tests' ; \
		return 1 ; \
	fi

clean:
	$(RM) *.o *.so