###########################################################################
# Ipe Makefile for Linux
#       
# Make and installation kit for linux
###########################################################################
.PHONY : install build

INSTALL_DIR=/usr/local/lib/ipe

build: 
	cd Plageo/ ; make
	cd Ipe/ ; make
	cd Ium/ ; make

install: build
	mkdir -p $(INSTALL_DIR) $(INSTALL_DIR)/bin $(INSTALL_DIR)/lib 
	mkdir -p $(INSTALL_DIR)/lib/ium 
	mkdir -p $(INSTALL_DIR)/doc 
	cp Ipe/ipe $(INSTALL_DIR)/bin/
	rm -f /usr/local/bin/ipe
	ln -s $(INSTALL_DIR)/bin/ipe /usr/local/bin/ipe
	cp Ium/*.ium $(INSTALL_DIR)/lib/ium/
	cp html/* $(INSTALL_DIR)/doc/
	cp Ipe.app-defaults.linux /usr/lib/X11/app-defaults/Ipe
	cp ipe2eps /usr/local/bin/

kitit: 
	cd Plageo/ ; rm -r -f *.o
	cd Ipe/ ; rm -r -f *.o
	cd Ium/ ; rm -r -f *.o
	rm -f Ipe-5.0.tar Ipe-5.0.tar.gz
	cd .. ; tar cf Ipe-5.0/Ipe-5.0.tar Ipe-5.0/*
	gzip Ipe-5.0.tar