added copies of libs so can be built standalone
[ctdb.git] / lib / replace / Makefile.in
1 #!gmake
2 #
3 CC = @CC@
4 prefix = @prefix@
5 exec_prefix = @exec_prefix@
6 bindir = @bindir@
7 includedir = @includedir@
8 libdir = @libdir@
9 VPATH = @libreplacedir@
10 srcdir = @srcdir@
11 builddir = @builddir@
12 INSTALL = @INSTALL@
13
14 .PHONY: test
15
16 CFLAGS=-I. -I@libreplacedir@ @CFLAGS@
17
18 OBJS = @LIBREPLACEOBJ@
19
20 all: showflags libreplace.a testsuite
21
22 showflags:
23         @echo 'libreplace will be compiled with flags:'
24         @echo '  CC     = $(CC)'
25         @echo '  CFLAGS = $(CFLAGS)'
26         @echo '  LIBS   = $(LIBS)'
27
28 install: all
29         mkdir -p $(libdir)
30         $(INSTALL) libreplace.a $(libdir)
31
32 libreplace.a: $(OBJS)
33         ar -rcsv $@ $(OBJS)
34
35 test: all
36         ./testsuite
37
38 installcheck: install test
39
40 TEST_OBJS = test/testsuite.o test/os2_delete.o
41
42 testsuite: libreplace.a $(TEST_OBJS)
43         $(CC) -o testsuite $(TEST_OBJS) -L. -lreplace
44
45 .c.o:
46         @echo Compiling $*.c
47         @mkdir -p `dirname $@`
48         @$(CC) $(CFLAGS) -c $< -o $@
49
50 clean:
51         rm -f *.o test/*.o *.a testsuite
52         rm -f testfile.dat
53
54 distclean: clean
55         rm -f *~ */*~
56         rm -f config.log config.status config.h config.cache
57         rm -f Makefile
58
59 realdistclean: distclean
60         rm -f configure config.h.in