From 5ddd691b03d55f150596c6963bcb24cd4d2e719a Mon Sep 17 00:00:00 2001 From: Dmitry Mikhirev Date: Fri, 14 Nov 2014 20:37:31 +0300 Subject: capture strings to variables $(0), $(1), ... --- GNUmakefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 654e76e..038399c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,12 +1,13 @@ MAKE_INCLUDE_DIR := $(HOME)/src/make-4.1 -CFLAGS += -I$(MAKE_INCLUDE_DIR) +CFLAGS = -Wall -tests = test001 test002 +tests = test001 test002 test003 -load pcre.so .PHONY: check $(tests) clean +pcre.so: CFLAGS += -I$(MAKE_INCLUDE_DIR) pcre.so: CFLAGS += $(shell pcre-config --cflags) pcre.so: LDFLAGS += $(shell pcre-config --libs) pcre.so: pcre.c @@ -19,6 +20,7 @@ test001: echo '$@ PASSED'; \ else \ echo '$@ FAILED'; \ + return 1; \ fi test002: var = st @@ -27,6 +29,15 @@ test002: echo '$@ PASSED'; \ else \ echo '$@ FAILED'; \ + return 1; \ + fi + +test003: + @if [ '$(m te(st),test)$0$1' = testtestst -a -z '$(m a,b)$0$1' ] ; then \ + echo '$@ PASSED'; \ + else \ + echo '$@ FAILED'; \ + return 1; \ fi clean: -- cgit v1.2.1