Makefile.am 4.05 KB
Newer Older
1
SUBDIRS = . testsuite examples
Niels Möller's avatar
Niels Möller committed
2

Niels Möller's avatar
Niels Möller committed
3
noinst_PROGRAMS = aesdata desdata shadata
4

5
6
libnettleincludedir = $(includedir)/nettle

Niels Möller's avatar
Niels Möller committed
7
lib_LIBRARIES = libnettle.a
Niels Möller's avatar
Niels Möller committed
8
libnettleinclude_HEADERS = aes.h arcfour.h blowfish.h \
9
			   base64.h buffer.h cast128.h \
10
			   cbc.h \
11
			   des.h des-compat.h dsa.h \
12
			   hmac.h \
13
			   knuth-lfib.h \
14
			   md5.h md5-compat.h \
Niels Möller's avatar
Niels Möller committed
15
16
			   nettle-meta.h \
			   pgp.h rsa.h \
Niels Möller's avatar
Niels Möller committed
17
			   sexp.h \
18
19
20
			   serpent.h sha.h twofish.h \
			   yarrow.h
			   
21
22
libnettle_a_SOURCES = aes.c aes.h aes-internal.h \
		      aes-decrypt-table.c aes-decrypt.c \
23
		      aes-encrypt-table.c aes-encrypt.c \
24
		      aes-set-encrypt-key.c aes-set-decrypt-key.c aes-meta.c \
25
		      arcfour.c arcfour.h arcfour-meta.c \
26
                      base64-encode.c base64-decode.c base64-meta.c base64.h \
Niels Möller's avatar
Niels Möller committed
27
		      cast128.c cast128.h cast128_sboxes.h cast128-meta.c \
Niels Möller's avatar
Niels Möller committed
28
		      blowfish.h blowfish.c \
29
		      cbc.c cbc.h \
30
31
		      des.c des.h desinfo.h desCode.h \
		      des3.c des-compat.c des-compat.h \
32
33
		      hmac.c hmac.h hmac-md5.c hmac-sha1.c \
		      knuth-lfib.c knuth-lfib.h \
Niels Möller's avatar
Niels Möller committed
34
35
36
37
		      md5.c md5.h md5-compat.c md5-compat.h md5-meta.c \
		      sha.h sha1.c sha1-meta.c sha256.c sha256-meta.c \
		      serpent.c serpent.h serpent_sboxes.h serpent-meta.c \
		      twofish.c twofish.h twofish-meta.c \
38
		      yarrow.h yarrow256.c yarrow_key_event.c \
39
		      sexp.h sexp.c sexp_format.c \
40
		      bignum.h bignum.c bignum-random.c \
41
		      rsa.h rsa.c rsa_md5.c rsa_sha1.c \
42
		      rsa-encrypt.c rsa-decrypt.c \
43
		      rsa-keygen.c rsa-compat.h rsa-compat.c \
44
		      rsa2sexp.c sexp2rsa.c \
45
		      dsa.c dsa-sign.c dsa-verify.c dsa-keygen.c \
Niels Möller's avatar
Niels Möller committed
46
		      pgp.h pgp-encode.c rsa2openpgp.c \
47
		      buffer.h buffer.c \
48
49
		      nettle-meta.h \
		      nettle-internal.c nettle-internal.h nettle-openssl.c
Niels Möller's avatar
Niels Möller committed
50

Niels Möller's avatar
Niels Möller committed
51
libnettle_a_LIBADD = @LIBOBJS@
Niels Möller's avatar
Niels Möller committed
52

53
54
shadata_LDADD = -lm

55
56
57
58
info_TEXINFOS = nettle.texinfo

all-local: nettle.html

59
EXTRA_DIST = macros.h memxor.h $(des_headers) descore.README nettle.html \
60
61
62
	.bootstrap $(des_headers) \
	sparc/aes.asm sparc/machine.m4 \
	x86/aes.asm x86/aes_tables.asm
63

64
65
DISTCLEANFILES = aes.asm aes-decrypt.asm aes-encrypt.asm machine.m4

66
67
68
69
70
71
# Using assembler files. Should get precedence before the .c.o rule.
SUFFIXES = .asm

# can be overridden during development, eg. "make RM_TMP=: aes.o"
RM_TMP = rm -f

72
# FIXME: How to write this without using GNU make features?
73
74
75
76
77
78

# NOTE: We have to use an explicit rule .asm -> .o, to override the .c
# -> .o rule. Using rules involving .s doesn't seem to work.
# %.s: %.asm asm.m4 machine.m4 config.m4
# 	$(M4) $(srcdir)/asm.m4 machine.m4 config.m4 \
# 		`test -f $< || echo '$(srcdir)/'`$< >$@
79

80
81
# NOTE: We create an empty .deps-file, to make the make/automake
# dependency tracking happier.
82
83
84
85
%.$(OBJEXT): %.asm asm.m4 machine.m4 config.m4
	$(M4) $(srcdir)/asm.m4 machine.m4 config.m4 \
		`test -f $< || echo '$(srcdir)/'`$< >$*.s
	$(COMPILE) -c $*.s -o $@
86
87
88
89
90
91
	echo >.deps/$*.Po

# Shared library rules
all-local: $(SHLIBTARGET)
install-data-local: $(SHLIBINSTALL)

92
93
94
95
96
97
%_p.$(OBJEXT): %.asm asm.m4 machine.m4 config.m4
	$(M4) $(srcdir)/asm.m4 machine.m4 config.m4 \
		`test -f $< || echo '$(srcdir)/'`$< >$*.s
	$(COMPILE) -c $*.s -o $@
	echo >.deps/$*.Po

98
99
100
101
# Assembler files must contain only PIC-clean code.
%_p.$(OBJEXT): %.c
	$(COMPILE) $(SHLIBCFLAGS) -c $< -o $@

102
SHLIBOBJECTS = $(patsubst %.$(OBJEXT),%_p.$(OBJEXT),$(am_libnettle_a_OBJECTS) $(LIBOBJS))
103
104
105
106
107
108
109
110
111
112

$(SHLIBFORLINK): $(SHLIBOBJECTS)
	$(SHLIBLINK) $^ -o $@

install-shared: $(SHLIBFORLINK)
	$(INSTALL_DATA) $(SHLIBFORLINK) $(DESTDIR)$(libdir)/$(SHLIBFILE)
	(cd $(DESTDIR)$(libdir) \
		&& ln -sf $(SHLIBFILE) $(SHLIBSONAME) \
		&& ln -sf $(SHLIBFILE) $(SHLIBFORLINK) )

113
114
115
116
117
%.html : %.texinfo
	(cd $(srcdir) \
	 && $(MAKEINFO) --html --no-split --output $@T $(<F) \
	 ; test -s $@T && mv -f $@T $@)

118
# desCore rules
119
120
121
# It seems using $(srcdir)/ doesn't work with GNU make 3.79.1
# des_headers = $(srcdir)/parity.h $(srcdir)/rotors.h $(srcdir)/keymap.h 
des_headers = parity.h rotors.h keymap.h 
122
123

# Generate DES headers.
124
125
$(des_headers): desdata.c
	$(MAKE) desdata
126
	./desdata $(@F) > $@T
127
128
129
	test -s $@T && mv -f $@T $@

des.o: des.c des.h $(des_headers)