2016-01-12 21:25:30 +00:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 10:47:14 +00:00
|
|
|
PLIB_LDFLAG=
|
2016-01-12 21:25:30 +00:00
|
|
|
EX_LIBS=
|
|
|
|
EXE_EXT=
|
|
|
|
|
2016-02-18 17:43:56 +00:00
|
|
|
APPS_OBJ=
|
|
|
|
|
2016-01-12 21:25:30 +00:00
|
|
|
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)
|
2016-03-02 13:34:05 +00:00
|
|
|
CONFS=openssl.cnf ct_log_list.cnf
|
2016-01-12 21:25:30 +00:00
|
|
|
|
|
|
|
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 \
|
2016-02-11 23:34:40 +00:00
|
|
|
srp.c ts.c verify.c version.c x509.c rehash.c
|
2016-01-12 21:25:30 +00:00
|
|
|
|
2016-02-18 17:43:56 +00:00
|
|
|
EXE_OBJ = openssl.o $(OBJ) $(EXTRA_OBJ) $(RAND_OBJ) $(APPS_OBJ)
|
2016-01-12 21:25:30 +00:00
|
|
|
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)
|
|
|
|
|
2016-01-24 23:16:04 +00:00
|
|
|
all: exe scripts
|
2016-01-12 21:25:30 +00:00
|
|
|
|
|
|
|
exe: $(EXE)
|
|
|
|
|
2016-01-24 23:16:04 +00:00
|
|
|
scripts: $(SCRIPTS)
|
|
|
|
|
2016-01-12 21:25:30 +00:00
|
|
|
openssl-vms.cnf: openssl.cnf
|
|
|
|
$(PERL) $(TOP)/VMS/VMSify-conf.pl < openssl.cnf > openssl-vms.cnf
|
|
|
|
|
|
|
|
files:
|
|
|
|
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
|
|
|
|
|
|
|
install:
|
|
|
|
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
|
|
|
|
@set -e; for i in $(EXE); \
|
2016-03-04 15:30:33 +00:00
|
|
|
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
|
2016-01-12 21:25:30 +00:00
|
|
|
@set -e; for i in $(SCRIPTS); \
|
2016-03-04 15:30:33 +00:00
|
|
|
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
|
2016-03-02 13:34:05 +00:00
|
|
|
@set -e; for i in $(CONFS); \
|
|
|
|
do \
|
2016-03-04 15:30:33 +00:00
|
|
|
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
|
2016-01-12 21:25:30 +00:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
@set -e; for i in $(EXE); \
|
2016-03-04 15:30:33 +00:00
|
|
|
do \
|
2016-02-12 20:14:03 +00:00
|
|
|
echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
|
|
|
|
$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
|
2016-03-04 13:18:24 +00:00
|
|
|
done
|
2016-01-12 21:25:30 +00:00
|
|
|
@set -e; for i in $(SCRIPTS); \
|
2016-03-04 15:30:33 +00:00
|
|
|
do \
|
2016-02-12 20:14:03 +00:00
|
|
|
echo $(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$i; \
|
|
|
|
$(RM) $(DESTDIR)$(OPENSSLDIR)/misc/$$i; \
|
2016-03-04 13:18:24 +00:00
|
|
|
done
|
2016-03-02 13:34:05 +00:00
|
|
|
@set -e; for i in $(CONFS); \
|
2016-03-04 15:30:33 +00:00
|
|
|
do \
|
2016-03-02 13:34:05 +00:00
|
|
|
echo $(RM) $(DESTDIR)$(OPENSSLDIR)/$$i; \
|
|
|
|
$(RM) $(DESTDIR)$(OPENSSLDIR)/$$i; \
|
2016-03-04 13:18:24 +00:00
|
|
|
done
|
2016-01-12 21:25:30 +00:00
|
|
|
|
2016-02-11 23:34:40 +00:00
|
|
|
generate: openssl-vms.cnf progs.h
|
2016-01-12 21:25:30 +00:00
|
|
|
|
2016-01-18 16:50:36 +00:00
|
|
|
depend:
|
2016-02-18 12:17:15 +00:00
|
|
|
$(TOP)/util/domd $(CFLAG) $(INCLUDES) -- $(EXE_SRC)
|
2016-01-12 21:25:30 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2016-02-11 23:34:40 +00:00
|
|
|
$(EXE): $(EXE_OBJ) $(DLIBCRYPTO) $(DLIBSSL)
|
2016-01-12 21:25:30 +00:00
|
|
|
$(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)" \
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 10:47:14 +00:00
|
|
|
LDFLAG="$(LDFLAG)" \
|
|
|
|
LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
|
2016-01-12 21:25:30 +00:00
|
|
|
link_app.$${shlib_target}
|
|
|
|
|
2016-02-11 23:34:40 +00:00
|
|
|
progs.h: progs.pl Makefile.in
|
2016-01-12 21:25:30 +00:00
|
|
|
$(RM) progs.h
|
2016-02-11 23:34:40 +00:00
|
|
|
$(PERL) progs.pl $(EXE_SRC) > progs.h
|
2016-01-12 21:25:30 +00:00
|
|
|
|
Refactor file writing - introduce template driven file writing
apps/CA.pl and tools/c_rehash are built from template files. So far,
this was done by Configure, which created its own problems as it
forced everyone to reconfigure just because one of the template files
had changed.
Instead, have those files created as part of the normal build in apps/
and in tools/.
Furthermore, this prepares for a future where Configure may produce
entirely other build files than Makefile, and the latter can't be
guaranteed to be the holder of all information for other scripts.
Instead, configdata.pm (described below) becomes the center of
configuration information.
This introduces a few new things:
%config a hash table to hold all kinds of configuration data
that can be used by any other script.
configdata.pm a perl module that Configure writes. It currently
holds the hash tables %config and %target.
util/dofile.pl a script that takes a template on STDIN and outputs
the result after applying configuration data on it.
It's supposed to be called like this:
perl -I$(TOP) -Mconfigdata < template > result
or
perl -I$(TOP) -Mconfigdata templ1 templ2 ... > result
Note: util/dofile.pl requires Text::Template.
As part of this changed, remove a number of variables that are really
just copies of entries in %target, and use %target directly. The
exceptions are $target{cflags} and $target{lflags}, they do get copied
to $cflags and $lflags. The reason for this is that those variable
potentially go through a lot of changes and would rather deserve a
place in %config. That, however, is for another commit.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-18 20:35:23 +00:00
|
|
|
CA.pl: CA.pl.in
|
2016-01-25 20:19:59 +00:00
|
|
|
$(PERL) -I$(TOP) -Mconfigdata $(TOP)/util/dofile.pl -oapps/Makefile CA.pl.in > CA.pl.new
|
Refactor file writing - introduce template driven file writing
apps/CA.pl and tools/c_rehash are built from template files. So far,
this was done by Configure, which created its own problems as it
forced everyone to reconfigure just because one of the template files
had changed.
Instead, have those files created as part of the normal build in apps/
and in tools/.
Furthermore, this prepares for a future where Configure may produce
entirely other build files than Makefile, and the latter can't be
guaranteed to be the holder of all information for other scripts.
Instead, configdata.pm (described below) becomes the center of
configuration information.
This introduces a few new things:
%config a hash table to hold all kinds of configuration data
that can be used by any other script.
configdata.pm a perl module that Configure writes. It currently
holds the hash tables %config and %target.
util/dofile.pl a script that takes a template on STDIN and outputs
the result after applying configuration data on it.
It's supposed to be called like this:
perl -I$(TOP) -Mconfigdata < template > result
or
perl -I$(TOP) -Mconfigdata templ1 templ2 ... > result
Note: util/dofile.pl requires Text::Template.
As part of this changed, remove a number of variables that are really
just copies of entries in %target, and use %target directly. The
exceptions are $target{cflags} and $target{lflags}, they do get copied
to $cflags and $lflags. The reason for this is that those variable
potentially go through a lot of changes and would rather deserve a
place in %config. That, however, is for another commit.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-18 20:35:23 +00:00
|
|
|
mv CA.pl.new CA.pl
|
|
|
|
|
|
|
|
|
2016-01-12 21:25:30 +00:00
|
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|