CC	= gcc
SHELL	= /bin/bash

CFLAGS	= -g -O2 -Wall `gtk-config --cflags` 
LDADD   = -L /usr/X11R6/lib  -lgtk -lXext -lgdk -lglib -lX11 -lm 

DEPS = gtkctree.d 

.PHONY: clean

all: $(DEPS) testctree

clean:
	rm -f *.d *.o *~ core testctree

testctree: $(DEPS:.d=.o) testctree.c
	$(CC) $(CFLAGS)  testctree.c -o testctree $(DEPS:.d=.o) $(LDADD)

-include $(DEPS)

#-----------------------------------------------------------------------------

%.o : %.c
	$(CC) $(INC) $(CFLAGS) -c $< -o $@

%.d : %.c
	@echo "Computing dependencies for $< ..."
	@$(SHELL) -c '$(CC) -E -MM $(CFLAGS) $< \
	| sed '\''s/\($*\)\.o[ :]*/\1.o\ $@ : /g'\'' > $@'
