# Makefile for SCIX. Johan Ihren.

# $Header: /deneb/src0/johani/scix-0.95/RCS/Makefile,v 1.4 90/03/29 03:34:26 johani Exp $

VERSION = 0.96

# Note that there are two different targets that both produce a scix: "scix"
# and "rawscix". "scix" includes all demos and such stuff, "rawscix" only
# the core SCIX features into the executable "scix". To make scix with demos
# and things, just type "make". To install, edit BINDIR and LIBDIR below and
# type "make install". It should be noted, however, that of the two libraries
# libscix.a is fairly stable, but libscixt.a is still only the barest beginning
# of a toolkit.

# These are only used if you want to install scix.
BINDIR = /usr/local/bin
LIBDIR = /usr/local/lib

.SUFFIXES:

.SUFFIXES:	.sc .o

SCC	  = scc

# SCCFLAGS  = -O -Ob -Og -On -Ot
SCCFLAGS  = -O -On -Ob

# A variant of SCCFLAGS that uses gcc. We haven't noticed any improvements
# with gcc on the pmax, though. But then the pmax port of gcc is quite new...
# SCCFLAGS  = -cc gcc -fcombine-regs -finline-functions -fstrength-reduce \
#	      $(SCCFLAGS)

.sc.o: ;	$(SCC) $(SCCFLAGS) $*.sc

.c.o: ;		$(SCC) $(SCCFLAGS) $*.c

all:		libscix.a libscixt.a scix

scix:		src demo libscixt.a 
		cd demo ; make "SCCFLAGS = -O -Ob -Og -Ot"
		cd toolkit ; make "SCCFLAGS = $(SCCFLAGS)"
		cd src ; make "SCCFLAGS = $(SCCFLAGS)" ../scix
		cp scix scix-$(VERSION)

libscix.a:	src
		cd src ; make "SCCFLAGS = $(SCCFLAGS)" ../libscix.a

libscixt.a:	toolkit
		cd toolkit ; make "SCCFLAGS = $(SCCFLAGS)" ../libscixt.a

rawscix: ;	cd src ; make "SCCFLAGS = $(SCCFLAGS)" ../rawscix

clean: ;	rm -f *~ *.o core
		rm -f doc/*~
		cd src ; make clean
		cd demo ; make clean
		cd toolkit ; make clean

install:	scix libscix.a libscixt.a
		install -c -s scix $(BINDIR)
		install -c libscix.a $(LIBDIR)
		ranlib $(LIBDIR)/libscix.a
		install -c libscixt.a $(LIBDIR)
		ranlib $(LIBDIR)/libscixt.a

DISTFILES =	scix-$(VERSION)/MANIFEST scix-$(VERSION)/Makefile \
		scix-$(VERSION)/README scix-$(VERSION)/Copyright \
		scix-$(VERSION)/Release-notes \
		scix-$(VERSION)/demo/README scix-$(VERSION)/demo/Makefile \
		scix-$(VERSION)/demo/[a-z]*.sc \
		scix-$(VERSION)/doc/scix-manual.doc \
		scix-$(VERSION)/include/[a-z]*.sch \
		scix-$(VERSION)/macros/[a-z]*.sc \
		scix-$(VERSION)/src/README scix-$(VERSION)/src/Makefile \
		scix-$(VERSION)/src/[a-z]*.awk scix-$(VERSION)/src/[a-z]*.sc \
		scix-$(VERSION)/src/fast-types.c scix-$(VERSION)/src/rwsock.c \
		scix-$(VERSION)/src/Xlibsocket.c \
		scix-$(VERSION)/toolkit/README \
		scix-$(VERSION)/toolkit/Makefile \
		scix-$(VERSION)/toolkit/[a-z]*.sc \
		scix-$(VERSION)/Schemetoc.patch

dist: ;		-@if [ -d ../scix-$(VERSION) ]; then \
		  echo "SCIX source-tree already in ../scix-$(VERSION)" ; \
		else \
		  echo "Moving SCIX source-tree to ../scix-$(VERSION)" ; \
		  blorpmagorsk=`pwd` ; \
		  cd .. ; mv $$blorpmagorsk scix-$(VERSION) ; \
		fi
		@(cd .. ; \
		echo "tar cf scix-$(VERSION).tar *lots-of-files*" ; \
		tar cf scix-$(VERSION)/scix-$(VERSION).tar $(DISTFILES) )
		compress scix-$(VERSION).tar



