1cace40ab7008851b54d2dbd3a629cf14b2a9c27
[openssl.git] / apps / Makefile.ssl
1 #
2 # SSLeay/apps/Makefile.ssl
3 #
4
5 DIR=            apps
6 TOP=            ..
7 CC=             cc
8 INCLUDES=       -I../include
9 CFLAG=          -g -static
10 INSTALLTOP=     /usr/local/ssl
11 MAKE=           make -f Makefile.ssl
12 MAKEDEPEND=     makedepend -f Makefile.ssl
13 MAKEFILE=       Makefile.ssl
14 RM=             /bin/rm -f
15
16 PEX_LIBS=
17 EX_LIBS= 
18
19 CFLAGS= -DMONOLITH $(INCLUDES) $(CFLAG)
20
21 GENERAL=Makefile
22
23 DLIBCRYPTO=../libcrypto.a
24 DLIBSSL=../libssl.a
25 LIBCRYPTO=-L.. -lcrypto
26 LIBSSL=-L.. -lssl
27
28 SSLEAY= ssleay
29
30 SCRIPTS=CA.sh der_chop
31
32 EXE= $(SSLEAY)
33
34 E_EXE=  verify asn1pars req dgst dh enc gendh errstr ca crl \
35         rsa dsa dsaparam \
36         x509 genrsa s_server s_client speed \
37         s_time version pkcs7 crl2pkcs7 sess_id ciphers
38
39 PROGS= $(SSLEAY).c
40
41 A_OBJ=apps.o
42 A_SRC=apps.c
43 S_OBJ=  s_cb.o s_socket.o
44 S_SRC=  s_cb.c s_socket.c
45
46 E_OBJ=  verify.o asn1pars.o req.o dgst.o dh.o enc.o gendh.o errstr.o ca.o \
47         pkcs7.o crl2p7.o crl.o \
48         rsa.o dsa.o dsaparam.o \
49         x509.o genrsa.o s_server.o s_client.o speed.o \
50         s_time.o $(A_OBJ) $(S_OBJ) version.o sess_id.o \
51         ciphers.o
52
53 #       pem_mail.o
54
55 E_SRC=  verify.c asn1pars.c req.c dgst.c dh.c enc.c gendh.c errstr.c ca.c \
56         pkcs7.c crl2p7.c crl.c \
57         rsa.c dsa.c dsaparam.c \
58         x509.c genrsa.c s_server.c s_client.c speed.c \
59         s_time.c $(A_SRC) $(S_SRC) version.c sess_id.c \
60         ciphers.c
61
62 #       pem_mail.c
63
64 SRC=$(E_SRC)
65
66 EXHEADER=
67 HEADER= apps.h progs.h s_apps.h \
68         testdsa.h testrsa.h \
69         $(EXHEADER)
70
71 ALL=    $(GENERAL) $(SRC) $(HEADER)
72
73 top:
74         @(cd ..; $(MAKE) DIRS=$(DIR) all)
75
76 all:    exe
77
78 exe:    $(EXE)
79
80 req: sreq.o $(A_OBJ) $(DLIBCRYPTO)
81         $(CC) -o req $(CFLAG) sreq.o $(A_OBJ) $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS)
82
83 sreq.o: req.c 
84         $(CC) -c $(INCLUDES) $(CFLAG) -o sreq.o req.c
85
86 files:
87         perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
88
89 install: mklinks
90         @for i in $(EXE) $(SCRIPTS) mklinks; \
91         do  \
92         (echo installing $$i; \
93          cp $$i $(INSTALLTOP)/bin/$$i; \
94          chmod 755 $(INSTALLTOP)/bin/$$i ); \
95          done; \
96         cp ssleay.cnf $(INSTALLTOP)/lib
97         chmod 644 $(INSTALLTOP)/lib/ssleay.cnf
98         cd $(INSTALLTOP)/bin; \
99         /bin/sh ./mklinks; \
100         /bin/rm -f ./mklinks
101
102 tags:
103         ctags $(SRC)
104
105 tests:
106
107 links:
108         /bin/rm -f Makefile
109         $(TOP)/util/point.sh Makefile.ssl Makefile ;
110
111 lint:
112         lint -DLINT $(INCLUDES) $(SRC)>fluff
113
114 depend:
115         $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(SRC)
116
117 dclean:
118         perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
119         mv -f Makefile.new $(MAKEFILE)
120
121 errors:
122
123 clean:
124         /bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE)
125         /bin/rm -f req
126
127 $(DLIBSSL):
128         (cd ../ssl; $(MAKE))
129
130 $(DLIBCRYPTO):
131         (cd ../crypto; $(MAKE))
132
133 $(SSLEAY): progs.h $(E_OBJ) $(SSLEAY).o $(DLIBCRYPTO) $(DLIBSSL)
134         $(RM) $(SSLEAY)
135         $(CC) -o $(SSLEAY) $(CFLAGS) $(SSLEAY).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBCRYPTO) $(EX_LIBS)
136
137 progs.h:
138         perl ./g_ssleay.pl $(E_EXE) >progs.h
139         $(RM) $(SSLEAY).o
140
141 mklinks:
142         perl ./g_ssleay.pl $(E_EXE) >progs.h
143
144 # DO NOT DELETE THIS LINE -- make depend depends on it.