include ../Makefile.global

ALLDEP = 
OBJ = \
	o/string.o \
	o/debug.o \
	o/exception.o \
	o/file.o \
	o/list.o \
	o/btree.o

LFLAGS = ${CLFLAGS} ${DLFLAGS}
CFLAGS = ${CCFLAGS} ${DCFLAGS}
DEST = kernel.o

# Miscellaneous section
all: o ${DEST}
ctags:
	ctags ../*/*.c ../*/*/*.c
doc:
	../c2man -D ../doc/man *.c
	../c2html -D ../doc/html *.c
install:
	${INSTALL} -d /usr/local/lib/isdk
	${INSTALL} --mode 0644 ${DEST} /usr/local/lib/isdk

clean:
	rm -rf o; rm -f tags core ${DEST}
o:
	mkdir o

kernel.o: ${OBJ}
	ld -r -o kernel.o ${OBJ}

o/string.o: string.c ${ALLDEP}
	${CC} ${CFLAGS} -c -o o/string.o string.c
o/debug.o: debug.c ${ALLDEP}
	${CC} ${CFLAGS} -c -o o/debug.o debug.c
o/exception.o: exception.c ${ALLDEP}
	${CC} ${CFLAGS} -c -o o/exception.o exception.c
o/file.o: file.c ${ALLDEP}
	${CC} ${CFLAGS} -c -o o/file.o file.c
o/list.o: list.c ${ALLDEP}
	${CC} ${CFLAGS} -c -o o/list.o list.c
o/btree.o: btree.c ${ALLDEP}
	${CC} -O0 ${CFLAGS} ${BCFLAGS} -O0 -c -o o/btree.o btree.c
