| 1 |
# Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
| 2 |
# Rights to this code are documented in doc/poddoc/license.pod |
| 3 |
# |
| 4 |
# $Id: Makefile.in,v 1.5 2007-08-28 17:08:12 pippijn Exp $ |
| 5 |
PERL = @PERL@ |
| 6 |
CXX = @CXX@ |
| 7 |
RM = @RM@ |
| 8 |
CP = @CP@ |
| 9 |
INSTALL = @INSTALL@ |
| 10 |
MKDEP = @MKDEP@ |
| 11 |
CXXFLAGS = @CXXFLAGS@ -I../include -DBINDIR=\"$(bindir)\" |
| 12 |
|
| 13 |
# Want absolute paths? |
| 14 |
SRCDIR = . |
| 15 |
@ABSPATHS@SRCDIR= @SRCDIR@/test |
| 16 |
|
| 17 |
TESTCOUNT = 200 |
| 18 |
|
| 19 |
default: build |
| 20 |
|
| 21 |
SRCS = \ |
| 22 |
${SRCDIR}/balloc.C \ |
| 23 |
${SRCDIR}/metadata.C \ |
| 24 |
${SRCDIR}/random.C \ |
| 25 |
|
| 26 |
.SUFFIXES: .t |
| 27 |
|
| 28 |
OBJS = ${SRCS:.C=.t} |
| 29 |
|
| 30 |
build: ${SRCDIR}/unit/runtest.h ${OBJS} |
| 31 |
|
| 32 |
.C.t: |
| 33 |
@echo " LD $@" |
| 34 |
@${CXX} -L${SRCDIR}/../src -L${SRCDIR}/../modules -l@PACKAGE_NAME@ -lservices ${CPPFLAGS} ${CXXFLAGS} $< -o $@ |
| 35 |
|
| 36 |
install: |
| 37 |
|
| 38 |
test: ${OBJS} |
| 39 |
@LD_LIBRARY_PATH=${SRCDIR}/../src:${SRCDIR}/../modules; \ |
| 40 |
for i in ${OBJS}; do \ |
| 41 |
echo "[$@] ==> $$i"; \ |
| 42 |
$$i; \ |
| 43 |
done |
| 44 |
|
| 45 |
$(SRCDIR)/unit/runtest.h: $(SRCDIR)/unit/runtest.h.in |
| 46 |
@echo "Generating $@" |
| 47 |
@${PERL} ${SRCDIR}/unit/gentests ${TESTCOUNT} $< > $@ |
| 48 |
|
| 49 |
.PHONY: depend clean distclean |
| 50 |
|
| 51 |
# This sed command sucks but I don't know a better way -- jilles |
| 52 |
depend: ${SRCDIR}/unit/runtest.h |
| 53 |
@${MKDEP} ${PICFLAGS} ${CPPFLAGS} ${CXXFLAGS} ${SRCS} | sed -e 's|\([^.]*\)\.o:|$(SRCDIR)/\1.t:|' > .depend |
| 54 |
|
| 55 |
clean: |
| 56 |
@${RM} -f *.o *.t *~ ${SRCDIR}/unit/runtest.h |
| 57 |
|
| 58 |
distclean: clean |
| 59 |
@${RM} -f Makefile .depend |
| 60 |
|
| 61 |
maintainer-clean: distclean |
| 62 |
|
| 63 |
include .depend |