#makefile for fltk program
CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti"
PROG=fluff
PROG_CAPS=FileMgr
DESC="File Manager"
TCEDIR=`cat /opt/.tce_dir`
BASEDIR=`pwd`


all: ${PROG}.cpp
	g++ ${CXXFLAGS} `fltk-config --cxxflags` -Wall -c ${PROG}.cpp
	gcc `fltk-config --use-images --ldflags` -lfltk_images -lm ${PROG}.o -o ${PROG}
	strip ${PROG}
	echo `ls -l fluff`

debug: ${PROG}.cpp
#	g++ ${CXXFLAGS} `fltk-config --cxxflags` -g -O0 -c ${PROG}.cpp
	g++ ${CXXFLAGS} `fltk-config --cxxflags` -g -c ${PROG}.cpp
	gcc `fltk-config --use-images --ldflags` -lfltk_images -lm ${PROG}.o -o ${PROG}

install: ${PROG}
	sudo cp ${PROG} /usr/local/bin
	sudo cp fluff_fc.sh /usr/local/bin
	sudo cp ${PROG}_help.htm /usr/local/share/doc/fluff/
	sudo cp ${PROG}.gif /usr/local/share/doc/fluff/
	sudo cp ${PROG}.png /usr/local/share/pixmaps/

clean:
	rm *.o ${PROG}

run:
	fluff &
	
oldpackage:
	./build-tcz_for_tc_2_10.sh

package:
	./build-tcz.sh ${PROG} ${PROG_CAPS} ${BASEDIR} ${DESC} "FULL"

upgrade_package:
	./build-tcz.sh ${PROG} ${PROG_CAPS} ${BASEDIR} ${DESC} "UPGRADE"

deploy: package
	echo "TCE DIR is ${TCEDIR}"
	cp ${BASEDIR}/${PROG}.tcz ${TCEDIR}/optional
	
tarball:
	tar -czf ${PROG}_src.tar.gz fluff.cpp fluff_fc.sh fluff.png fluff_help.htm build-tcz.sh fluff.gif test.sh mkdirs.sh Makefile
	
unpack:
	tar -xzf ${PROG}_src.tar.gz



