#sccs	"@(#)cflow:Makefile	1.1"

include	$(MAKEINC)/Makepre.h

LDFLAGS=-s
FILES = Makefile README cflow.sh dag.c lpfx.c nmf.c flip.c
ALL = dag lpfx nmf flip
LINT = ../lint
MIP = $(LINT)/pcc

DEPENDLIST = dag.c \
	flip.c \
	lpfx.c \
	nmf.c \
	../lint/pcc/manifest \
	../lint/lmanifest 

all: Makeincludes $(ALL)

Makeincludes: $(DEPENDLIST)
	$(INCCMD) $(DEPENDLIST) | $(SORT) | $(FILTER) > Makeincludes
	$(MAKE)

includes: $(DEPENDLIST)
	$(INCCMD) $(DEPENDLIST) | $(SORT) | $(FILTER) > Makeincludes

dag:	dag.c id.o
	$(CC) $(CFLAGS) -c dag.c
	$(LD) $(LDFLAGS) $(SHAREDLIB) -i -o dag dag.o id.o

lpfx:	lpfx.c $(LINT)/lerror.h $(LINT)/lmanifest $(LINT)/lpass2.h \
		$(MIP)/manifest id.o
	$(CC) $(CFLAGS) -c lpfx.c
	$(LD) $(LDFLAGS) $(SHAREDLIB) -i -o lpfx lpfx.o id.o

nmf:	nmf.c id.o
	$(CC) $(CFLAGS) -c nmf.c
	$(LD) $(LDFLAGS) $(SHAREDLIB) -o nmf nmf.o id.o

flip:	flip.c id.o
	$(CC) $(CFLAGS) -c flip.c
	$(LD) $(LDFLAGS) $(SHAREDLIB) -o flip flip.o id.o

install:
	rm -f cflow
	ln cflow.sh cflow
	for i in $(ALL) cflow; do echo installing $$i...; $(INSTALL) -i$(EXITFLAG) $$i $(INSDIR) $(PROTOFILE); done

clean:
	rm -f *.o

clobber: clean
	rm -f $(ALL) cflow a.out make.out core

id.c: cflow.sl
	mkslid > id.c

populate:
	getunit

include Makeincludes
include	$(MAKEINC)/Makepost.h
