# Makefile for compiling and installing the Mathomatic Prime Number Tools

CFLAGS		+= -O -Wall -DUNIX
LDFLAGS		+= -s -lm

prefix		= /usr/local
bindir		= $(prefix)/bin
mandir		= /usr/share/man

TARGETS		= matho-primes matho-around matho-twin matho-pascal
MANPAGES1	= matho-primes.1 matho-around.1 matho-twin.1 matho-pascal.1

all: $(TARGETS)
	@echo Make completed.

install: $(TARGETS)
	install -d $(bindir)
	install -d $(mandir)/man1
	install -m 0755 $(TARGETS) $(bindir)
	install -m 0644 $(MANPAGES1) $(mandir)/man1
	@echo Install completed.

uninstall:
	cd $(bindir) && rm -f $(TARGETS)
	cd $(mandir)/man1 && rm -f $(MANPAGES1)

clean:
	rm -f $(TARGETS)
