CC	= gcc
OBJ	= btree.o main.o
LINKOBJ	= $(OBJ)
LIBS	= 
BIN 	= btree

CFLAGS += -std=gnu99 -Wall -Werror -pedantic-errors -Wconversion \
	 -Wpointer-arith -Wbad-function-cast -Wcast-align 
CFLAGS += -march=k8 -msse3 -mfpmath=sse -O3
CFLAGS += -ffast-math -msse -mmmx -m3dnow -minline-all-stringops -mno-push-args -falign-functions -O3 
#CFLAGS += -ggdb3 -pg


.PHONY: all clean dist install uninstall

all:    $(BIN)

dist:	all
	rm -f $(OBJ)
	rm -f $(BIN)
	rm -f callgrind.out.*

clean:	dist
	rm -f $(BIN)

$(BIN): $(OBJ)
	$(CC) $(CFLAGS) $(LINKOBJ) -o $(BIN) $(LIBS)

%.o: %.c btree.h Makefile
	$(CC) $(CFLAGS) -c $< -o $@