# Generated automatically from Makefile.in by configure.
###########################################################################
# LPRng - An Extended Print Spooler System
#
# Copyright 1988-1995 Patrick Powell, San Diego State University
#     papowell@sdsu.edu
# See LICENSE for conditions of use.
#
###########################################################################
# MODULE: Makefile.in
# PURPOSE: top level Makefile for LPD Software
# $Id: Makefile.in,v 1.2 1995/10/29 22:56:48 papowell Exp $
########################################################################## 

SRC=.


#=============================================================================
# List the directories you want to generate:
# DIRS for all, clean, etc.
# ALLDIRS for other such as documentation
#=============================================================================

DIRS= ${SRC}/src ${SRC}/man
ALLDIRS= $(DIRS)

# define default target
.PHONY: all clean FRC install tar ci cifiles DIRS ALLDIRS warn
MAKETARGET=all

all: warn $(DIRS)

#### USE GNU MAKE #####
warn:
	@if ${MAKE} -v 2>&1 | grep -s GNU ; then \
		: ; \
	else \
		echo "Not using GNU make"; \
		exit 1; \
	fi;


#force phony target to be made

$(ALLDIRS): FRC
	$(MAKE) -C $@ $(MAKETARGET) 

###############################################################################

install: 
	$(MAKE) MAKETARGET=$@ $(DIRS)

###############################################################################

ci: cifiles
	$(MAKE) MAKETARGET=$@ $(ALLDIRS)

cifiles:
	checkin() { \
		ci $(CI) -l -mUpdate -t-Initial $$1; \
	}; \
	for i in *; do \
		if test -f "$$i" ; then \
			case "$$i" in  \
			config.h.in ) checkin $$i;; \
			config.* ) ;; \
			* ) checkin $$i ;; \
			esac; \
		fi; \
	done;
###############################################################################

clean:
	-rm -f *.o core $(TARGET)
	$(MAKE) MAKETARGET=$@ $(DIRS)

realclean distclean: clean
	-rm -f Makefile config.cache config.h config.log config.status
	$(MAKE) MAKETARGET=$@ $(DIRS)

###############################################################################

shar:
	DIR=`pwd | sed 's,.*/,,' `; \
	if [ ! -f /tmp/$${DIR}.tgz ]; then \
		echo You must make TAR file first; \
		exit 1; \
	fi; \
	cd ..; tar ztf /tmp/$${DIR}.tgz | sed -e '/\/$$/d' |  \
		shar -S -n $${DIR} -a -s papowell@sdsu.edu \
		   -c -o /tmp/$${DIR}-Part -L100

tar:
	echo RCS >/tmp/L_X
	echo core >>/tmp/L_X
	echo '?' >>/tmp/L_X
	echo '*.o' >>/tmp/L_X
	echo '*.a' >>/tmp/L_X
	for i in $(TARGET) Makefile config.cache config.h config.log config.status; \
		 do echo \*/$$i >>/tmp/L_X; done
	cat /tmp/L_X
	DIR=`pwd | sed 's,.*/,,' `; \
	cd ..; tar zXcfv /tmp/L_X /tmp/$${DIR}.tgz $${DIR}
