
# Makefile for petcat -- extracted from the main Makefile
# Fri Mar 10 14:39:04 EET 1995

DDIR = DOC
MDIR = DOC

BTARGET = petcat
BSRCS = petcat.c
BOBJS = petcat.o
PETRELEASE = $(BTARGET)-1.9
PETCATFILES = $(BSRCS) Makefile.petcat \
	petcat.man $(MDIR)/petcat.cat $(DDIR)/cbm_basic_tokens


##
## Choose your favourite c-compiler
##

#CC=cc
#CC = CC
#CC = c89
#CC = g++
#CC = gcc -Wall
CC = gcc -Wall -pipe
#CC = gcc -Wall -pipe -ansi
#CC = gcc -Wall -ansi -pedantic -Wmissing-prototypes -Wshadow
CC = gcc -Wall -pipe -ansi -pedantic -Wmissing-prototypes -Wshadow

##
## Choose debugging or optimizing
##

CDEBUGFLAGS = -g
#CDEBUGFLAGS = -O
#CDEBUGFLAGS = -O2
CDEBUGFLAGS = -O9

# unset default compiler flags (usually incorrect)
CCOPTIONS =

RM = rm -f

###

all:: $(BTARGET)

$(BTARGET): $(BOBJS)
	$(RM) $@
	$(CC) -o $@ $(BOBJS) $(LDOPTIONS)

clean::
	$(RM) $(BTARGET) *.o core a.out gmon.out mon.out

###

.man_stamp: petcat.man
	nroff -man petcat.man > $(MDIR)/petcat.cat
	touch .man_stamp

###

petdist: $(PETCATFILES) .man_stamp
	rm -rf /tmp/$(PETRELEASE)
	mkdir /tmp/$(PETRELEASE)
	tar -chf - $(PETCATFILES) | (cd /tmp/$(PETRELEASE); tar -xf -)
	(cd /tmp; tar -cvf $(PETRELEASE).tar $(PETRELEASE))
	mv /tmp/$(PETRELEASE).tar .
	rm -rf /tmp/$(PETRELEASE)
	gzip $(PETRELEASE).tar

###
