IPKG_DIR=/home/root/dev/ipkg
VERSION=0.1
GLIB_CFLAGS=-I/opt/native/arm/3.3.2-xscale-softvfp/armv5tel-cacko-linux/include/glib-1.2 -I/opt/native/arm/3.3.2-xscale-softvfp/armv5tel-cacko-linux/lib/glib/include
DEFS=-DPRETTY_PRINT -D_GNU_SOURCE

FvwmAPMDaemon: FvwmAPMDaemon.o
	gcc FvwmAPMDaemon.o -o FvwmAPMDaemon -L../../libs -lfvwm -lglib -lapm
FvwmAPMDaemon.o: FvwmAPMDaemon.c FvwmAPMDaemon.h
	gcc -c FvwmAPMDaemon.c -I../../libs -I../.. $(GLIB_CFLAGS) $(DEFS)
install: FvwmAPMDaemon
	FvwmCommand "KillModule FvwmAPMDaemon"
	cp FvwmAPMDaemon /libexec/fvwm/2.5.10/
run: install
	FvwmCommand "Module FvwmAPMDaemon"
	
ipkg: FvwmAPMDaemon
	install -D -m 755 FvwmAPMDaemon $(IPKG_DIR)/FvwmAPMDaemon/libexec/fvwm/2.5.10/FvwmAPMDaemon
	install -D -m 755 ConfigFvwmAPMDaemon $(IPKG_DIR)/FvwmAPMDaemon/share/fvwm/ConfigFvwmAPMDaemon
	install -d -m 755 $(IPKG_DIR)/FvwmAPMDaemon/usr/share/pixmaps/fvwmapmdaemon
	install -D -m 755 fvwmapmdaemon/*.png $(IPKG_DIR)/FvwmAPMDaemon/usr/share/pixmaps/fvwmapmdaemon
	install -D -m 644 control $(IPKG_DIR)/FvwmAPMDaemon/CONTROL/control
	mkipkg $(IPKG_DIR)/FvwmAPMDaemon
clean:
	rm -f FvwmAPMDaemon *.o
