Makefile.in 2.62 KB
Newer Older
1 2 3 4 5 6 7 8 9
@SET_MAKE@

srcdir = @srcdir@
VPATH = @srcdir@

top_srcdir = @top_srcdir@

include ../config.make

10 11
PRE_CPPFLAGS = -I.. -I$(top_srcdir)
PRE_LDFLAGS = -L..
12

13
OPENSSL_LIBFLAGS = @OPENSSL_LIBFLAGS@
14 15 16
RSA_TARGETS = rsa-keygen$(EXEEXT) rsa-sign$(EXEEXT) \
	      rsa-verify$(EXEEXT) rsa-encrypt$(EXEEXT) rsa-decrypt$(EXEEXT)
TARGETS = nettle-benchmark$(EXEEXT) @IF_HOGWEED@ $(RSA_TARGETS)
17
SOURCES = nettle-benchmark.c nettle-openssl.c \
18
	io.c read_rsa_key.c getopt.c getopt1.c \
19
	rsa-encrypt.c rsa-decrypt.c rsa-keygen.c rsa-sign.c rsa-verify.c
20

Niels Möller's avatar
Niels Möller committed
21 22
GETOPT_OBJS = getopt.$(OBJEXT) getopt1.$(OBJEXT)

23 24 25
TS_ALL = rsa-sign-test rsa-verify-test rsa-encrypt-test

DISTFILES= $(SOURCES) Makefile.in $(TS_ALL) run-tests setup-env teardown-env \
26
	io.h rsa-session.h getopt.h
27 28 29 30

all: $(TARGETS)

.c.$(OBJEXT):
31
	$(COMPILE) -c $< && $(DEP_PROCESS)
32

33
# For Solaris and BSD make, we have to use an explicit rule for each executable
Niels Möller's avatar
Niels Möller committed
34 35
rsa-keygen$(EXEEXT): rsa-keygen.$(OBJEXT) $(GETOPT_OBJS)
	$(LINK) rsa-keygen.$(OBJEXT) io.$(OBJEXT) $(GETOPT_OBJS) \
36
	-lhogweed -lnettle $(LIBS) -o rsa-keygen$(EXEEXT)
37

38 39 40
rsa-sign$(EXEEXT): rsa-sign.$(OBJEXT) read_rsa_key.$(OBJEXT)
	$(LINK) rsa-sign.$(OBJEXT) io.$(OBJEXT) read_rsa_key.$(OBJEXT) \
	-lhogweed -lnettle $(LIBS) -o rsa-sign$(EXEEXT)
41

42 43 44
rsa-verify$(EXEEXT): rsa-verify.$(OBJEXT) read_rsa_key.$(OBJEXT)
	$(LINK) rsa-verify.$(OBJEXT) io.$(OBJEXT) read_rsa_key.$(OBJEXT) \
	-lhogweed -lnettle $(LIBS) -o rsa-verify$(EXEEXT)
45

46 47 48 49
rsa-encrypt$(EXEEXT): rsa-encrypt.$(OBJEXT) read_rsa_key.$(OBJEXT) $(GETOPT_OBJS)
	$(LINK) rsa-encrypt.$(OBJEXT) io.$(OBJEXT) read_rsa_key.$(OBJEXT) \
	$(GETOPT_OBJS) \
	-lhogweed -lnettle $(LIBS) -o rsa-encrypt$(EXEEXT)
50

51 52 53
rsa-decrypt$(EXEEXT): rsa-decrypt.$(OBJEXT) read_rsa_key.$(OBJEXT)
	$(LINK) rsa-decrypt.$(OBJEXT) io.$(OBJEXT) read_rsa_key.$(OBJEXT) \
	-lhogweed -lnettle $(LIBS) -o rsa-decrypt$(EXEEXT)
54

Niels Möller's avatar
Niels Möller committed
55 56
nettle-benchmark$(EXEEXT): nettle-benchmark.$(OBJEXT) nettle-openssl.$(OBJEXT) $(GETOPT_OBJS)
	$(LINK) nettle-benchmark.$(OBJEXT) nettle-openssl.$(OBJEXT) io.$(OBJEXT) $(GETOPT_OBJS) \
57
	-lnettle $(LIBS) $(OPENSSL_LIBFLAGS) -o $@
58

59
$(TARGETS) : io.$(OBJEXT) ../libnettle.a
60 61 62 63 64 65 66 67 68


check: $(TS_ALL)
	LD_LIBRARY_PATH=../.lib srcdir="$(srcdir)" \
	  "$(srcdir)"/run-tests $(TS_ALL)

Makefile: $(srcdir)/Makefile.in ../config.status
	cd .. && $(SHELL) ./config.status examples/$@

69
install uninstall:
70 71
	true

Niels Möller's avatar
Niels Möller committed
72 73
# NOTE: I'd like to use $^, but that's a GNU extension. $? should be
# more portable, equivalent for phony targets.
74
distdir: $(DISTFILES)
75
	cp $? $(distdir)
76 77

clean:
78
	-rm -f $(TARGETS) *.$(OBJEXT)
79 80

distclean: clean
81
	-rm -f Makefile *.d
82

83 84 85
tags:
	etags --include $(top_srcdir) $(srcdir)/*.c $(srcdir)/*.h

86
@DEP_INCLUDE@ $(SOURCES:.c=.$(OBJEXT).d)