r18042: testsuite needs to link to libreplace.a :-)
[bbaumbach/samba-autobuild/.git] / source / lib / replace / Makefile.in
1 CC = @CC@
2 prefix = @prefix@
3 exec_prefix = @exec_prefix@
4 bindir = @bindir@
5 includedir = @includedir@
6 libdir = @libdir@
7 VPATH = @srcdir@
8 srcdir = @srcdir@
9 builddir = @builddir@
10 INSTALL = @INSTALL@
11
12 CFLAGS=-I. -I$(srcdir) @CFLAGS@
13
14 OBJS = dlfcn.o getpass.o replace.o snprintf.o
15
16 all: libreplace.a testsuite
17
18 install: all
19         mkdir -p $(libdir)
20         $(INSTALL) libreplace.a $(libdir)
21
22 libreplace.a: $(OBJS)
23         ar -rv $@ $(OBJS)
24         @-ranlib $@
25
26 test: testsuite
27         ./testsuite
28
29 installcheck: install test
30
31 TEST_OBJS = test/testsuite.o
32
33 testsuite: libreplace.a $(TEST_OBJS)
34         $(CC) -o testsuite $(TEST_OBJS) -L. -lreplace
35
36 .c.o:
37         @echo Compiling $*.c
38         @mkdir -p `dirname $@`
39         @$(CC) $(CFLAGS) -c $< -o $@
40
41 clean:
42         rm -f *.o test/*.o *.a testsuite
43
44 distclean: clean
45         rm -f *~ */*~
46         rm -rf autom4te.cache
47         rm -f configure \
48                 config.log config.status \
49                 replace_config.h
50         rm -f Makefile