# Makefile for Figlet version 2.0 (August 9, 1993).
# (c) 1993 Glenn Chappell & Ian Chai

# Please make sure SHELL, DESTDIR, MANDIR, DEFAULTFONTDIR,
#   DEFAULTFONTFILE and OLD_DIR_STRUCTS are defined to reflect the
#   situation on your computer. See README for details.

# Don't change this even if your shell is different. The only reason
# for changing this is if sh is not in the same place.
SHELL = /bin/sh

# Where excutable should be put
DESTDIR = /usr/games

# Where the man page should be put
MANDIR = /usr/share/man/cat6

# Where Figlet will search first for fonts (the ".flf" files).
DEFAULTFONTDIR = /usr/games/lib/figlet.dir

# The filename of the font to be used if no other is specified
#   (standard.flf is recommended, but any other can be used).
#   This font file should reside in the directory specified by
#   DEFAULTFONTDIR.
DEFAULTFONTFILE = standard.flf

# OLD_DIR_STRUCTS should normally be 0.  If Figlet fails to compile
#   properly, try setting OLD_DIR_STRUCTS to 1.  This indicates that an
#   older method of accessing directories should be used.
OLD_DIR_STRUCTS = 0

##
##  END OF CONFIGURATION SECTION
##

SOURCES = figlet.c

all: figlet

figlet: $(SOURCES)
	$(CC) $(CFLAGS) -DDEFAULTFONTDIR=\"$(DEFAULTFONTDIR)\"	\
	   -DDEFAULTFONTFILE=\"$(DEFAULTFONTFILE)\"	\
	   -DOLD_DIR_STRUCTS=$(OLD_DIR_STRUCTS) $(SOURCES) -o figlet
	chmod a+x figlet

clean:
	rm -f *.o figlet

install: all
	mkdir $(DEFAULTFONTDIR)
	cp figlet $(DESTDIR)
	cp *.flf $(DEFAULTFONTDIR)
	cp figlet.6 $(MANDIR)
	cp showfigfonts $(DESTDIR)
