#
# ruari diff Makefile
#

SHELL =/bin/sh

CFLAGS = -Wall -Wstrict-prototypes 

srcdir = @srcdir@
testdir = $(srcdir)/testsuite
VPATH = @srcdir@

CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

CFLAGS = -Wall -Wstrict-prototypes @CFLAGS@
DEFS = @DEFS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@

prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
bindir = $(exec_prefix)/bin
mandir = $(prefix)/man/man1
manext = .1

CPPFLAGS = -I. -I$(srcdir) $(DEFS) @CPPFLAGS@

%.d: %.c
	$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< \
              | sed '\''s/$*\\.o[ :]*/& $@/g'\'' > $@'

SRCS = error.c xmalloc.c nfmalloc.c getopt.c getopt1.c init.c vercmp.c hash.c utils.c main.c
OBJS = error.o xmalloc.o nfmalloc.o getopt.o getopt1.o init.o vercmp.o hash.o utils.o main.o
LIBS = -ldb

PROGNAME = ruari-diff

.c.o:
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $<

all: $(PROGNAME)

$(PROGNAME): $(OBJS)
	$(CC) $(LDFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS)

include $(SRCS:.c=.d)


install: all installdirs
	$(INSTALL_PROGRAM) $(PROGNAME) $(bindir)/$(binprefix)$(PROGNAME)

# Make sure all installation directories, e.g. $(bindir) actually exist by
# making them if necessary.
installdirs:
	$(srcdir)/mkinstalldirs $(bindir) # $(mandir)

uninstall: 
	rm -f $(bindir)/$(binprefix)$(PROGNAME)

mostlyclean: 
	rm -f *~ *.tmp core [Ee]rrs

clean: mostlyclean
	rm -f $(PROGNAME) $(OBJS)

distclean: clean
	rm -f tags TAGS Makefile config.h config.status config.log config.cache

realclean: distclean

# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
