aboutsummaryrefslogtreecommitdiff
path: root/GNUmakefile
blob: 654e76eae83d6469c263b207ef8e79dc640de0cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 $@ $<

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