CFLAGS=-Wall -Wstrict-prototypes -O2 -ansi
CC=g++
DEFINES=
# DEFINES line
# All defines are now in defs.h, I think :)

PROGS=tlog catlog
OBJECTS=tools.o
INCLUDES=-I.
LIBS=-lpthread
BINDIR=/usr/local/bin

all: $(PROGS)

clean:
	rm -f $(PROGS) $(OBJECTS)

install: all
	install -s -m 755 tlog $(BINDIR)
	install -s -m 755 catlog $(BINDIR)

tlog: tlog.cpp defs.h
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o tlog tlog.cpp $(LIBS)

tools.o: tools.cpp 
	$(CC) $(CFLAGS) -c -o tools.o tools.cpp
	
catlog: tools.o catlog.cpp defs.h tools.h
	$(CC) $(CFLAGS) $(INCLUDES) -o catlog tools.o catlog.cpp
