summaryrefslogtreecommitdiffstats
path: root/apps/Makefile.in
blob: 064496b6d4df37842a0e558577703c3fc47c268a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#
#  apps/Makefile
#

DIR=		apps
TOP=		..
CC=		cc
INCLUDES=	-I$(TOP) -I../crypto -I../include
CFLAG=		-g -static -Wswitch
MAKEFILE=	Makefile
PERL=		perl
RM=		rm -f

PLIB_LDFLAG=
EX_LIBS= 
EXE_EXT= 

APPS_OBJ=

SHLIB_TARGET=

CFLAGS= $(INCLUDES) $(CFLAG)

GENERAL=Makefile makeapps.com install.com

DLIBCRYPTO=../libcrypto.a
DLIBSSL=../libssl.a
LIBCRYPTO=-L.. -lcrypto
LIBSSL=-L.. -lssl

SCRIPTS=CA.pl tsget
EXE= openssl$(EXE_EXT)
CONFS=openssl.cnf ct_log_list.cnf

COMMANDS= \
	asn1pars.o ca.o ciphers.o cms.o crl.o crl2p7.o dgst.o dhparam.o \
	dsa.o dsaparam.o ec.o ecparam.o enc.o engine.o errstr.o gendsa.o \
	genpkey.o genrsa.o nseq.o ocsp.o passwd.o pkcs12.o pkcs7.o pkcs8.o \
	pkey.o pkeyparam.o pkeyutl.o prime.o rand.o req.o rsa.o rsautl.o \
	s_client.o s_server.o s_time.o sess_id.o smime.o speed.o spkac.o \
	srp.o ts.o verify.o version.o x509.o rehash.o

EXTRA_OBJ=apps.o opt.o s_cb.o s_socket.o
EXTRA_SRC=apps.c opt.c s_cb.c s_socket.c
RAND_OBJ=app_rand.o
RAND_SRC=app_rand.c

OBJ	= $(COMMANDS)

SRC	= \
	asn1pars.c ca.c ciphers.c cms.c crl.c crl2p7.c dgst.c dhparam.c \
	dsa.c dsaparam.c ec.c ecparam.c enc.c engine.c errstr.c gendsa.c \
	genpkey.c genrsa.c nseq.c ocsp.c passwd.c pkcs12.c pkcs7.c pkcs8.c \
	pkey.c pkeyparam.c pkeyutl.c prime.c rand.c req.c rsa.c rsautl.c \
	s_client.c s_server.c s_time.c sess_id.c smime.c speed.c spkac.c \
	srp.c ts.c verify.c version.c x509.c rehash.c

EXE_OBJ	= openssl.o $(OBJ) $(EXTRA_OBJ) $(RAND_OBJ) $(APPS_OBJ)
EXE_SRC = openssl.c $(SRC) $(EXTRA_SRC) $(RAND_SRC)

HEADER=	apps.h progs.h s_apps.h \
	testdsa.h testrsa.h timeouts.h

ALL=    $(GENERAL) $(EXE_SRC) $(HEADER)

top:
	@(cd ..; $(MAKE) DIRS=$(DIR) all)

all:	exe scripts

exe:	$(EXE)

scripts: $(SCRIPTS)

openssl-vms.cnf: openssl.cnf
	$(PERL) $(TOP)/VMS/VMSify-conf.pl < openssl.cnf > openssl-vms.cnf

install:
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
	@set -e; for i in $(EXE); \
	do \
		echo installing $$i; \
		cp $$i $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
		chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
		mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$i.new $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
	done
	@set -e; for i in $(SCRIPTS); \
	do \
		echo installing $$i; \
		cp $$i $(DESTDIR)$(OPENSSLDIR)/misc/$$i.new; \
		chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$i.new; \
		mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$i.new $(DESTDIR)$(OPENSSLDIR)/misc/$$i; \
	done
	@set -e; for i in $(CONFS); \
	do \
		echo installing $$i; \
		cp $$i $(DESTDIR)$(OPENSSLDIR)/$$i.new; \
		chmod 644 $(DESTDIR)$(OPENSSLDIR)/$$i.new; \
		mv -f $(DESTDIR)$(OPENSSLDIR)/$$i.new $(DESTDIR)$(OPENSSLDIR)/$$i; \
	done

uninstall:
	@set -e; for i in $(EXE); \
	do \
		echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
		$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
	done
	@set -e; for i in $(SCRIPTS); \
	do \
		echo $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$i; \
		$(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$i; \
	done
	@set -e; for i in $(CONFS); \
	do \
		echo $(RM) $(DESTDIR)$(OPENSSLDIR)/$$i; \
		$(RM) $(DESTDIR)$(OPENSSLDIR)/$$i; \
	done

generate: openssl-vms.cnf progs.h

depend:
	$(TOP)/util/domd $(CFLAG) $(INCLUDES) -- $(EXE_SRC)

clean:
	rm -f *.o *.obj *.dll lib tags core .pure .nfs* *.old *.bak fluff $(EXE)
	rm -f req

$(DLIBSSL):
	(cd ..; $(MAKE) build_libssl)

$(DLIBCRYPTO):
	(cd ..; $(MAKE) build_libcrypto)

$(EXE): $(EXE_OBJ) $(DLIBCRYPTO) $(DLIBSSL)
	$(RM) $(EXE)
	shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
		shlib_target="$(SHLIB_TARGET)"; \
	fi; \
	LIBRARIES="$(LIBSSL) $(LIBCRYPTO)" ; \
	$(MAKE) -f $(TOP)/Makefile.shared -e \
		APPNAME=$(EXE) OBJECTS="$(EXE_OBJ)" \
		LDFLAG="$(LDFLAG)" \
		LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
		link_app.$${shlib_target}

progs.h: progs.pl Makefile.in
	$(RM) progs.h
	$(PERL) progs.pl $(EXE_SRC) > progs.h

CA.pl: CA.pl.in
	$(PERL) -I$(TOP) -Mconfigdata $(TOP)/util/dofile.pl -oapps/Makefile CA.pl.in > CA.pl.new
	mv CA.pl.new CA.pl


# DO NOT DELETE THIS LINE -- make depend depends on it.