CC = @CC@
CFLAGS = -Wall @CFLAGS@ @DEFS@
CPPFLAGS = @CPPFLAGS@ @DEFS@
LDFLAGS = @LDFLAGS@ @LIBS@
INSTALL = @INSTALL@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PATH_SEPARATOR = @PATH_SEPARATOR@

prefix = @prefix@
mandir = @mandir@
sysconfdir = @sysconfdir@
datadir = @datadir@
exec_prefix = @exec_prefix@
bindir = @bindir@

BINS = swapd

all: $(BINS)
swapd: swapd.o @LIBOBJS@
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o swapd$(EXEEXT) $(filter %.o, $^)
swapd.o: swapd.c compat.h config.h

.PHONY: clean distclean install
clean:
	rm -f *.o $(BINS) *~
distclean: clean
	rm -f Makefile config.h config.status config.log
install: all
	$(INSTALL) -m 755 swapd$(EXEEXT) $(bindir)/swapd$(EXEEXT)
