# Makefile for juggling programs
# Copyright (C) 1991 John Robinson

# This Makefile is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 1.

# next line if you have GCC
CC=gcc -g -O -finline-functions

# next if your compiler is acc
# CC=acc -g

# add -DHAVEBOOL if your compiler supports the boolean data type

SRCS1 = README Makefile juggle.hlp juggle.h gcur.c svtty.c xTens.c
SRCS2 = juggle.c jsleep.c swapgen.c swapgen.doc
MSG   = 'Look at the README file for further instructions'

# edit this line for the variants you want on your machine
all:	cjuggle xjuggle swapgen

juggle:	juggle.o
	$(CC) -o $@ juggle.o

juggle.o:	juggle.c juggle.h
	$(CC) -DIBMPC -DBITBLT -o $@ -c juggle.c

cjuggle:	cjuggle.o gcur.o svtty.o jsleep.o
	$(CC) -o $@ cjuggle.o gcur.o svtty.o jsleep.o -lcurses -ltermcap

cjuggle.o:	juggle.c juggle.h
	$(CC) -DCURSES -o $@ -c juggle.c

xjuggle:	xjuggle.o xTens.o jsleep.o 
	$(CC) -o $@ xjuggle.o xTens.o jsleep.o -lX11

xjuggle.o:	juggle.c juggle.h
	$(CC) -DXWINDOWS -o $@ -c juggle.c

swapgen:	swapgen.c
	$(CC) -o $@ swapgen.c

gcur.o:	gcur.c juggle.h

svtty.o:	svtty.c

xTens.o:	xTens.c juggle.h

jsleep.o:	jsleep.c

clean:
	rm -f juggle.shar* juggle cjuggle xjuggle swapgen *.o

shar:	juggle.shar1 juggle.shar2

juggle.shar1:	$(SRCS1)
	shar -n 1 -e 2 $(SRCS1) > $@

juggle.shar2:	$(SRCS2)
	shar -n 2 -e 2 -t $(MSG) $(SRCS2) > $@
