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