## Process this file with make_am to produce Makefile.am
SUBDIRS: include
CVS_HEADERS: cvs_headers
BODY:

AUTOMAKE_OPTIONS = foreign

noinst_LIBRARIES = libsymmetric.a
noinst_PROGRAMS = desTest desdata bf_test twofish_test generate_q

Makefile.am: Makefile.am.in
	(cd $(top_srcdir) && $(MAKE) src/symmetric/Makefile.am)

# When compiling with lsh, this is set to to -DLSH -I/path/to/lsh/include
# INCLUDES = @crypto_cpp_flags@

LDADD = libsymmetric.a
desdata_LDADD =

des_headers = parity.h rotors.h keymap.h 
BUILT_SOURCES =	desSmallFips.c desSmallCore.c desQuickFips.c desQuickCore.c \
	$(des_headers)

libsymmetric_a_SOURCES = desCode.h desKerb.c desUtil.c desQuick.c \
      $(BUILT_SOURCES) \
      sha.c md5.c idea.c arcfour.c cast.c blowfish.c twofish.c

# Generate DES headers.
$(des_headers): desdata
	./desdata $@ > $@T
	test -s $@T && mv -f $@T $@

desUtil.o: desUtil.c $(des_headers)

# Generate DES sources. Slowest to quickest.
desSmallFips.c:
		@echo > $@ '#include "desCode.h"' 
		@echo >> $@ 'ENCRYPT(DesSmallFipsEncrypt,TEMPSMALL,\
			     LOADFIPS,KEYMAPSMALL,SAVEFIPS)' 
		@echo >> $@ 'DECRYPT(DesSmallFipsDecrypt,TEMPSMALL,\
			     LOADFIPS,KEYMAPSMALL,SAVEFIPS)' 
desSmallCore.c:
		@echo > $@ '#include "desCode.h"' 
		@echo >> $@ 'ENCRYPT(DesSmallCoreEncrypt,TEMPSMALL,\
			     LOADCORE,KEYMAPSMALL,SAVECORE)' 
		@echo >> $@ 'DECRYPT(DesSmallCoreDecrypt,TEMPSMALL,\
			     LOADCORE,KEYMAPSMALL,SAVECORE)' 
desQuickFips.c:
		@echo > $@ '#include "desCode.h"' 
		@echo >> $@ 'ENCRYPT(DesQuickFipsEncrypt,TEMPQUICK,\
			     LOADFIPS,KEYMAPQUICK,SAVEFIPS)' 
		@echo >> $@ 'DECRYPT(DesQuickFipsDecrypt,TEMPQUICK,\
			     LOADFIPS,KEYMAPQUICK,SAVEFIPS)' 
desQuickCore.c:
		@echo > $@ '#include "desCode.h"' 
		@echo >> $@ 'ENCRYPT(DesQuickCoreEncrypt,TEMPQUICK,\
			     LOADCORE,KEYMAPQUICK,SAVECORE)' 
		@echo >> $@ 'DECRYPT(DesQuickCoreDecrypt,TEMPQUICK,\
			     LOADCORE,KEYMAPQUICK,SAVECORE)' 

EXTRA_DIST = $(cvs_headers) Makefile.am.in descore.README

.PHONY: depend
depend:
	rm -f $(DEP_FILES)
	make $(DEP_FILES)

# .deps/%.P : %.c
# 	$(CC) $(CPPFLAGS) $(DEFS) -M -MG $< > $@

MAINTAINERCLEANFILES += $(DEP_FILES)

include $(top_srcdir)/misc/ctags.mk
