mkdir -p is not fully portable (according to Marc Crispin,
NeXTstep creates a directory called -p); now mkdir-p.pl does its job.
This commit is contained in:
parent
861b0ddd27
commit
6576774b51
16
Makefile.org
16
Makefile.org
@ -243,7 +243,7 @@ files:
|
|||||||
|
|
||||||
links:
|
links:
|
||||||
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
@$(TOP)/util/point.sh Makefile.ssl Makefile
|
||||||
@-mkdir -p include/openssl 2>/dev/null
|
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
|
||||||
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
|
||||||
@for i in $(DIRS); do \
|
@for i in $(DIRS); do \
|
||||||
(cd $$i && echo "making links in $$i..." && \
|
(cd $$i && echo "making links in $$i..." && \
|
||||||
@ -311,13 +311,13 @@ dist_pem_h:
|
|||||||
(cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
|
(cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
@-mkdir -p $(INSTALL_PREFIX)$(INSTALLTOP)/bin 2>/dev/null
|
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin
|
||||||
@-mkdir -p $(INSTALL_PREFIX)$(INSTALLTOP)/lib 2>/dev/null
|
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/lib
|
||||||
@-mkdir -p $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl 2>/dev/null
|
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl
|
||||||
@-mkdir -p $(INSTALL_PREFIX)$(OPENSSLDIR)/misc 2>/dev/null
|
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(OPENSSLDIR)/misc
|
||||||
@-mkdir -p $(INSTALL_PREFIX)$(OPENSSLDIR)/certs 2>/dev/null
|
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(OPENSSLDIR)/certs
|
||||||
@-mkdir -p $(INSTALL_PREFIX)$(OPENSSLDIR)/private 2>/dev/null
|
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(OPENSSLDIR)/private
|
||||||
@-mkdir -p $(INSTALL_PREFIX)$(OPENSSLDIR)/lib 2>/dev/null
|
@$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(OPENSSLDIR)/lib
|
||||||
@for i in $(EXHEADER) ;\
|
@for i in $(EXHEADER) ;\
|
||||||
do \
|
do \
|
||||||
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
|
||||||
|
33
util/mkdir-p.pl
Executable file
33
util/mkdir-p.pl
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/local/bin/perl
|
||||||
|
|
||||||
|
# mkdir-p.pl
|
||||||
|
|
||||||
|
# On some systems, the -p option to mkdir (= also create any missing parent
|
||||||
|
# directories) is not available.
|
||||||
|
|
||||||
|
my $arg;
|
||||||
|
|
||||||
|
foreach $arg (@ARGV) {
|
||||||
|
&do_mkdir_p($arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub do_mkdir_p {
|
||||||
|
local($dir) = @_;
|
||||||
|
|
||||||
|
$dir =~ s|/*$||;
|
||||||
|
|
||||||
|
if (-d $dir) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($dir =~ /\//) {
|
||||||
|
local($parent) = $dir;
|
||||||
|
$parent =~ s|[^/]*$||;
|
||||||
|
|
||||||
|
do_mkdir_p($parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdir($dir, 0777) || die "Cannot create directory $dir: $!\n";
|
||||||
|
print "created directory $dir\n";
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user