2006-09-19 02:49:20 +04:00
#!gmake
#
CC = @CC@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
VPATH = @libreplacedir@
srcdir = @srcdir@
builddir = @builddir@
2008-09-19 23:12:28 +04:00
sharedbuilddir = @sharedbuilddir@
INSTALLCMD = @INSTALL@
2008-02-27 03:41:30 +03:00
LIBS = @LIBS@
2006-09-19 02:49:20 +04:00
2007-06-02 13:10:08 +04:00
.PHONY : test all showflags install installcheck clean distclean realdistclean
2006-09-19 02:49:20 +04:00
2007-06-02 13:10:08 +04:00
CFLAGS = -I. @CFLAGS@
LDFLAGS = @LDFLAGS@
2006-09-19 02:49:20 +04:00
OBJS = @LIBREPLACEOBJ@
all : showflags libreplace .a testsuite
showflags :
@echo 'libreplace will be compiled with flags:'
@echo ' CC = $(CC)'
@echo ' CFLAGS = $(CFLAGS)'
2007-06-02 13:10:08 +04:00
@echo ' LDFLAGS= $(LDFLAGS)'
2008-02-27 03:41:30 +03:00
@echo ' LIBS = $(LIBS)'
2006-09-19 02:49:20 +04:00
install : all
2008-09-19 23:12:28 +04:00
${ INSTALLCMD } -d $( libdir)
${ INSTALLCMD } -m 644 libreplace.a $( libdir)
shared-build : all
${ INSTALLCMD } -d $( sharedbuilddir) /include
${ INSTALLCMD } -m 644 replace.h $( sharedbuilddir) /include
${ INSTALLCMD } -d $( sharedbuilddir) /lib
${ INSTALLCMD } -m 644 libreplace.a $( sharedbuilddir) /lib
2006-09-19 02:49:20 +04:00
libreplace.a : $( OBJS )
ar -rcsv $@ $( OBJS)
test : all
./testsuite
installcheck : install test
2008-09-22 01:59:58 +04:00
TEST_OBJS = test/main.o test/testsuite.o test/os2_delete.o test/strptime.o test/getifaddrs.o
2006-09-19 02:49:20 +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-19 02:49:20 +04:00
.c.o :
@echo Compiling $* .c
@mkdir -p ` dirname $@ `
@$( CC) $( CFLAGS) -c $< -o $@
clean :
rm -f *.o test/*.o *.a testsuite
rm -f testfile.dat
distclean : clean
rm -f *~ */*~
rm -f config.log config.status config.h config.cache
rm -f Makefile
realdistclean : distclean
rm -f configure config.h.in