[icinga-checkins] icinga.org: icinga-core/mfriedrich/ido: tests: readd ignored libtap Makefile

git at icinga.org git at icinga.org
Mon Apr 2 14:48:27 CEST 2012


Module: icinga-core
Branch: mfriedrich/ido
Commit: e16b53cb35ca6701f4126a7f334d62115fafc3b1
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=e16b53cb35ca6701f4126a7f334d62115fafc3b1

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Mon Feb 27 14:15:15 2012 +0100

tests: readd ignored libtap Makefile

refs #1192

---

 tools/libtap/Makefile |   56 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/tools/libtap/Makefile b/tools/libtap/Makefile
new file mode 100644
index 0000000..f5978b7
--- /dev/null
+++ b/tools/libtap/Makefile
@@ -0,0 +1,56 @@
+CFLAGS = -g -Wall -I.
+CC = gcc
+TESTS = $(patsubst %.c, %, $(wildcard t/*.c))
+
+ifdef ANSI
+	# -D_BSD_SOURCE for MAP_ANONYMOUS
+	CFLAGS += -ansi -D_BSD_SOURCE
+	LDLIBS += -lbsd-compat
+endif
+
+%:
+	$(CC) $(LDFLAGS) $(TARGET_ARCH) $(filter %.o %.a %.so, $^) $(LDLIBS) -o $@
+
+%.o:
+	$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $(filter %.c, $^) $(LDLIBS) -o $@
+
+%.a:
+	$(AR) rcs $@ $(filter %.o, $^)
+
+%.so:
+	$(CC) -shared $(LDFLAGS) $(TARGET_ARCH) $(filter %.o, $^) $(LDLIBS) -o $@
+
+all: libtap.a tests
+
+libtap.a: tap.o
+
+tap.o: tap.c tap.h
+
+tests: $(TESTS)
+
+$(TESTS): %: %.o libtap.a
+
+$(patsubst %, %.o, $(TESTS)): %.o: %.c tap.h
+
+clean:
+	rm -rf *.o t/*.o libtap.a $(TESTS)
+
+distclean:
+	rm -rf *.o t/*.o libtap.a $(TESTS)
+
+install: libtap.a tap.h
+	sudo cp libtap.a /usr/lib
+	sudo cp tap.h /usr/include
+
+uninstall:
+	sudo rm /usr/lib/libtap.a /usr/include/tap.h
+
+dist:
+	rm libtap.zip
+	zip -r libtap *
+
+check test: all
+	prove
+
+.PHONY: all clean install uninstall dist check test tests
+





More information about the icinga-checkins mailing list