# Where the binary goes
BINDIR=/usr/local/bin

# Where the libraries go
# (note that these paths are hard-coded into the executables, and so if you
# change them you must either re-compile or fudge it with the appropriate
# run-time environment variables).
LIBDIR=/usr/local/lib
PYTHON_LIB=$(LIBDIR)/python
TCL_LIB=$(LIBDIR)/tcl7.4
TK_LIB=$(LIBDIR)/tk4.0

#
# You have to provide a target...
#
no-target:
	@echo "Make targets are install-elf"
	@echo "                 install-elf-static"
	@echo "                 install-aout"
	@echo "(see the README file for more information)"

libraries:
	-if test ! -d $(PYTHON_LIB); \
        then mkdir $(PYTHON_LIB); \
        fi
	-if test ! -d $(TCL_LIB); \
        then mkdir $(TCL_LIB); \
        fi
	-if test ! -d $(TK_LIB); \
        then mkdir $(TK_LIB); \
        fi
	cp -r lib-python/* $(PYTHON_LIB)
	cp -r lib-tcl/* $(TCL_LIB)
	cp -r lib-tk/* $(TK_LIB)

install-elf: libraries
	cp python-elf $(BINDIR)/python
	PYTHONPATH=$(PYTHON_LIB) \
		./python-elf $(PYTHON_LIB)/compileall.py $(PYTHON_LIB)

install-elf-static: libraries
	cp python-elf-static $(BINDIR)/python
	PYTHONPATH=$(PYTHON_LIB) \
		./python-elf-static $(PYTHON_LIB)/compileall.py $(PYTHON_LIB)

install-aout: libraries
	cp python-aout $(BINDIR)/python
	PYTHONPATH=$(PYTHON_LIB) \
		./python-aout $(PYTHON_LIB)/compileall.py $(PYTHON_LIB)


