#
# pnp (Parallel NU-Prolog preprocessor Makefile
#


NC=
INSTALLDIR=

NCFLAGS	=
# for sequential (coroutining) system
NCFLAGS	= -F sequential

# compilation rules

.SUFFIXES: .no .ns .nl

.nl.ns: ; $(NC) $(NCFLAGS) -S $*.nl
.ns.no: ; $(NC) $(NCFLAGS) -c $*.ns
.nl.no: ; $(NC) $(NCFLAGS) -c $*.nl

# files used

SRCS	= pnp.nl \
	assert2.nl \
	ledet1.nl \
	ledet2.nl

OBJS	= pnp.ns \
	assert2.ns \
	ledet1.ns \
	ledet2.ns

NOBJS	= pnp.no \
	assert2.no \
	ledet1.no \
	ledet2.no

OTHERS	= Makefile \
	Readme \
	Todo \
	Progs/* \
	Doc/*

# real stuff

pnp: $(NOBJS)
	$(NC) -o pnp $(NOBJS) 

# Install pnp

install: pnp
	/bin/echo "Please edit this file like what you did with bp"
	sleep 3
	$(VI) pnp
	/bin/cp pnp $(INSTALLDIR)
	/bin/cp pnp.save $(INSTALLDIR)

# Clean up some mess

clean:
	-/bin/rm -f core errs
	-/bin/rm -f *.no 
	-/bin/rm -f @.*
	-/bin/rm -f *.ns 

clobber:
	-/bin/rm -f core errs
	-/bin/rm -f *.no 
	-/bin/rm -f @.*
	-/bin/rm -f *.ns 
	-/bin/rm -f pnp pnp.save

tar: pnp.tar

pnp.tar: $(SRCS) $(OTHERS)
	tar -cf pnp.tar $(SRCS) $(OTHERS)


# because compressing files removes the original we
# have a fudge to recreate the original with the right
# time on it
tar.Z: pnp.tar
	/bin/cat /dev/null > pnp.tar.tmp
	/bin/rm -f pnp.tar.Z
	compress pnp.tar
	/bin/mv pnp.tar.tmp pnp.tar
