TARGET = k3de
VERSION = 0.0.6

LSM= $(TARGET)-$(VERSION).lsm
DATE	= `date +%x`


MAKE		= make
LD		= ld
RM		= rm -f
CP		= cp
CPP		= g++

SUBDIRS	= src

all:	version subdirs

version:
	@echo "#ifndef VERSION"  > src/include/version.h
	@echo "#define VERSION " '"$(VERSION)"' >> src/include/version.h
	@echo "#endif"  >> src/include/version.h

subdirs:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done

clean:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
	$(RM) $(TARGET) $(TARGET).debug *~ *.lsm *.tga *.ppm data/*.tga data/*.ppm data/*~ data/pov/*.tga data/pov/*.ppm data/pov/*~ doc/*~

new:	clean all

tgz:	clean lsm
	@echo Making tgz-package
	@echo
	cp -f ./$(LSM) ..
	tar --directory .. --create --gzip --verbose --file=../$(TARGET)-$(VERSION).tgz $(TARGET)-$(VERSION)
	@echo
	@echo done.

lsm:
	@echo Making LSM
	@echo Writing $(LSM)
	@echo
	@echo Begin > ./$(LSM)
	@echo "Title:            "$(TARGET) >> ./$(LSM)
	@echo "Version:          "$(VERSION) >> ./$(LSM)
	@echo "Entered-date:     "$(DATE) >> ./$(LSM)
	@echo "Description:      3Deditor for the KDE, generates source for POV" >> ./$(LSM)
	@echo "Keywords:         kde editor 3d pov raytracing graphic widgets X11 Qt" >> ./$(LSM)
	@echo "Author:           Markus Weber     eMail:mweber@cww.de" >> ./$(LSM)
	@echo "Author:           Tobias Wollgam   eMail:wollgam@cww.de" >> ./$(LSM)
	@echo "Maintained-by:    Markus Weber,Tobias Wollgam" >> ./$(LSM)
	@echo "Primary-site:     ftp://ftp.kde.org/pub/kde/apps/graphics/" >> ./$(LSM)
	@echo "Alternate-site:   " >> ../$(LSM)
	@echo "Original-site:    ftp://ftp.kde.org/pub/kde/apps/graphics/" >> ./$(LSM)
	@echo "Platform:         unix (only tested on linux)" >> ./$(LSM)
	@echo "Copying-policy:   GPL" >> ./$(LSM)
	@echo End >> ./$(LSM)
	@echo
	@echo done.


