Makefile.in 2.13 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
TARGETS = nettle-benchmark$(EXEEXT) @RSA_EXAMPLES@
15 16
SOURCES = nettle-benchmark.c nettle-openssl.c \
	io.c getopt.c getopt1.c \
17
	rsa-encrypt.c rsa-decrypt.c rsa-keygen.c rsa-sign.c rsa-verify.c
18

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

21 22 23
TS_ALL = rsa-sign-test rsa-verify-test rsa-encrypt-test

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

all: $(TARGETS)

.c.$(OBJEXT):
29
	$(COMPILE) -c $< && $(DEP_PROCESS)
30

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

rsa-sign$(EXEEXT): rsa-sign.$(OBJEXT)
	$(LINK) rsa-sign.$(OBJEXT) io.$(OBJEXT) \
	-lnettle $(LIBS) -o rsa-sign$(EXEEXT)

rsa-verify$(EXEEXT): rsa-verify.$(OBJEXT)
	$(LINK) rsa-verify.$(OBJEXT) io.$(OBJEXT) \
	-lnettle $(LIBS) -o rsa-verify$(EXEEXT)

Niels Möller's avatar
Niels Möller committed
44 45
rsa-encrypt$(EXEEXT): rsa-encrypt.$(OBJEXT) $(GETOPT_OBJS)
	$(LINK) rsa-encrypt.$(OBJEXT) io.$(OBJEXT) $(GETOPT_OBJS) \
46 47 48 49 50 51
	-lnettle $(LIBS) -o rsa-encrypt$(EXEEXT)

rsa-decrypt$(EXEEXT): rsa-decrypt.$(OBJEXT)
	$(LINK) rsa-decrypt.$(OBJEXT) io.$(OBJEXT) \
	-lnettle $(LIBS) -o rsa-decrypt$(EXEEXT)

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

56
$(TARGETS) : io.$(OBJEXT) ../libnettle.a
57 58 59 60 61 62 63 64 65


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/$@

66
install uninstall:
67 68 69
	true

distdir: $(DISTFILES)
70
	cp $? $(distdir)
71 72

clean:
73
	-rm -f $(TARGETS) *.$(OBJEXT)
74 75

distclean: clean
76
	-rm -f Makefile *.d
77

78 79 80
tags:
	etags --include $(top_srcdir) $(srcdir)/*.c $(srcdir)/*.h

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