# top level Makefile for drawtool
BINDIR=/usr/local/bin
MANDIR=/usr/local/man/mann
INSTALL=/usr/bin/install -c

all: stuff
stuff:
	(cd src && make)
	(cd logo && make)
clean:
	(cd src && make clean)
	(cd logo && make clean)

install:
	$(INSTALL) src/drawtool $(BINDIR)
	chmod 755 $(BINDIR)/drawtool
	$(INSTALL) logo/logo $(BINDIR)
	chmod 755 $(BINDIR)/logo
	$(INSTALL) drawtool.n $(MANDIR)
	chmod 644 $(MANDIR)/drawtool.n
	$(INSTALL) psdrawtool/psdrawtool.pl $(BINDIR)
	$(INSTALL) svgdrawtool/svgdrawtool.pl $(BINDIR)
	$(INSTALL) psdrawtool/flip.pl $(BINDIR)
	$(INSTALL) perltool/perltool.pl $(BINDIR)
	@echo "To use macros, each user must copy the macros folder and the sample.drawtoolrc"
	@echo "Read the README!"

uninstall:
	rm $(BINDIR)/drawtool
	rm $(BINDIR)/logo
	rm $(BINDIR)/psdrawtool.pl
	rm $(BINDIR)/flip.pl
	rm $(BINDIR)/perltool.pl
	rm $(MANDIR)/drawtool.n

