include src/VERSION.py

TARGET = iceme-$(VERSION)


all:
	@echo "import compileall" > .compile
	@echo "compileall.compile_dir(\"src\")" >> .compile
	@python -t .compile
	@python -t -OO .compile
	@rm -f .compile

clean:
	rm -f .compile .iceme *~ \
	      src/*~ src/*.pyc src/*.pyo src/pixmaps/*~ homepage/*~

install:
	install -m755 -d                $(BUILD_ROOT)/usr/X11R6/bin
	install -m755 iceme             $(BUILD_ROOT)/usr/X11R6/bin/iceme
	install -m755 -d                $(BUILD_ROOT)/usr/lib/iceme
	install -m644 src/*.py          $(BUILD_ROOT)/usr/lib/iceme
	install -m644 src/*.pyc         $(BUILD_ROOT)/usr/lib/iceme
	install -m644 src/*.pyo         $(BUILD_ROOT)/usr/lib/iceme
	install -m755 -d                $(BUILD_ROOT)/usr/lib/iceme/pixmaps
	install -m644 src/pixmaps/*.xpm $(BUILD_ROOT)/usr/lib/iceme/pixmaps

distclean: clean
	rm -f $(TARGET).tar.gz

dist: distclean
	@rm -rf $(TARGET) .$(TARGET)
	@mkdir .$(TARGET)
	@cp -R * .$(TARGET)
	@mv .$(TARGET) $(TARGET)
	@tar cvzf $(TARGET).tar.gz $(TARGET)
	@rm -rf $(TARGET)

rpm: dist
	mv $(TARGET).tar.gz /usr/src/redhat/SOURCES
	rpm -ba iceme.spec
