Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 $
  3. SOLARIS_CFLAGS=-Wall -pedantic -g -O2
  4. SOLARIS_LIBS=-lxnet
  5. LINUX_CFLAGS=-Wall -pedantic -g -O2
  6. LINUX_LIBS=
  7. auto-all:
  8. case `uname -s` in \
  9. SunOS) echo Using SunOS configuration; \
  10. make SYSCFLAGS="$(SOLARIS_CFLAGS)" SYSLIBS="$(SOLARIS_LIBS)" all;; \
  11. Linux) echo Using Linux configuration; \
  12. make SYSCFLAGS="$(LINUX_CFLAGS)" SYSLIBS="$(LINUX_LIBS)" all;; \
  13. *) echo "unknown system"; exit 1;; \
  14. esac
  15. all: test TAGS
  16. # For adapting this Makefile to a different system, only the following
  17. # definitions should need customizing:
  18. OPENSSLDIR=../..
  19. CC=gcc
  20. SYSCFLAGS=whatever
  21. SYSLIBS=whatever
  22. #############################################################################
  23. #
  24. # SSLeay/OpenSSL imports
  25. #
  26. # OPENSSLDIR (set above) can be either the directory where OpenSSL is
  27. # installed or the directory where it was compiled.
  28. # We rely on having a new OpenSSL release where include files
  29. # have names like <openssl/ssl.h> (not just <ssl.h>).
  30. OPENSSLINCLUDES=-I$(OPENSSLDIR)/include
  31. # libcrypto.a and libssl.a are directly in $(OPENSSLDIR) if this is
  32. # the compile directory, or in $(OPENSSLDIR)/lib if we use an installed
  33. # library. With the following definition, we can handle either case.
  34. OPENSSLLIBS=-L$(OPENSSLDIR) -L$(OPENSSLDIR)/lib -lssl -lcrypto
  35. #############################################################################
  36. #
  37. # Stuff for handling the source files
  38. #
  39. SOURCES=easy-tls.c test.c
  40. HEADERS=easy-tls.h test.h
  41. DOCSandEXAMPLESetc=Makefile cert.pem cacerts.pem
  42. EVERYTHING=$(SOURCES) $(HEADERS) $(DOCSandEXAMPLESetc)
  43. ls: ls-l
  44. ls-l:
  45. ls -l $(EVERYTHING)
  46. # For RCS:
  47. tag:
  48. -rcs -n_`date +%y%m%d`: $(EVERYTHING)
  49. rcs -nMYTAG $(EVERYTHING)
  50. rcs -nMYTAG: $(EVERYTHING)
  51. diff:
  52. -rcsdiff -rMYTAG -u $(EVERYTHING)
  53. today:
  54. -rcsdiff -r_`date +%y%m%d` -u $(EVERYTHING)
  55. ident:
  56. for a in $(EVERYTHING); do ident $$a; done
  57. # Distribution .tar:
  58. easy-tls.tar.gz: $(EVERYTHING)
  59. tar cvf - $(EVERYTHING) | \
  60. gzip -9 > easy-tls.tar.gz
  61. # Working .tar:
  62. tls.tgz: $(EVERYTHING)
  63. tar cfv - `find . -type f -a ! -name '*.tgz' -a ! -name '*.tar.gz'` | \
  64. gzip -9 > tls.tgz
  65. # For emacs:
  66. etags: TAGS
  67. TAGS: $(SOURCES) $(HEADERS)
  68. -etags $(SOURCES) $(HEADERS)
  69. #############################################################################
  70. #
  71. # Compilation
  72. #
  73. # The following definitions are system dependent (and hence defined
  74. # at the beginning of this Makefile, where they are more easily found):
  75. ### CC=gcc
  76. ### SYSCFLAGS=-Wall -pedantic -g -O2
  77. ### SYSLIBS=-lxnet
  78. EXTRACFLAGS=-DTLS_APP=\"test.h\"
  79. # EXTRACFLAGS=-DTLS_APP=\"test.h\" -DDEBUG_TLS
  80. #
  81. # The rest shouldn't need to be touched.
  82. #
  83. LDFLAGS=$(SYSLIBS) $(OPENSSLLIBS)
  84. INCLUDES=$(OPENSSLINCLUDES)
  85. CFLAGS=$(SYSCFLAGS) $(EXTRACFLAGS) $(INCLUDES)
  86. OBJS=easy-tls.o test.o
  87. clean:
  88. @rm -f test
  89. @rm -f TAGS
  90. @rm -f *.o
  91. @rm -f core
  92. test: $(OBJS)
  93. $(CC) $(OBJS) $(LDFLAGS) -o test
  94. test.o: $(HEADERS)
  95. easy-tls.o: $(HEADERS)