ssl/tls: add proper const attributes to functions, context members
[tropicssl.git] / library / Makefile
blob41b74cc6fc154e94df0c95d7bdf10bf5f96382ca
2 # Also see "include/tropicssl/config.h"
4 # Suggested value for TROPICSSL_CFLAGS_EXTRA_WARNINGS to pass
5 # on the command line, for gcc (GCC) 4.4.6 20120305
6 # (Red Hat 4.4.6-4):
8 # make all 'TROPICSSL_CFLAGS_EXTRA_WARNINGS= -Wextra -Wformat=2
9 # -fstrict-aliasing -Wstrict-aliasing -Wfloat-equal
10 # -Wundef -Wpointer-arith -Wbad-function-cast
11 # -Wcast-qual -Wcast-align -Wwrite-strings -Waddress
12 # -Waggregate-return -Wstrict-prototypes
13 # -Wold-style-declaration -Wold-style-definition
14 # -Wmissing-parameter-type -Wmissing-prototypes
15 # -Wmissing-declarations -Wmissing-field-initializers
16 # -Wmissing-noreturn -Wmissing-format-attribute -Wpacked
17 # -Wredundant-decls -Wnested-externs'
20 CFLAGS = -I../include -D_FILE_OFFSET_BITS=64 -Wall $(TROPICSSL_CFLAGS_EXTRA_WARNINGS)
21 OFLAGS = -O2
23 ifndef TROPICSSL_CFLAGS_NO_WARNINGS_AS_ERRORS
24 CFLAGS += -Werror
25 endif # TROPICSSL_CFLAGS_NO_WARNINGS_AS_ERRORS
27 # MicroBlaze specific options:
28 # CFLAGS += -mno-xl-soft-mul -mxl-barrel-shift
30 # To compile on Plan9:
31 # CFLAGS += -D_BSD_EXTENSION
33 # To compile as a shared library:
34 ifdef TROPICSSL_SHARED
35 CFLAGS += -fPIC
36 endif # TROPICSSL_SHARED
38 DLEXT=so
39 # OSX shared library extension:
40 # DLEXT=dylib
42 OBJS= aes.o arc4.o base64.o \
43 bignum.o certs.o debug.o \
44 des.o dhm.o havege.o \
45 md2.o md4.o md5.o \
46 net.o padlock.o rsa.o \
47 sha1.o sha2.o sha4.o \
48 ssl_cli.o ssl_srv.o ssl_tls.o \
49 timing.o x509parse.o xtea.o \
50 camellia.o
52 .PHONY: all
54 ifdef TROPICSSL_SHARED
55 all: shared
56 else # TROPICSSL_SHARED
57 all: static
58 endif # TROPICSSL_SHARED
60 .PHONY: static
62 static: libtropicssl.a
64 .PHONY: shared
66 shared: libtropicssl.$(DLEXT)
68 libtropicssl.a: $(OBJS)
69 @echo " AR $@"
70 ar r $@ $(OBJS)
71 @echo " RL $@"
72 ranlib $@
74 libtropicssl.so: libtropicssl.a
75 @echo " LD $@"
76 $(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS)
78 libtropicssl.dylib: libtropicssl.a
79 @echo " LD $@"
80 $(CC) -dynamiclib -o $@ $(OBJS)
82 .c.o:
83 @echo " CC $<"
84 $(CC) $(CFLAGS) $(OFLAGS) -c $<
86 .PHONY: clean
88 clean:
89 rm -f *.o libtropicssl.*