#
#	c4 - CVS like front end for p4
#

CC =		gcc
CFLAGS =	-O
# CFLAGS =	-g
OBJS =		command.o findroot.o fstat.o ignore.o glob.o \
		info.o lookup.o main.o scan.o


c4:		$(OBJS)
	$(CC) $(CFLAGS) -o c4 $(OBJS)

clean:
	rm -f $(OBJS) c4


VER=1.10
BASE=c4-1.10
# Make release files (binaries must be made seprately).
release:
	groff -Tascii -man c4.1 >c4.1q
	groff -man c4.1 >c4.ps
	# distill c4.ps
	ln -s . $(BASE)
	tar cvf - \
		$(BASE)/README \
		$(BASE)/*.h \
		$(BASE)/*.c \
		$(BASE)/Makefile \
		$(BASE)/Jamfile \
		$(BASE)/c4.1 \
		$(BASE)/c4.1q \
		$(BASE)/c4.ps \
		$(BASE)/c4.pdf \
			| gzip -v -best >c4-$(VER).tar.gz
	rm $(BASE)


PDIR=$(HOME)/wk/perforce/pub/perforce/utils/c4
#  Export this source to the perforce public repository tree.
export:
	find $(PDIR) ! -name 'c4-*.tar.gz' -type f -print | xargs rm -f
	find . ! -name c4a.tar.gz ! -name .c4 -print | cpio -pdvmu $(PDIR)


$(OBJS):	defs.h
main.o:		version.h