srcdir=@srcdir@ VPATH=@srcdir@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ OBJECTS=src/apr_template.lo APR_TEMPLATE_MAJOR_VERSION=@APR_TEMPLATE_MAJOR_VERSION@ APR_TEMPLATE_DOTTED_VERSION=@APR_TEMPLATE_DOTTED_VERSION@ TARGET_LIB=libapr-template-$(APR_TEMPLATE_MAJOR_VERSION).la PROGRAMS=src/cmdline/tmpl tests/compare HEADERS=include/apr_template.h LIBTOOL=@APR_LIBTOOL@ --silent CC=@CC@ CFLAGS=@CFLAGS@ CPPFLAGS=@CPPFLAGS@ INCLUDES=-I$(srcdir)/include \ -I@APR_INCLUDEDIR@ \ -I@APU_INCLUDEDIR@ \ $(EXTRA_INCLUDES) LDFLAGS=@LDFLAGS@ LIBS=@APR_TEMPLATE_LIBS@ all: $(TARGET_LIB) $(PROGRAMS) src/apr_template.lo: src/apr_template.c $(HEADERS) src/cmdline/tmpl.lo: src/cmdline/tmpl.c $(HEADERS) tests/compare.lo: tests/compare.c $(HEADERS) $(TARGET_LIB): $(OBJECTS) $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -rpath $(libdir) -o $@ $^ $(LIBS) src/cmdline/tmpl: $(TARGET_LIB) src/cmdline/tmpl.lo $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -static -o $@ $^ $(LIBS) tests/compare: $(TARGET_LIB) tests/compare.lo $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -static -o $@ $^ $(LIBS) check: tests/compare @rm -f test.log @for i in `find tests -name \*.tmpl | sed 's/\.tmpl//' | sort`; do \ ./tests/compare $$i.tmpl $$i.out >> ./test.log; \ if [ $$? -ne 0 ]; then \ printf "running %-20s\tFAILURE\n" $$i.tmpl; \ else \ printf "running %-20s\tSUCCESS\n" $$i.tmpl; \ fi \ done; @if [ ! -s test.log ]; then \ rm -f test.log; \ else \ printf "\noutput from failures can be found in test.log\n"; \ fi clean: @rm -rf $(TARGET_LIB) @rm -rf $(OBJECTS) @rm -rf $(PROGRAMS) @rm -rf $(OBJECTS:.lo=.o) @rm -rf tests/compare.lo tests/compare.o @rm -rf src/cmdline/tmpl.lo src/cmdline/tmpl.o .SUFFIXES: .SUFFIXES: .c .lo .o .c.lo: $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o $@ $< && touch $@