# Make the buffer program

# Add -DSYS5 for A System 5 (USG) version of unix
#   You should also add -DSYS5 for Ultrix, AIX, and Solarix.
# Add -DDEF_SHMEM=n if you can only have n bytes of shared memory
#   (eg: -DDEF_SHMEM=524288 if you can only have half a meg.)
#CFLAGS=

# Where to install buffer and its manual pages
PREFIX?=/usr/local
INSTBIN=${PREFIX}/bin
INSTMAN=${PREFIX}/man/man1

RM=/bin/rm
ALL=README buffer.man Makefile buffer.c sem.c COPYING

all: buffer

buffer: buffer.o sem.o
	$(CC) -o buffer $(CFLAGS) buffer.o sem.o

clean:
	$(RM) -f *.o core buffer .merrs

install: buffer
	install -cs -m 0755 -o root -g wheel buffer $(INSTBIN)/buffer
	install -c  -m 0644 -o root -g wheel buffer.man $(INSTMAN)/buffer.1

buffer.tar: $(ALL)
	$(RM) -f buffer.tar
	tar cvf buffer.tar $(ALL)

buffer.shar: $(ALL)
	$(RM) -f buffer.shar
	shar $(ALL) > buffer.shar
