1 # Makefile for easy-tls example application (rudimentary client and server)
2 # $Id: Makefile,v 1.2 2001/09/18 09:15:40 bodo Exp $
4 SOLARIS_CFLAGS=-Wall -pedantic -g -O2
7 LINUX_CFLAGS=-Wall -pedantic -g -O2
13 SunOS) echo Using SunOS configuration; \
14 make SYSCFLAGS="$(SOLARIS_CFLAGS)" SYSLIBS="$(SOLARIS_LIBS)" all;; \
15 Linux) echo Using Linux configuration; \
16 make SYSCFLAGS="$(LINUX_CFLAGS)" SYSLIBS="$(LINUX_LIBS)" all;; \
17 *) echo "unknown system"; exit 1;; \
22 # For adapting this Makefile to a different system, only the following
23 # definitions should need customizing:
32 #############################################################################
34 # SSLeay/OpenSSL imports
36 # OPENSSLDIR (set above) can be either the directory where OpenSSL is
37 # installed or the directory where it was compiled.
39 # We rely on having a new OpenSSL release where include files
40 # have names like <openssl/ssl.h> (not just <ssl.h>).
41 OPENSSLINCLUDES=-I$(OPENSSLDIR)/include
43 # libcrypto.a and libssl.a are directly in $(OPENSSLDIR) if this is
44 # the compile directory, or in $(OPENSSLDIR)/lib if we use an installed
45 # library. With the following definition, we can handle either case.
46 OPENSSLLIBS=-L$(OPENSSLDIR) -L$(OPENSSLDIR)/lib -lssl -lcrypto
49 #############################################################################
51 # Stuff for handling the source files
54 SOURCES=easy-tls.c test.c
55 HEADERS=easy-tls.h test.h
56 DOCSandEXAMPLESetc=Makefile cert.pem cacerts.pem
57 EVERYTHING=$(SOURCES) $(HEADERS) $(DOCSandEXAMPLESetc)
64 -rcs -n_`date +%y%m%d`: $(EVERYTHING)
65 rcs -nMYTAG $(EVERYTHING)
66 rcs -nMYTAG: $(EVERYTHING)
68 -rcsdiff -rMYTAG -u $(EVERYTHING)
70 -rcsdiff -r_`date +%y%m%d` -u $(EVERYTHING)
72 for a in $(EVERYTHING); do ident $$a; done
75 easy-tls.tar.gz: $(EVERYTHING)
76 tar cvf - $(EVERYTHING) | \
77 gzip -9 > easy-tls.tar.gz
80 tls.tgz: $(EVERYTHING)
81 tar cfv - `find . -type f -a ! -name '*.tgz' -a ! -name '*.tar.gz'` | \
86 TAGS: $(SOURCES) $(HEADERS)
87 -etags $(SOURCES) $(HEADERS)
90 #############################################################################
94 # The following definitions are system dependent (and hence defined
95 # at the beginning of this Makefile, where they are more easily found):
98 ### SYSCFLAGS=-Wall -pedantic -g -O2
101 EXTRACFLAGS=-DTLS_APP=\"test.h\"
102 # EXTRACFLAGS=-DTLS_APP=\"test.h\" -DDEBUG_TLS
105 # The rest shouldn't need to be touched.
107 LDFLAGS=$(SYSLIBS) $(OPENSSLLIBS)
108 INCLUDES=$(OPENSSLINCLUDES)
109 CFLAGS=$(SYSCFLAGS) $(EXTRACFLAGS) $(INCLUDES)
111 OBJS=easy-tls.o test.o
120 $(CC) $(OBJS) $(LDFLAGS) -o test
123 easy-tls.o: $(HEADERS)