From 56157c6dbf961d69d1a91a39723d0c68f8f81e82 Mon Sep 17 00:00:00 2001 From: Dmitry Mikhirev Date: Fri, 14 Nov 2014 18:22:10 +0300 Subject: added options handling, various fixes --- GNUmakefile | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 91d3616..654e76e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,17 +1,33 @@ --load pcre.so - MAKE_INCLUDE_DIR := $(HOME)/src/make-4.1 CFLAGS += -I$(MAKE_INCLUDE_DIR) +tests = test001 test002 + +-load pcre.so + +.PHONY: check $(tests) clean + pcre.so: CFLAGS += $(shell pcre-config --cflags) pcre.so: LDFLAGS += $(shell pcre-config --libs) pcre.so: pcre.c $(CC) $(CFLAGS) -fPIC $(LDFLAGS) -shared -o $@ $< -ifeq ($(m ^pattern$,pattern), pattern) -check: - @echo test PASSED -else -check: - @echo test FAILED -endif +check: $(tests) + +test001: + @if [ '$(m ^test$,test)' = test ] ; then \ + echo '$@ PASSED'; \ + else \ + echo '$@ FAILED'; \ + fi + +test002: var = st +test002: + @if [ '$(m ^te$(var)$$,test,e)' = test ] ; then \ + echo '$@ PASSED'; \ + else \ + echo '$@ FAILED'; \ + fi + +clean: + $(RM) *.o *.so -- cgit v1.2.1