diff options
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 34 |
1 files changed, 25 insertions, 9 deletions
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 |