aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..80f5452
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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:
+ @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