# Generated automatically from Makefile.in by configure.
include ./Make.common
EXEC= netwatch netresolv
#  You might need to say where the ncurses include files are.
#CFLAGS=-O2 -I/usr/include/ncurses
# -O2 flag caused some performance problems... unclear right now why..
#CFLAGS=-I/usr/include/ncurses
#CFLAGS=-O2
# Comment out the following line if you have a requirement for "ncurses.h"
#OLDLINUX=-DOLDLINUX
#OLDLINUX=
# CFLAGS=
DEFS= curs.h netwatch.h
OBJECTS= curs.o dispdata.o services.o netwatch.o processinetrc.o gh.o warning.o semaphore.o
INSTALLDIR=$(bindir)

all:	$(EXEC)

netresolv:	netresolv.o netresolv.h
	$(CC) -o netresolv $(XCFLAGS) netresolv.o 

netwatch:	$(OBJECTS) $(DEFS)
	$(CC) -DVERSION='$(CVERSION)' -DRELEASE='$(CRELEASE)' -o netwatch $(XCFLAGS) $(OBJECTS) $(XLIBS)

install:	$(EXEC)
	install --owner=root --group=root --mode=0755 -d $(INSTALLDIR)
	install --owner=root --group=root --mode=0755 -d $(mandir)/man1
	install --owner=root --group=root --mode=0700  netwatch $(INSTALLDIR)
	install --owner=root --group=root --mode=0700  netresolv $(INSTALLDIR)
	bzip2 netwatch.1
	install -D  netwatch.1.bz2 $(mandir)/man1
	bunzip2 netwatch.1.bz2
	
tar:
	tar -C .. -czf ../netwatch-$(VERSION)-$(RELEASE).tgz netwatch-$(VERSION)

clean:
	rm -f *~ *.o $(EXEC) config.h config.cache config.log config.status 

.c.o:
	$(CC) $(XCFLAGS) -c $(OLDLINUX) $<

curs.o:		curs.c curs.h config.h
dispdata.o:	dispdata.c curs.h netwatch.h config.h
services.o:	services.c netwatch.h
	$(CC) -g -c services.c
netwatch.o: 	netwatch.c netwatch.h curs.h config.h
	$(CC) -DVERSION='$(CVERSION)' -DRELEASE='$(CRELEASE)' $(XCFLAGS) -c netwatch.c
processinetrc.o:	processinetrc.c
semaphore.o:	semaphore.c
gh.o:		gh.c config.h
netresolv.o:	netresolv.c netresolv.h config.h
warning.o:	warning.c netwatch.h
