#
WSLIB= /home/sukru/wslib
XMLLIB= /home/sukru/xml
DBLIB= /home/sukru/db
TLIB= /home/sukru/tlib

CFLAGS= -g -I $(WSLIB)/include -I $(XMLLIB)/include -I$(DBLIB)/include -I$(TLIB)/include
PROGS= todo

all: $(PROGS)

todo: enter.o index.o edit.o tags.o tag_change.o
	gcc -o $@ $^ $(WSLIB)/wserver.o $(DBLIB)/libdb.a $(TLIB)/tlib.a

#  edit.o tags.o tag_change.o

index.c: enter.c edit.c tags.c tag_change.c
	$(WSLIB)/hlink $@ $^

# tags.c tag_change.c

enter.o: enter.c todo.out testdb.hex
edit.o: edit.c edit.out
tags.o: tags.c tags.out
tag_change.o: tag_change.c tag_change.out

testdb.hex: test.db
	strtohex < test.db > testdb.hex

%.out: %.html
	$(XMLLIB)/htm_gen -e $*.html $*.out

clean:
	rm -f *.o *.out *.bak $(PROGS) index.c err

