CFLAGS = -Wall  -ggdb 
CFLAGS +=`pkg-config gtk+-2.0 libglade-2.0 --cflags`
LDFLAGS =`pkg-config gtk+-2.0 libglade-2.0 --libs` -lcrypto -Wl,-O2
OBJECTS = gui.o util.o list.o verify.o
BINDIR=/usr/bin
PIXMAPDIR=/usr/share/pixmaps
DESKTOPFILEDIR=/usr/share/applications/

ghasher: ${OBJECTS} ghasher.h 
	${CC} -o ghasher ${OBJECTS} ${LDFLAGS} 

text2cstring: text2cstring.o
	${CC} -o text2cstring text2cstring.o

ghasher-glade.c: text2cstring ghasher.glade
	rm -f ghasher-glade.c
	./text2cstring ui < ghasher.glade > ghasher-glade.c

gui.c: 
gui.o: gui.c ghasher.h hash.xpm ghasher-glade.c
	${CC} ${CFLAGS} -c -o gui.o gui.c 
		
.PHONY: install clean

install: ghasher
	install -c -o root ./ghasher ${BINDIR}/ghasher
	install -c -m 444 -o root ghasher.desktop ${DESKTOPFILEDIR}/utelsystems-ghasher.desktop
	install -c -m 444 -o root hash.xpm ${PIXMAPDIR}/hash.xpm

clean:
	rm -f  *.o ghasher ghasher-glade.c text2cstring

