#CFLAGS=-O2
CFLAGS=-g -Wall -Wno-parentheses -Wwrite-strings -Wpointer-arith -Wcast-align \
  -Wconversion
#LDFLAGS=-s
LDFLAGS=-g
LIBS=-ltermcap
OBJS=common.o cursed.o descr.o file.o full.o kconf.o line.o output.o \
     scanner.o tree.o values.o

all:		kconf

kconf:		$(OBJS)
		$(CC) -o kconf $(LDFLAGS) $(OBJS) $(LIBS)

depend:
		sed '/^\#\#\# /q' <Makefile >.makefile
		gcc -MM *.c >>.makefile
		mv .makefile Makefile

test:		kconf
		cd test; ./tests

clean:
		rm -f *.o core .makefile
		rm -rf test/*/out

spotless:	clean
		rm -f kconf

### Dependencies
common.o : common.c common.h 
cursed.o : cursed.c common.h cursed.h 
descr.o : descr.c common.h scanner.h values.h descr.h 
file.o : file.c common.h scanner.h file.h 
full.o : full.c common.h cursed.h kconf.h descr.h tree.h output.h 
kconf.o : kconf.c common.h values.h descr.h tree.h kconf.h 
line.o : line.c descr.h tree.h output.h 
lists.o : lists.c 
output.o : output.c kconf.h descr.h common.h file.h values.h output.h 
scanner.o : scanner.c common.h scanner.h 
tree.o : tree.c descr.h tree.h kconf.h 
values.o : values.c common.h scanner.h values.h descr.h 
