# define where the resulting goes
prefix = /usr/local

# define macro for name of compiler
CC = /usr/local/bin/gcc

# define macro for g++ flags
CFLAGS = -Wall -D_XOPEN_SOURCE -g `gtk-config --cflags`
# without debugging information...
# CFLAGS = -Wall -D_XOPEN_SOURCE `gtk-config --cflags`

# define libraries to include
LIBRARIES = `gtk-config --libs`

install = install -o root -g root

# the default target is all:, so that if you just say "make", all: is
# executed

all: gtkcookie

gtkcookie: gtkcookie.o
	$(CC) $(CFLAGS) -o gtkcookie gtkcookie.o $(LIBRARIES)
# statically linked...
#	$(CC) $(CFLAGS) -o gtkcookie gtkcookie.o -static $(LIBRARIES)

gtkcookie.o: gtkcookie.c
	$(CC) $(CFLAGS) -c gtkcookie.c

install: gtkcookie
	$(install) -d -m 755 $(prefix)/bin
	$(install) -s -m 755 gtkcookie $(prefix)/bin
	$(install) -d -m 755 $(prefix)/share/pixmaps
	$(install)    -m 644 cookie.xpm $(prefix)/share/pixmaps
	$(install)    -m 644 small_cookie.xpm $(prefix)/share/pixmaps
	$(install) -d -m 755 $(prefix)/man/man1
	$(install)    -m 644 gtkcookie.1 $(prefix)/man/man1

clean:
	rm -f gtkcookie
	rm -f *.o
	rm -f *~

