# Makefile for Chameleon
#
# ff@lagged.net
#
# This works on my machine. :)
# If it gives you trouble, tinker with it a bit.


CC = gcc
LD = $(CC)

# this should work fine.
#CFLAGS = -O2 -pedantic -Wall
CFLAGS = `imlib-config --cflags` `gtk-config --cflags`

# if 'make' has trouble finding your gtk stuff, and you know that
# you have it installed, try uncommenting the following line:
# CFLAGS = -O2 -pedantic -Wall `gtk-config --cflags`

# hope you have all of these...
# you can get GTK (glib, gtk, gdk) from www.gtk.org
# you can get Imlib and libgif from www.enlightenment.org
# look elsewhere (like sunsite.unc.edu) for the other libs...
#LIBS = -L/usr/X11/lib -L/usr/local/lib -lgtk -lgdk -lglib -lXext -lX11 -lm -ljpeg -lpng -ltiff -lz -lgif -lImlib

LIBS = `imlib-config --libs` `gtk-config --libs`

# the files we're compiling...
OBJS = chameleon.o setrgb.o setname.o setfile.o info.o

# this is pretty standard.
DIR = /usr/X11/bin
MANDIR = /usr/man/man1

# yup, thats me.
PROG = chameleon

all: $(PROG)

install: $(PROG)
	chown root.root $(PROG)
	chmod 755 $(PROG)
	cp -f $(PROG) $(DIR)
	cp -f chameleon.1.gz $(MANDIR)
	cp -f cham.xpm /usr/X11R6/include/X11/pixmaps/

clean:
	rm -f $(PROG) *.o *.core core *.bak *~

$(PROG): $(OBJS)
	$(LD) -o $(PROG) -L/usr/lib $(OBJS) $(LIBS)

static: $(OBJS)
	$(LD) -static -o $(PROG) $(OBJS) $(LIBS)

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

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

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

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

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