annotate Makefile.in @ 154:b4c6e7f276e9 libtomcrypt

Makefile.in: don't compile things we don't need
author Matt Johnston <matt@ucc.asn.au>
date Mon, 20 Dec 2004 14:46:40 +0000
parents c2b93763dac9
children 19e5d79b7190
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
1 # MAKEFILE for linux GCC
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
2 #
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 # Tom St Denis
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4 # Modified by Clay Culver
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6 # The version
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
7 VERSION=0.99
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
8
147
c2b93763dac9 Fixes for it to compile and work nicely with Dropbear.
Matt Johnston <matt@ucc.asn.au>
parents: 144
diff changeset
9 VPATH=@srcdir@
c2b93763dac9 Fixes for it to compile and work nicely with Dropbear.
Matt Johnston <matt@ucc.asn.au>
parents: 144
diff changeset
10 srcdir=@srcdir@
c2b93763dac9 Fixes for it to compile and work nicely with Dropbear.
Matt Johnston <matt@ucc.asn.au>
parents: 144
diff changeset
11
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12 # Compiler and Linker Names
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13 #CC=gcc
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 #LD=ld
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
15
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
16 # Archiver [makes .a files]
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
17 #AR=ar
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
18 #ARFLAGS=r
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
19
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
20 # Compilation flags. Note the += does not write over the user's CFLAGS!
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
21 # The rest of the flags come from the parent Dropbear makefile
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
22 CFLAGS += -c -I$(srcdir)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
23 # -Werror
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
24
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
25 # optimize for SPEED
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
26 #CFLAGS += -O3 -funroll-all-loops
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
27
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
28 #add -fomit-frame-pointer. hinders debugging!
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
29 #CFLAGS += -fomit-frame-pointer
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
30
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
31 # optimize for SIZE
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
32 #CFLAGS += -Os -DSMALL_CODE
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
33
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
34 # compile for DEBUGING (required for ccmalloc checking!!!)
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
35 #CFLAGS += -g3
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
36
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
37 #These flags control how the library gets built.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
38
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
39 #Output filenames for various targets.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
40 LIBNAME=libtomcrypt.a
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
41 HASH=hashsum
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
42 CRYPT=encrypt
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
43 SMALL=small
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
44 PROF=x86_prof
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
45 TV=tv_gen
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
46
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
47 #LIBPATH-The directory for libtomcrypt to be installed to.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
48 #INCPATH-The directory to install the header files for libtomcrypt.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
49 #DATAPATH-The directory to install the pdf docs.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
50 DESTDIR=
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
51 LIBPATH=/usr/lib
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
52 INCPATH=/usr/include
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
53 DATAPATH=/usr/share/doc/libtomcrypt/pdf
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
54
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
55 #List of objects to compile.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
56
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
57 #Leave MPI built-in or force developer to link against libtommath?
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
58 #MPIOBJECT=mpi.o
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
59 #Dropbear uses libtommath
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
60 MPIOBJECT=
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
61
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
62 OBJECTS=error_to_string.o mpi_to_ltc_error.o base64_encode.o base64_decode.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
63 \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
64 crypt.o crypt_find_cipher.o crypt_find_hash_any.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
65 crypt_hash_is_valid.o crypt_register_hash.o crypt_unregister_prng.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
66 crypt_argchk.o crypt_find_cipher_any.o crypt_find_hash_id.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
67 crypt_prng_descriptor.o crypt_register_prng.o crypt_cipher_descriptor.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
68 crypt_find_cipher_id.o crypt_find_prng.o crypt_prng_is_valid.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
69 crypt_unregister_cipher.o crypt_cipher_is_valid.o crypt_find_hash.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
70 crypt_hash_descriptor.o crypt_register_cipher.o crypt_unregister_hash.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
71 \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
72 rand_prime.o is_prime.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
73 \
154
b4c6e7f276e9 Makefile.in: don't compile things we don't need
Matt Johnston <matt@ucc.asn.au>
parents: 147
diff changeset
74 aes.o \
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
75 \
154
b4c6e7f276e9 Makefile.in: don't compile things we don't need
Matt Johnston <matt@ucc.asn.au>
parents: 147
diff changeset
76 blowfish.o des.o \
b4c6e7f276e9 Makefile.in: don't compile things we don't need
Matt Johnston <matt@ucc.asn.au>
parents: 147
diff changeset
77 twofish.o \
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
78 \
154
b4c6e7f276e9 Makefile.in: don't compile things we don't need
Matt Johnston <matt@ucc.asn.au>
parents: 147
diff changeset
79 md5.o sha1.o sha512.o \
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
80 \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
81 cbc_start.o cbc_encrypt.o cbc_decrypt.o cbc_getiv.o cbc_setiv.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
82 ecb_start.o ecb_encrypt.o ecb_decrypt.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
83 \
154
b4c6e7f276e9 Makefile.in: don't compile things we don't need
Matt Johnston <matt@ucc.asn.au>
parents: 147
diff changeset
84 hash_memory.o \
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
85 \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
86 hmac_done.o hmac_file.o hmac_init.o hmac_memory.o hmac_process.o hmac_test.o \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
87 \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
88 burn_stack.o zeromem.o \
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
89 \
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
90 $(MPIOBJECT)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
91
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
92 TESTOBJECTS=demos/test.o
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
93 HASHOBJECTS=demos/hashsum.o
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
94 CRYPTOBJECTS=demos/encrypt.o
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
95 SMALLOBJECTS=demos/small.o
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
96 PROFS=demos/x86_prof.o
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
97 TVS=demos/tv_gen.o
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
98
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
99 #Files left over from making the crypt.pdf.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
100 LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
101
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
102 #Compressed filenames
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
103 COMPRESSED=crypt-$(VERSION).tar.bz2 crypt-$(VERSION).zip
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
104
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
105 #Header files used by libtomcrypt.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
106 HEADERS=ltc_tommath.h mycrypt_cfg.h \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
107 mycrypt_misc.h mycrypt_prng.h mycrypt_cipher.h mycrypt_hash.h \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
108 mycrypt_macros.h mycrypt_pk.h mycrypt.h mycrypt_argchk.h \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
109 mycrypt_custom.h mycrypt_pkcs.h
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
110
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
111 #The default rule for make builds the libtomcrypt library.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
112 default:library
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
113
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
114 #ciphers come in two flavours... enc+dec and enc
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
115 aes_enc.o: aes.c aes_tab.c
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
116 $(CC) $(CFLAGS) -DENCRYPT_ONLY -c $(srcdir)/aes.c -o aes_enc.o
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
117
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
118 #These are the rules to make certain object files.
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
119 aes.o: aes.c aes_tab.c
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
120 twofish.o: twofish.c twofish_tab.c
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
121 whirl.o: whirl.c whirltab.c
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
122 ecc.o: ecc.c ecc_sys.c
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
123 dh.o: dh.c dh_sys.c
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
124 sha512.o: sha512.c sha384.c
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
125 sha256.o: sha256.c sha224.c
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
126
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
127 #This rule makes the libtomcrypt library.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
128 library: $(LIBNAME)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
129
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
130 $(LIBNAME): $(OBJECTS)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
131 $(AR) $(ARFLAGS) $@ $(OBJECTS)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
132 $(RANLIB) $@
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
133
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
134 #This rule makes the hash program included with libtomcrypt
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
135 hashsum: library $(HASHOBJECTS)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
136 $(CC) $(HASHOBJECTS) $(LIBNAME) -o $(HASH) $(WARN)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
137
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
138 #makes the crypt program
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
139 crypt: library $(CRYPTOBJECTS)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
140 $(CC) $(CRYPTOBJECTS) $(LIBNAME) -o $(CRYPT) $(WARN)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
141
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
142 #makes the small program
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
143 small: library $(SMALLOBJECTS)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
144 $(CC) $(SMALLOBJECTS) $(LIBNAME) -o $(SMALL) $(WARN)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
145
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
146 x86_prof: library $(PROFS)
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
147 $(CC) $(PROFS) $(LIBNAME) $(EXTRALIBS) -o $(PROF)
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
148
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
149 tv_gen: library $(TVS)
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
150 $(CC) $(TVS) $(LIBNAME) $(EXTRALIBS) -o $(TV)
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
151
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
152 #This rule installs the library and the header files. This must be run
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
153 #as root in order to have a high enough permission to write to the correct
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
154 #directories and to set the owner and group to root.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
155 install: library docs
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
156 install -d -g root -o root $(DESTDIR)$(LIBPATH)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
157 install -d -g root -o root $(DESTDIR)$(INCPATH)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
158 install -d -g root -o root $(DESTDIR)$(DATAPATH)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
159 install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
160 install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
161 install -g root -o root doc/crypt.pdf $(DESTDIR)$(DATAPATH)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
162
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
163 install_lib: library
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
164 install -d -g root -o root $(DESTDIR)$(LIBPATH)
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
165 install -d -g root -o root $(DESTDIR)$(INCPATH)
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
166 install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH)
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
167 install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH)
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
168
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
169 #This rule cleans the source tree of all compiled code, not including the pdf
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
170 #documentation.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
171 clean:
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
172 -rm -f $(OBJECTS) $(TESTOBJECTS) $(HASHOBJECTS) $(CRYPTOBJECTS) $(SMALLOBJECTS) $(LEFTOVERS) $(LIBNAME)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
173 -rm -f $(TEST) $(HASH) $(COMPRESSED) $(PROFS) $(PROF) $(TVS) $(TV)
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
174 -rm -f *.la *.lo *.o *.a *.dll *stackdump *.lib *.exe *.obj demos/*.obj demos/*.o *.bat *.txt *.il *.da demos/*.il demos/*.da *.dyn *.dpi \
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
175 *.gcda *.gcno demos/*.gcno demos/*.gcda *~ doc/*
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
176 -cd demos/test && make clean
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
177 -rm -rf .libs demos/.libs demos/test/.libs
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
178
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
179 #This builds the crypt.pdf file. Note that the rm -f *.pdf has been removed
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
180 #from the clean command! This is because most people would like to keep the
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
181 #nice pre-compiled crypt.pdf that comes with libtomcrypt! We only need to
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
182 #delete it if we are rebuilding it.
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
183 docs: crypt.tex
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
184 -rm -f doc/crypt.pdf $(LEFTOVERS)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
185 echo "hello" > crypt.ind
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
186 latex crypt > /dev/null
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
187 latex crypt > /dev/null
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
188 makeindex crypt.idx > /dev/null
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
189 latex crypt > /dev/null
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
190 dvipdf crypt
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
191 mv -ivf crypt.pdf doc/crypt.pdf
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
192 -rm -f $(LEFTOVERS)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
193
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
194 docdvi: crypt.tex
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
195 echo hello > crypt.ind
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
196 latex crypt > /dev/null
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
197 latex crypt > /dev/null
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
198 makeindex crypt.idx
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
199 latex crypt > /dev/null
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
200
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
201 #pretty build
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
202 pretty:
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
203 perl pretty.build
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
204
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
205 #for GCC 3.4+
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
206 profiled:
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
207 make clean
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
208 make CFLAGS="$(CFLAGS) -fprofile-generate" EXTRALIBS=-lgcov x86_prof
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
209 ./x86_prof
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
210 rm *.o *.a x86_prof
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
211 make CFLAGS="$(CFLAGS) -fprofile-use" EXTRALIBS=-lgcov x86_prof
138
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
212
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
213 #zipup the project (take that!)
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
214 zipup: clean docs
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
215 cd .. ; rm -rf crypt* libtomcrypt-$(VERSION) ; mkdir libtomcrypt-$(VERSION) ; \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
216 cp -R ./libtomcrypt/* ./libtomcrypt-$(VERSION)/ ; tar -c libtomcrypt-$(VERSION)/* > crypt-$(VERSION).tar ; \
b1edc9158f6c Pristine compilation works
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
217 bzip2 -9vv crypt-$(VERSION).tar ; zip -9 -r crypt-$(VERSION).zip libtomcrypt-$(VERSION)/* ; \
144
7ed585a2c53b propagate of 3f8f752126017cbe7d93c4086c27a91550df745f and 747ebf284d40a15b338e5a5c7730ecec6eade3d7 from branch 'au.asn.ucc.matt.ltc-orig' to 'au.asn.ucc.matt.ltc-db'
Matt Johnston <matt@ucc.asn.au>
parents: 138
diff changeset
218 gpg -b -a crypt-$(VERSION).tar.bz2 ; gpg -b -a crypt-$(VERSION).zip