2006-09-05 08:53:46 +04:00
#!gmake
#
2006-09-04 16:21:42 +04:00
CC = @CC@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
2006-09-05 15:21:16 +04:00
VPATH = @libreplacedir@
2006-09-04 16:21:42 +04:00
srcdir = @srcdir@
builddir = @builddir@
INSTALL = @INSTALL@
2008-02-27 03:41:30 +03:00
LIBS = @LIBS@
2006-09-04 16:21:42 +04:00
2007-04-30 13:38:25 +04:00
.PHONY : test all showflags install installcheck clean distclean realdistclean
2006-09-04 17:47:57 +04:00
2007-04-30 13:38:25 +04:00
CFLAGS = -I. @CFLAGS@
2007-06-02 12:16:42 +04:00
LDFLAGS = @LDFLAGS@
2006-09-04 16:36:06 +04:00
2006-09-05 15:21:16 +04:00
OBJS = @LIBREPLACEOBJ@
2006-09-04 16:21:42 +04:00
2006-09-06 11:11:09 +04:00
all : showflags libreplace .a testsuite
showflags :
@echo 'libreplace will be compiled with flags:'
2006-09-13 14:58:40 +04:00
@echo ' CC = $(CC)'
2006-09-06 11:11:09 +04:00
@echo ' CFLAGS = $(CFLAGS)'
2007-06-02 12:16:42 +04:00
@echo ' LDFLAGS= $(LDFLAGS)'
2008-02-27 03:41:30 +03:00
@echo ' LIBS = $(LIBS)'
2006-09-04 16:21:42 +04:00
install : all
2006-09-04 16:39:41 +04:00
mkdir -p $( libdir)
2006-09-04 16:21:42 +04:00
$( INSTALL) libreplace.a $( libdir)
libreplace.a : $( OBJS )
2006-09-06 15:20:43 +04:00
ar -rcsv $@ $( OBJS)
2006-09-04 16:21:42 +04:00
2006-09-13 14:58:40 +04:00
test : all
2006-09-04 16:21:42 +04:00
./testsuite
2006-09-04 16:56:14 +04:00
installcheck : install test
2008-02-28 23:43:06 +03:00
TEST_OBJS = test/testsuite.o test/os2_delete.o test/strptime.o test/getifaddrs.o
2006-09-04 16:21:42 +04:00
testsuite : libreplace .a $( TEST_OBJS )
2008-02-27 03:41:30 +03:00
$( CC) -o testsuite $( TEST_OBJS) -L. -lreplace $( LDFLAGS) $( LIBS)
2006-09-04 16:21:42 +04:00
.c.o :
@echo Compiling $* .c
@mkdir -p ` dirname $@ `
2006-09-04 16:36:06 +04:00
@$( CC) $( CFLAGS) -c $< -o $@
2006-09-04 16:21:42 +04:00
clean :
2006-09-04 16:39:41 +04:00
rm -f *.o test/*.o *.a testsuite
2006-09-06 13:47:02 +04:00
rm -f testfile.dat
2006-09-04 16:31:23 +04:00
distclean : clean
rm -f *~ */*~
2006-09-15 00:08:21 +04:00
rm -f config.log config.status config.h config.cache
2006-09-04 16:31:23 +04:00
rm -f Makefile
2006-09-06 12:47:32 +04:00
realdistclean : distclean
rm -f configure config.h.in