1# Makefile for aescrypt
2# Copyright 2000 Enhanced Software Technologies Inc.
3# All Rights Reserved
4#
5# Released for public use under the BSD license.
6# see file LICENSE for details.
7#
8# RCS CHANGE LOG
9# $Log: Makefile.in,v $
10# Revision 1.1.1.1  2001/05/17 17:10:58  elgreen
11# Initial checkin
12#
13# Revision 1.12  2000/12/12 16:41:21  eric
14# aescrypt 0.6 (large patch by Peter Pentchev).
15#
16# Revision 1.11  2000/12/11 23:10:59  eric
17# version 0.5
18#
19# Revision 1.10  2000/10/30 22:37:10  randy
20# Added tobin copy to installbc rule
21#
22# Revision 1.9  2000/10/14 21:48:59  randy
23# Added remove of 'tobin' to clean rule
24#
25# Revision 1.8  2000/10/12 21:38:17  randy
26# Support for end-to-end client authorization (DB, remote agents)
27#
28# Revision 1.7  2000/10/11 18:24:04  randy
29# Documentation updates
30#
31# Revision 1.6  2000/10/10 23:40:59  randy
32# Integrate the Rijndael algorithm in place of the Twofish algorithm for
33# our AES package.  Changed crypt and get to no longer call the Twofish
34# specific (but much more efficient) reKey subroutine.  Ah, well, it's not
35# like we're running on Apple ][s anymore, eh?
36#
37# Revision 1.5  2000/08/03 22:05:34  eric
38# Added ability to accept '-' as arg to -k to indicate that the password
39# is the first 33 chars of stdin (32 hex chars + terminator). Removed
40# reference to Dr. Gladman's encryption routines, added reference to
41# Counterpane's encryption routines.
42#
43# Revision 1.4  2000/05/05 20:56:49  eric
44# Modifications for getting 'kk=' string out of the server config files.
45#
46# Revision 1.3  2000/04/24 20:01:54  eric
47# Fixed install prefix :-(
48#
49# Revision 1.2  2000/04/24 19:46:57  eric
50# More autoconf tweaks. Changed to using Counterpane's TwoFish rather than
51# Dr. Gladman's TwoFish in an attempt to fix the big endian/little endian
52# problems once and for all.
53#
54# Revision 1.2  2000/04/05 22:09:19  eric
55# Daily checkin...
56#
57# Revision 1.1  2000/03/28 23:54:28  eric
58# Initial checkin -- aescrypt/aesget
59#
60#
61# $Date: 2001/05/17 17:10:58 $
62#
63
64# Genericizing the makefile to support changes in supported encryption.
65# Rijndael was picked by NIST, but there's still a remote chance that
66# could change.
67
68ALGORITHM=rijndael
69# ALGORITHM=twofish2
70ALG_TABLE=rijndael-boxes.dat
71# ALG_TABLE=table.h
72
73VERSION=0.6
74
75CC=@CC@        # set the C compiler to gcc for most platforms. This is
76               # set to pgcc for Mandrake 6.1 due to irritating colorgcc.
77
78BINOWN?=	root
79BINGRP?=	root
80BINMODE?=	555
81
82SHAREOWN?=	${BINOWN}
83SHAREGRP?=	${BINGRP}
84SHAREMODE?=	444
85
86INSTALL?=	install
87COPY?=		-c
88STRIP?=		-s
89
90INSTALL_PROGRAM?=	${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
91INSTALL_DATA?=		${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
92
93GZIP=gzip -c -9
94RM=rm -f
95
96LIBS=
97
98COMMON_OBJ=aescmdline.o bin2hex.o $(ALGORITHM).o dstring.o
99
100CRYPT_OBJ=aescrypt.o dorandom.o $(COMMON_OBJ)
101
102DECRYPT_OBJ=aesget.o $(COMMON_OBJ)
103
104SRC=aescrypt.c bin2hex.c dorandom.c (ALGORITHM).c dstring.c
105
106#CFLAGS=-g -O2
107CFLAGS?=-g -Wall -W
108
109CRYPTOFLAGS=-Wall -W -O2 -DSTRICT_ALIGN=0
110
111all: aescrypt aesget tobin aescrypt.1.gz aesget.1.gz
112
113distclean: clean
114	rm -f Makefile config.cache config.h config.log config.status
115
116clean:
117	rm -f *.o *~ aescrypt aesget tobin *.1.gz
118
119dist:	distclean
120	./makedist $(VERSION)
121
122
123install:
124	${INSTALL_PROGRAM} aescrypt aesget @prefix@/bin/
125	${INSTALL_DATA} aescrypt.1.gz aesget.1.gz @prefix@/man/man1/
126
127installbc:
128	@cp aescrypt /bru/aserv/exec
129	@cp aesget /bru/aserv/exec
130	@cp tobin /bru/aserv/exec
131
132aescrypt: $(CRYPT_OBJ)
133	$(CC) $(CFLAGS) -o aescrypt $(CRYPT_OBJ) $(LIBS)
134
135aescrypt.1.gz:	aescrypt.1
136	$(GZIP) aescrypt.1 > aescrypt.1.gz || $(RM) aescrypt.1.gz
137
138aesget: $(DECRYPT_OBJ)
139	$(CC) $(CFLAGS) -o aesget $(DECRYPT_OBJ) $(LIBS)
140
141aesget.1.gz:	aesget.1
142	$(GZIP) aesget.1 > aesget.1.gz || $(RM) aesget.1.gz
143
144tobin: bin2hex.o dstring.o tobin.c
145	$(CC) $(CFLAGS) -o tobin bin2hex.o dstring.o tobin.c $(LIBS)
146
147# I'm keeping track of dependencies from the start, sigh.
148
149aescrypt.o: aescrypt.c aescmdline.o bin2hex.o dorandom.o $(ALGORITHM).o
150	$(CC) -c $(CFLAGS) aescrypt.c
151
152aesget.o: aesget.c aescmdline.o bin2hex.o $(ALGORITHM).o
153	$(CC) -c $(CFLAGS) aesget.c
154
155aescmdline.o: aescmdline.c aes.h aescmdline.h bin2hex.h dstring.h
156	$(CC) -c $(CFLAGS) aescmdline.c
157
158dorandom.o: dorandom.c dorandom.h
159	$(CC) -c $(CFLAGS) dorandom.c
160
161bin2hex.o: bin2hex.c bin2hex.h dstring.h
162	$(CC) -c $(CFLAGS) bin2hex.c
163
164$(ALGORITHM).o: $(ALGORITHM).c $(ALGORITHM).h aes.h $(ALG_TABLE) debug.h
165	$(CC) -c $(CRYPTOFLAGS) $(ALGORITHM).c
166
167dstring.o: dstring.c dstring.h
168	$(CC) -c $(CFLAGS) dstring.c
169