summaryrefslogtreecommitdiff
path: root/libdes/Imakefile
blob: 2822baf17260496791c3a11440b1212d47e39367 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# $Id$
#
# Copyright 1987, 1993 by the Massachusetts Institute of Technology.
#
# For copying and distribution information,
# please see the file <mit-copyright.h>.
#
# Imakefile for DES library
#

all:: $(BINC)/des.h

$(BINC)/des.h: des.h
	$(RM) $@; $(CP) des.h $@

#ifdef MIT_DES
OTHEROBJS= cbc_encrypt.o cksum.o pcbc_encrypt.o make_key_sched.o des.o \
	key_parity.o
#else
OTHEROBJS= f_cbc.o f_cksum.o f_pcbc.o f_sched.o f_ecb.o f_parity.o f_tables.o
#endif
DESOBJS= $(OTHEROBJS) key_sched.o debug_decl.o \
	quad_cksum.o random_key.o read_password.o \
	string_to_key.o weak_key.o new_rnd_key.o util.o $(OLDOBJS)

#ifdef ATHENA_RULES

build_library(des,$(DESOBJS))

build_program(enc,enc.o libdes.a,,)
build_program(destest,destest.o libdes.a,,)
build_program(verify,verify.o libdes.a,,)

#ifdef MIT_DES
build_program(make_key_perm,make_key_perm.o misc.o,,)
build_program(make_odd,make_odd.o misc.o,,)
build_program(make_p_table,make_p_table.o misc.o,,)
build_program(make_s_table,make_s_table.o misc.o,,)
build_program(make_p,make_p.o misc.o,,)
build_program(make_fp,make_fp.o misc.o,,)
build_program(make_ip,make_ip.o misc.o,,)

key_perm.h:	make_key_perm
	./make_key_perm key_perm.h
odd.h:	make_odd
	./make_odd odd.h
p_table.h:	make_p_table
	./make_p_table p_table.h
s_table.h:	make_s_table
	./make_s_table s_table.h
p.c:	make_p
	./make_p p.c
fp.c:	make_fp
	./make_fp fp.c
ip.c:	make_ip
	./make_ip ip.c

clean::
	$(RM) ip.c fp.c p.c s_table.h p_table.h odd.h key_perm.h

key_parity.o: odd.h
key_sched.o: key_perm.h
des.o: s_table.h p_table.h ip.c fp.c p.c
misc.o: des_internal.h

make_s_table:: tables.h des_internal.h
make_p_table:: tables.h des_internal.h
make_key_perm:: des_internal.h
make_s:: s_table.h des_internal.h
#endif

#else /* ATHENA_RULES */

#ifdef OLD_COMPAT
OLDSRCS= desglue.c
OLDOBJS= desglue.o
#else
OLDSRCS=
OLDOBJS=
#endif
DESSRCS= key_sched.c des.c cbc_encrypt.c pcbc_encrypt.c debug_decl.c \
	cksum.c quad_cksum.c random_key.c read_password.c \
	string_to_key.c weak_key.c key_parity.c new_rnd_key.c util.c $(OLDSRCS)

SRCS=   des_internal.h make_key_perm.c make_ip.c make_fp.c make_e.c make_p.c make_s.c \
	make_s_table.c make_p_table.c make_odd.c misc.c \
	key_test.c testit.c verify.c epc_encrypt.c \
	cbc_noop.c enc.c ${DESSRCS}

SRCDIR=$(SRCTOP)/lib/des
CODE=$(SRCS) Imakefile tables.h des.vaxasm

library_obj_rule()

install_library_target(des,$(DESOBJS),$(DESSRCS),)

library_ro_object(dbg_prt)

/* add other assembler versions here, if you come up with them. */
#ifdef VAXASM
library_asm_object(des.o,des.vaxasm)
#else
library_ro_object(des)
library_ro_object(key_sched)
#endif
/*
 * misc.o is used by all of the header generators.
 */

host_simple_object(misc.o,misc.c)
/*
 * Generate include files for use by key_sched & friends.
 */

generate_depend(key_perm.h,make_key_perm,misc.o)
generate_depend(odd.h,make_odd,misc.o)
generate_depend(p_table.h,make_p_table,misc.o)
generate_depend(s_table.h,make_s_table,misc.o)
generate_depend(p.c,make_p,misc.o)
generate_depend(fp.c,make_fp,misc.o)
generate_depend(ip.c,make_ip,misc.o)

misc.o: des_internal.h
make_s_table: tables.h des_internal.h
make_p_table: tables.h des_internal.h
make_key_perm: des_internal.h
make_s: s_table.h des_internal.h


/*
 * verify that the library correctly implements the DES standard.  
 * Run this after any change to the source.
 */

test(verify,libdes.a,)
test(key_test,libdes.a,)
test(testit,libdes.a,)

#endif /* ATHENA_RULES */