Makefile.am 4.18 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
			   serpent.h sha.h twofish.h \
			   yarrow.h
Niels Möller's avatar
Niels Möller committed
20
21
22

# FIXME: There's some confusion on - vs _ in source file names.
# My current belief is that the _-ones ought to be renamed.
23
24
libnettle_a_SOURCES = aes.c aes.h aes-internal.h \
		      aes-decrypt-table.c aes-decrypt.c \
25
		      aes-encrypt-table.c aes-encrypt.c \
26
		      aes-set-encrypt-key.c aes-set-decrypt-key.c aes-meta.c \
27
		      arcfour.c arcfour.h arcfour-meta.c \
28
                      base64-encode.c base64-decode.c base64-meta.c base64.h \
Niels Möller's avatar
Niels Möller committed
29
		      cast128.c cast128.h cast128_sboxes.h cast128-meta.c \
Niels Möller's avatar
Niels Möller committed
30
		      blowfish.h blowfish.c \
31
		      cbc.c cbc.h \
32
33
		      des.c des.h desinfo.h desCode.h \
		      des3.c des-compat.c des-compat.h \
34
35
		      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
36
37
38
39
		      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 \
40
		      yarrow.h yarrow256.c yarrow_key_event.c \
Niels Möller's avatar
Niels Möller committed
41
		      sexp.h sexp.c sexp_format.c sexp-transport.c \
42
		      bignum.h bignum.c bignum-random.c \
43
		      rsa.h rsa.c rsa_md5.c rsa_sha1.c \
44
		      rsa-encrypt.c rsa-decrypt.c \
45
		      rsa-keygen.c rsa-compat.h rsa-compat.c \
46
		      rsa2sexp.c sexp2rsa.c \
47
		      dsa.c dsa-sign.c dsa-verify.c dsa-keygen.c \
Niels Möller's avatar
Niels Möller committed
48
		      pgp.h pgp-encode.c rsa2openpgp.c \
49
		      buffer.h buffer.c \
50
51
		      nettle-meta.h \
		      nettle-internal.c nettle-internal.h nettle-openssl.c
Niels Möller's avatar
Niels Möller committed
52

Niels Möller's avatar
Niels Möller committed
53
libnettle_a_LIBADD = @LIBOBJS@
Niels Möller's avatar
Niels Möller committed
54

55
56
shadata_LDADD = -lm

57
58
59
60
info_TEXINFOS = nettle.texinfo

all-local: nettle.html

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

66
67
DISTCLEANFILES = aes.asm aes-decrypt.asm aes-encrypt.asm machine.m4

68
69
70
71
72
73
# 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

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

# 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)/'`$< >$@
81

82
83
# NOTE: We create an empty .deps-file, to make the make/automake
# dependency tracking happier.
84
85
86
87
%.$(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 $@
88
89
90
91
92
93
	echo >.deps/$*.Po

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

94
95
96
97
98
99
%_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

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

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

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

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

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

120
# desCore rules
121
122
123
# 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 
124
125

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

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