# Generated automatically from Makefile.in by configure.
# Makefile for aescrypt
# Copyright 2000 Enhanced Software Technologies Inc.
# All Rights Reserved
#
# Released for public use under the BSD license.
# see file LICENSE for details.
#
# RCS CHANGE LOG
# $Log: Makefile.in,v $
# Revision 1.1.1.1  2001/05/17 17:10:58  elgreen
# Initial checkin
#
# Revision 1.12  2000/12/12 16:41:21  eric
# aescrypt 0.6 (large patch by Peter Pentchev).
#
# Revision 1.11  2000/12/11 23:10:59  eric
# version 0.5
#
# Revision 1.10  2000/10/30 22:37:10  randy
# Added tobin copy to installbc rule
#
# Revision 1.9  2000/10/14 21:48:59  randy
# Added remove of 'tobin' to clean rule
#
# Revision 1.8  2000/10/12 21:38:17  randy
# Support for end-to-end client authorization (DB, remote agents)
#
# Revision 1.7  2000/10/11 18:24:04  randy
# Documentation updates
#
# Revision 1.6  2000/10/10 23:40:59  randy
# Integrate the Rijndael algorithm in place of the Twofish algorithm for
# our AES package.  Changed crypt and get to no longer call the Twofish
# specific (but much more efficient) reKey subroutine.  Ah, well, it's not
# like we're running on Apple ][s anymore, eh?
#
# Revision 1.5  2000/08/03 22:05:34  eric
# Added ability to accept '-' as arg to -k to indicate that the password
# is the first 33 chars of stdin (32 hex chars + terminator). Removed
# reference to Dr. Gladman's encryption routines, added reference to
# Counterpane's encryption routines.
#
# Revision 1.4  2000/05/05 20:56:49  eric
# Modifications for getting 'kk=' string out of the server config files.
#
# Revision 1.3  2000/04/24 20:01:54  eric
# Fixed install prefix :-(
#
# Revision 1.2  2000/04/24 19:46:57  eric
# More autoconf tweaks. Changed to using Counterpane's TwoFish rather than
# Dr. Gladman's TwoFish in an attempt to fix the big endian/little endian
# problems once and for all.
#
# Revision 1.2  2000/04/05 22:09:19  eric
# Daily checkin...
#
# Revision 1.1  2000/03/28 23:54:28  eric
# Initial checkin -- aescrypt/aesget
#
#
# $Date: 2001/05/17 17:10:58 $
#

# Genericizing the makefile to support changes in supported encryption.
# Rijndael was picked by NIST, but there's still a remote chance that
# could change.

ALGORITHM=rijndael
# ALGORITHM=twofish2
ALG_TABLE=rijndael-boxes.dat
# ALG_TABLE=table.h

VERSION=0.7

CC=gcc        # set the C compiler to gcc for most platforms. This is
               # set to pgcc for Mandrake 6.1 due to irritating colorgcc. 

LIBS=

COMMON_OBJ=bin2hex.o $(ALGORITHM).o dstring.o

CRYPT_OBJ=aescrypt.o dorandom.o $(COMMON_OBJ)

DECRYPT_OBJ=aesget.o $(COMMON_OBJ)

SRC=aescrypt.c bin2hex.c dorandom.c (ALGORITHM).c dstring.c

#CFLAGS=-g -O2
CFLAGS=-g -Wall -W

CRYPTOFLAGS=-Wall -W -O2 -DSTRICT_ALIGN=0

all: aescrypt aesget tobin

distclean: clean
	rm -f Makefile config.cache config.h config.log config.status

clean:
	rm -f *.o *~ aescrypt aesget tobin

dist:	distclean
	./makedist $(VERSION)


install:
	@cp aescrypt $(prefix)/bin
	@cp aesget  $(prefix)/bin

installbc:
	@cp aescrypt $(prefix)/bin
	@cp aesget $(prefix)/bin
	@cp tobin $(prefix)/bin

aescrypt: $(CRYPT_OBJ)
	$(CC) $(CFLAGS) -o aescrypt $(CRYPT_OBJ) $(LIBS) 

aesget: $(DECRYPT_OBJ)
	$(CC) $(CFLAGS) -o aesget $(DECRYPT_OBJ) $(LIBS) 

tobin: bin2hex.o dstring.o tobin.c
	$(CC) $(CFLAGS) -o tobin bin2hex.o dstring.o tobin.c $(LIBS)

# I'm keeping track of dependencies from the start, sigh. 

aescrypt.o: aescrypt.c bin2hex.o dorandom.o $(ALGORITHM).o
	$(CC) -c $(CFLAGS) aescrypt.c

aesget.o: aesget.c bin2hex.o $(ALGORITHM).o
	$(CC) -c $(CFLAGS) aesget.c

dorandom.o: dorandom.c dorandom.h
	$(CC) -c $(CFLAGS) dorandom.c

bin2hex.o: bin2hex.c bin2hex.h dstring.h
	$(CC) -c $(CFLAGS) bin2hex.c

$(ALGORITHM).o: $(ALGORITHM).c $(ALGORITHM).h aes.h $(ALG_TABLE) debug.h
	$(CC) -c $(CRYPTOFLAGS) $(ALGORITHM).c

dstring.o: dstring.c dstring.h
	$(CC) -c $(CFLAGS) dstring.c
