all: splitscreen 

CC = gcc
LD = gcc
CFLAGS = -Wall -Wstrict-prototypes -O2 -fno-strength-reduce
LDFLAGS =
LIBS = -lncurses
PREFIX = /usr/local

BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/man

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

install: installbin installman

installbin: all
	install -m 755 -s -o bin -g bin splitscreen  $(BINDIR)

installman:
	install -m 644 -o bin -g bin splitscreen.1   $(MANDIR)/man1

clean:
	rm -f *.o *~

distclean: clean
	rm -f splitscreen

splitscreen: splitscreen.o sockserv.o
	$(LD) $(LDFLAGS) -o splitscreen splitscreen.o sockserv.o $(LIBS)

splitscreen.o:  splitscreen.c sockserv.h
sockserv.o:     sockserv.c sockserv.h
