
# programs
CC      = @CC@
AR      = ar
RANLIB  = @RANLIB@
INSTALL = @INSTALL@
SHELL   = /bin/sh
RM      = rm

# main directories
prefix      = @prefix@
exec_prefix = @exec_prefix@
bindir      = $(exec_prefix)/bin
etcdir      = $(exec_prefix)/etc

DESTDIR =

srcdir      = @srcdir@
VPATH       = @srcdir@

COMMON_INC  = -I$(srcdir)/../../common
COMMON_LIBS = -L../../common -lrwcommon

MKDB_INC = -I$(srcdir)/../../mkdb
MKDB_LIBS = -L../../mkdb -lmkdb

REGEXP_INC = -I$(srcdir)/../../regexp
REGEXP_LIBS = -L../../regexp -lregexp

# options
LOCAL_INC = -I../.. -I$(srcdir) $(COMMON_INC) $(MKDB_INC) $(REGEXP_INC)
LOCAL_LIBS = $(MKDB_LIBS) $(COMMON_LIBS) $(REGEXP_LIBS)

CFLAGS  = @CFLAGS@
ALL_CFLAGS = $(CFLAGS) $(LOCAL_INC) $(LOCAL_OPTIONS) @DEFS@

LDFLAGS = @LDFLAGS@

LIBS    = $(LOCAL_LIBS) @LIBS@

OBJS = rwhois_deleter.o

all: rwhois_deleter

rwhois_deleter: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

.SUFFIXES:
.SUFFIXES: .c .o

.c.o:
	$(CC) $(ALL_CFLAGS) -c $<

# procedural

install:
	if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir $(DESTDIR)$(exec_prefix); fi
	if [ ! -d $(DESTDIR)$(bindir) ]; then mkdir $(DESTDIR)$(bindir); fi
	$(INSTALL) rwhois_deleter $(DESTDIR)$(bindir)

uninstall:
	$(RM) $(DESTDIR)$(bindir)/rwhois_deleter

clean:
	rm -f *.o rwhois_deleter

distclean: clean
	rm -f Makefile
