20
20
# to. You're welcome.
21
21
sub dependmagic {
22
22
my $target = shift;
23
+ my $help = shift;
23
24
24
- return "$target: build_generated\n\t\$(MAKE) depend && \$(MAKE) _$target\n_$target";
25
+ return "$target: build_generated ## $help \n\t\$(MAKE) depend && \$(MAKE) _$target\n_$target";
25
26
}
26
27
27
28
our $COLUMNS = $ENV{COLUMNS};
@@ -504,15 +505,20 @@ LANG=C
504
505
505
506
# The main targets ###################################################
506
507
507
- {- dependmagic('build_sw'); -}: build_libs_nodep build_modules_nodep build_programs_nodep link-utils
508
- {- dependmagic('build_libs'); -}: build_libs_nodep
509
- {- dependmagic('build_modules'); -}: build_modules_nodep
510
- {- dependmagic('build_programs'); -}: build_programs_nodep
508
+ ##@ Software
511
509
510
+ {- dependmagic('build_sw', 'Build all the software (default target)'); -}: build_libs_nodep build_modules_nodep build_programs_nodep link-utils
511
+ {- dependmagic('build_libs', 'Build the libraries libssl and libcrypto'); -}: build_libs_nodep
512
+ {- dependmagic('build_modules', 'Build the modules (i.e. providers and engines)'); -}: build_modules_nodep
513
+ {- dependmagic('build_programs', 'Build the openssl executables and scripts'); -}: build_programs_nodep
514
+
515
+ all: build_sw build_docs ## Build software and documentation
516
+
517
+ ##@ Documentation
512
518
build_generated_pods: $(GENERATED_PODS)
513
- build_docs: build_man_docs build_html_docs
514
- build_man_docs: $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7)
515
- build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
519
+ build_docs: build_man_docs build_html_docs ## Create documentation
520
+ build_man_docs: $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7) ## Create manpages
521
+ build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7) ## Create HTML documentation
516
522
517
523
build_generated: $(GENERATED_MANDATORY)
518
524
build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
@@ -531,10 +537,14 @@ build_all_generated: $(GENERATED_MANDATORY) $(GENERATED) build_docs
531
537
@echo " then make will fail..."
532
538
@ : {- output_on() if $disabled{makedepend}; "" -}
533
539
534
- all: build_sw build_docs
540
+ ##@ Help
541
+ .PHONY: help
542
+ help: ## Show this help screen
543
+ @$(PERL) $(SRCDIR)/util/help.pl $(BLDDIR)/Makefile
535
544
536
- test: tests
537
- {- dependmagic('tests'); -}: build_programs_nodep build_modules_nodep link-utils run_tests
545
+ ##@ Testing
546
+ test: tests ## Run tests (alias of "tests")
547
+ {- dependmagic('tests', 'Run tests'); -}: build_programs_nodep build_modules_nodep link-utils run_tests
538
548
run_tests:
539
549
@ : {- output_off() if $disabled{tests}; "" -}
540
550
( SRCTOP=$(SRCDIR) \
@@ -547,16 +557,14 @@ run_tests:
547
557
@echo "Tests are not supported with your chosen Configure options"
548
558
@ : {- output_on() if !$disabled{tests}; "" -}
549
559
550
- list-tests:
560
+ list-tests: ## List available tests that can be invoked via "make test TESTS=<name>"
551
561
@ : {- output_off() if $disabled{tests}; "" -}
552
562
$(MAKE) run_tests TESTS=list
553
563
@ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
554
564
@echo "Tests are not supported with your chosen Configure options"
555
565
@ : {- output_on() if !$disabled{tests}; "" -}
556
566
557
- install: install_sw install_ssldirs install_docs {- $disabled{fips} ? "" : "install_fips" -}
558
-
559
- uninstall: uninstall_docs uninstall_sw {- $disabled{fips} ? "" : "uninstall_fips" -}
567
+ ##@ Workspace cleaning
560
568
561
569
libclean:
562
570
@set -e; for s in $(SHLIB_INFO); do \
@@ -581,7 +589,7 @@ libclean:
581
589
$(RM) $(LIBS)
582
590
$(RM) *{- platform->defext() -}
583
591
584
- clean: libclean
592
+ clean: libclean ## Clean the workspace, keep the configuration
585
593
$(RM) $(HTMLDOCS1)
586
594
$(RM) $(HTMLDOCS3)
587
595
$(RM) $(HTMLDOCS5)
@@ -601,7 +609,7 @@ clean: libclean
601
609
$(RM) openssl.pc libcrypto.pc libssl.pc
602
610
-find . -type l \! -name '.*' -exec $(RM) {} \;
603
611
604
- distclean: clean
612
+ distclean: clean ## Clean and remove the configuration
605
613
$(RM) include/openssl/configuration.h
606
614
$(RM) configdata.pm
607
615
$(RM) Makefile
@@ -614,14 +622,19 @@ depend: Makefile
614
622
@: {- output_on() if $disabled{makedepend}; "" -}
615
623
616
624
# Install helper targets #############################################
625
+ ##@ Installation
626
+
627
+ install: install_sw install_ssldirs install_docs {- $disabled{fips} ? "" : "install_fips" -} ## Install software and documentation, create OpenSSL directories
628
+
629
+ uninstall: uninstall_docs uninstall_sw {- $disabled{fips} ? "" : "uninstall_fips" -} ## Uninstall software and documentation
617
630
618
- install_sw: install_dev install_engines install_modules install_runtime
631
+ install_sw: install_dev install_engines install_modules install_runtime ## Install just the software and libraries
619
632
620
- uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
633
+ uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev ## Uninstall the software and libraries
621
634
622
- install_docs: install_man_docs install_html_docs
635
+ install_docs: install_man_docs install_html_docs ## Install manpages and HTML documentation
623
636
624
- uninstall_docs: uninstall_man_docs uninstall_html_docs
637
+ uninstall_docs: uninstall_man_docs uninstall_html_docs ## Uninstall manpages and HTML documentation
625
638
$(RM) -r $(DESTDIR)$(DOCDIR)
626
639
627
640
{- output_off() if $disabled{fips}; "" -}
@@ -1108,10 +1121,11 @@ uninstall_image_docs:
1108
1121
done
1109
1122
1110
1123
# Developer targets (note: these are only available on Unix) #########
1124
+ ##@ Code maintenence
1111
1125
1112
1126
# It's important that generate_buildinfo comes after ordinals, as ordinals
1113
1127
# is sensitive to build.info changes.
1114
- update: generate errors ordinals generate_buildinfo
1128
+ update: generate errors ordinals generate_buildinfo ## Update errors, ordinals and build info
1115
1129
1116
1130
.PHONY: generate generate_apps generate_crypto_bn generate_crypto_objects \
1117
1131
generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
@@ -1122,7 +1136,7 @@ generate: generate_apps generate_crypto_bn generate_crypto_objects \
1122
1136
generate_buildinfo: generate_doc_buildinfo
1123
1137
1124
1138
.PHONY: doc-nits md-nits
1125
- doc-nits: build_generated_pods
1139
+ doc-nits: build_generated_pods ## Evaluate OpenSSL documentation
1126
1140
$(PERL) $(SRCDIR)/util/find-doc-nits -c -n -l -e
1127
1141
1128
1142
# This uses "mdl", the markdownlint application, which is written in ruby.
@@ -1131,21 +1145,21 @@ doc-nits: build_generated_pods
1131
1145
# Another option is at https://snapcraft.io/install/mdl/debian
1132
1146
# Finally, there's a Node.js version, which we haven't tried, that
1133
1147
# can be found at https://github.com/DavidAnson/markdownlint
1134
- md-nits:
1148
+ md-nits: ## Evaluate markdown files via "mdl"
1135
1149
mdl -s util/markdownlint.rb .
1136
1150
1137
1151
# Test coverage is a good idea for the future
1138
1152
#coverage: $(PROGRAMS) $(TESTPROGRAMS)
1139
1153
# ...
1140
1154
1141
1155
.PHONY: lint
1142
- lint:
1156
+ lint: ## Evaluate C code via "splint"
1143
1157
@( cd $(SRCDIR); \
1144
1158
echo splint -DLINT -posixlib -preproc -D__gnuc_va_list=void \
1145
1159
-I. -Iinclude -Iapps/include $(CRYPTOHEADERS) $(SSLHEADERS) $(SRCS) )
1146
1160
1147
1161
.PHONY: check-format
1148
- check-format:
1162
+ check-format: ## Evaluate C code according to OpenSSL coding standards
1149
1163
( cd $(SRCDIR); $(PERL) util/check-format.pl \
1150
1164
$(SRCS) \$(CRYPTOHEADERS) $(SSLHEADERS) )
1151
1165
0 commit comments