CFLAGS_KERNEL=-O2 -I../../include -I.. $(FLAGS_KERNEL)
CFLAGS=$(CFLAGS_KERNEL)

OFILES_KERNEL=skipcache.o ipsp.o ipsum.o longlong.o sign.o crypt.o cryptdes.o cryptidea.o cryptrc4.o cryptrc2.o cryptsimple.o signmd5.o random.o memblk.o dynamic.o req.o skip.o ah.o esp.o id.o cryptsk128.o

#### RCS settings
 
COFLAGS = -q -M
RCSCLEAN = rcsclean


autoconfig load unload install uninstall:	
	@cd .. && $(MAKE) $@

all:	libskip_kernel.a	

libskip_kernel.a:	$(OFILES_KERNEL)
	ar cr $@ $(OFILES_KERNEL) $(OFILES); \
	if test -s /bin/ranlib; then /bin/ranlib $@; \
	else if test -s /usr/bin/ranlib; then /usr/bin/ranlib $@; fi; \
	fi

clean:	
	-rm -rf kernel user *.a *~ Makefile.bak .depend *.o
	[ ! -w Makefile ] || { sed -e '/^# Do not delete, dependencies are assumed below this line/q' >.Makefile Makefile; mv .Makefile Makefile ;}

checkout:
	-$(CO) $(COFLAGS) $(REVISION) RCS/* < /dev/null
	-ln -s ../*.[ch] . > /dev/null 2>&1

# The single dot is an ugly hack against the xargs "empty input list" bug
rcsclean:
	$(RCSCLEAN)
	find . -type l -name "*.[ch]" -print | xargs rm -f .
	find . -name "*.[ch]" -print | sed -e 's/^/This file should not exist: /' >&2

.PHONY: autoconfig all load unload boot unboot install uninstall clean

# Do not delete, dependencies are assumed below this line
