#sccs	"@(#)strip/mc68k:Makefile	1.3"

#******************************************************************************
#									      *
#		UNIX Mach Lang File Stripper (strip) makefile		      *
#									      *
#******************************************************************************
#									      *
#		Header/Data Files					      *
#									      *
#		com/defs.h						      *
#									      *
#******************************************************************************
#									      *
#		Source Code Files					      *
#									      *
#		com/main.c						      *
#		com/setflags.c						      *
#		com/process.c						      *
#		com/checkflags.c					      *
#		com/buildtmp.c						      *
#		com/buildfcns.c						      *
#		com/copytmp.c						      *
#		com/fcns.c						      *
#									      *
#******************************************************************************
#									      *
#		Library Files						      *
#									      *
#		/lib/libld.a						      *
#									      *
#******************************************************************************

include $(MAKEINC)/Makepre.h


LIBLD = -lld

CDIR = ../common

LPT = dpr -mx

OUTFIL = output.tmp

LDFLAGS = -s
PPFLAGS = -DPORTAR 


CFILES = $(CDIR)/main.c $(CDIR)/setflags.c $(CDIR)/process.c \
	 $(CDIR)/checkflags.c $(CDIR)/buildtmp.c $(CDIR)/buildfcns.c \
	 $(CDIR)/copytmp.c $(CDIR)/fcns.c

HFILES = $(CDIR)/defs.h 

OFILES = main.o setflags.o process.o checkflags.o buildtmp.o buildfcns.o \
	 copytmp.o fcns.o

DEPENDLIST = ../common/buildfcns.c \
	../common/buildtmp.c \
	../common/checkflags.c \
	../common/copytmp.c \
	../common/fcns.c \
	../common/main.c \
	../common/process.c \
	../common/setflags.c

all:	Makeincludes strip strip.mini

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

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

strip: $(OFILES) id.o
	$(LD) $(LDFLAGS) $(SHAREDLIB) -o strip $(OFILES) $(LIBLD) id.o

strip.mini: $(OFILES) id.o
	$(CC) $(LDFLAGS) -o strip.mini $(OFILES) $(LIBLD) id.o

install:
	$(INSTALL) -i$(EXITFLAG) strip $(INSDIR) $(PROTOFILE)


main.o:  $(CDIR)/main.c 
	$(CC) $(CFLAGS) $(PPFLAGS) -c $(CDIR)/main.c

setflags.o:  $(CDIR)/setflags.c 
	$(CC) $(CFLAGS) $(PPFLAGS) -c $(CDIR)/setflags.c

process.o:  $(CDIR)/process.c 
	$(CC) $(CFLAGS) $(PPFLAGS) -c $(CDIR)/process.c

checkflags.o: $(CDIR)/checkflags.c 
	$(CC) $(CFLAGS) $(PPFLAGS) -c $(CDIR)/checkflags.c

buildtmp.o:  $(CDIR)/buildtmp.c 
	$(CC) $(CFLAGS) $(PPFLAGS) -c $(CDIR)/buildtmp.c

buildfcns.o:  $(CDIR)/buildfcns.c 
	$(CC) $(CFLAGS) $(PPFLAGS) -c $(CDIR)/buildfcns.c

copytmp.o:  $(CDIR)/copytmp.c 
	$(CC) $(CFLAGS) $(PPFLAGS) -c $(CDIR)/copytmp.c

fcns.o:  $(CDIR)/fcns.c 
	$(CC) $(CFLAGS) $(PPFLAGS) -c $(CDIR)/fcns.c


clean: comclean
	rm -f $(OFILES)

clobber: clean comclobber
	rm -f strip

listing:
	pr -n makefile $(HFILES) $(CFILES) | $(LPT)
	@echo "files sent to lineprinter!"

flow:
	cflow $(PPFLAGS) $(CFILES) > $(OUTFIL)

flowr:
	cflow -r $(PPFLAGS) $(CFILES) > $(OUTFIL)

id.c: ../strip.sl
	mkslid > id.c

populate:
	getunit

include Makeincludes
include $(MAKEINC)/Makepost.h
