Rethink the uplink / applink story
[openssl.git] / apps / Makefile.in
1 #
2 #  apps/Makefile
3 #
4
5 DIR=            apps
6 TOP=            ..
7 CC=             cc
8 INCLUDES=       -I$(TOP) -I../crypto -I../include
9 CFLAG=          -g -static -Wswitch
10 MAKEFILE=       Makefile
11 PERL=           perl
12 RM=             rm -f
13
14 PLIB_LDFLAG=
15 EX_LIBS= 
16 EXE_EXT= 
17
18 APPS_OBJ=
19
20 SHLIB_TARGET=
21
22 CFLAGS= $(INCLUDES) $(CFLAG)
23
24 GENERAL=Makefile makeapps.com install.com
25
26 DLIBCRYPTO=../libcrypto.a
27 DLIBSSL=../libssl.a
28 LIBCRYPTO=-L.. -lcrypto
29 LIBSSL=-L.. -lssl
30
31 SCRIPTS=CA.pl tsget
32 EXE= openssl$(EXE_EXT)
33
34 COMMANDS= \
35         asn1pars.o ca.o ciphers.o cms.o crl.o crl2p7.o dgst.o dhparam.o \
36         dsa.o dsaparam.o ec.o ecparam.o enc.o engine.o errstr.o gendsa.o \
37         genpkey.o genrsa.o nseq.o ocsp.o passwd.o pkcs12.o pkcs7.o pkcs8.o \
38         pkey.o pkeyparam.o pkeyutl.o prime.o rand.o req.o rsa.o rsautl.o \
39         s_client.o s_server.o s_time.o sess_id.o smime.o speed.o spkac.o \
40         srp.o ts.o verify.o version.o x509.o rehash.o
41
42 EXTRA_OBJ=apps.o opt.o s_cb.o s_socket.o
43 EXTRA_SRC=apps.c opt.c s_cb.c s_socket.c
44 RAND_OBJ=app_rand.o
45 RAND_SRC=app_rand.c
46
47 OBJ     = $(COMMANDS)
48
49 SRC     = \
50         asn1pars.c ca.c ciphers.c cms.c crl.c crl2p7.c dgst.c dhparam.c \
51         dsa.c dsaparam.c ec.c ecparam.c enc.c engine.c errstr.c gendsa.c \
52         genpkey.c genrsa.c nseq.c ocsp.c passwd.c pkcs12.c pkcs7.c pkcs8.c \
53         pkey.c pkeyparam.c pkeyutl.c prime.c rand.c req.c rsa.c rsautl.c \
54         s_client.c s_server.c s_time.c sess_id.c smime.c speed.c spkac.c \
55         srp.c ts.c verify.c version.c x509.c rehash.c
56
57 EXE_OBJ = openssl.o $(OBJ) $(EXTRA_OBJ) $(RAND_OBJ) $(APPS_OBJ)
58 EXE_SRC = openssl.c $(SRC) $(EXTRA_SRC) $(RAND_SRC)
59
60 HEADER= apps.h progs.h s_apps.h \
61         testdsa.h testrsa.h timeouts.h
62
63 ALL=    $(GENERAL) $(EXE_SRC) $(HEADER)
64
65 top:
66         @(cd ..; $(MAKE) DIRS=$(DIR) all)
67
68 all:    exe scripts
69
70 exe:    $(EXE)
71
72 scripts: $(SCRIPTS)
73
74 openssl-vms.cnf: openssl.cnf
75         $(PERL) $(TOP)/VMS/VMSify-conf.pl < openssl.cnf > openssl-vms.cnf
76
77 files:
78         $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
79
80 install:
81         @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
82         @set -e; for i in $(EXE); \
83         do  \
84         (echo installing $$i; \
85          cp $$i $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
86          chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
87          mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$i.new $(DESTDIR)$(INSTALLTOP)/bin/$$i ); \
88          done;
89         @set -e; for i in $(SCRIPTS); \
90         do  \
91         (echo installing $$i; \
92          cp $$i $(DESTDIR)$(OPENSSLDIR)/misc/$$i.new; \
93          chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$i.new; \
94          mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$i.new $(DESTDIR)$(OPENSSLDIR)/misc/$$i ); \
95          done
96         @cp openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new; \
97         chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new; \
98         mv -f  $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
99
100 uninstall:
101         @set -e; for i in $(EXE); \
102         do  \
103                 echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
104                 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
105         done;
106         @set -e; for i in $(SCRIPTS); \
107         do  \
108                 echo $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$i; \
109                 $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$i; \
110         done
111         $(RM) $(DESTDIR)$(OPENSSLDIR)/openssl.cnf
112
113 generate: openssl-vms.cnf progs.h
114
115 depend:
116         $(TOP)/util/domd $(CFLAG) $(INCLUDES) -- $(EXE_SRC)
117
118 clean:
119         rm -f *.o *.obj *.dll lib tags core .pure .nfs* *.old *.bak fluff $(EXE)
120         rm -f req
121
122 $(DLIBSSL):
123         (cd ..; $(MAKE) build_libssl)
124
125 $(DLIBCRYPTO):
126         (cd ..; $(MAKE) build_libcrypto)
127
128 $(EXE): $(EXE_OBJ) $(DLIBCRYPTO) $(DLIBSSL)
129         $(RM) $(EXE)
130         shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
131                 shlib_target="$(SHLIB_TARGET)"; \
132         fi; \
133         LIBRARIES="$(LIBSSL) $(LIBCRYPTO)" ; \
134         $(MAKE) -f $(TOP)/Makefile.shared -e \
135                 APPNAME=$(EXE) OBJECTS="$(EXE_OBJ)" \
136                 LDFLAG="$(LDFLAG)" \
137                 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
138                 link_app.$${shlib_target}
139
140 progs.h: progs.pl Makefile.in
141         $(RM) progs.h
142         $(PERL) progs.pl $(EXE_SRC) > progs.h
143
144 CA.pl: CA.pl.in
145         $(PERL) -I$(TOP) -Mconfigdata $(TOP)/util/dofile.pl -oapps/Makefile CA.pl.in > CA.pl.new
146         mv CA.pl.new CA.pl
147
148
149 # DO NOT DELETE THIS LINE -- make depend depends on it.