forked from openssl/openssl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
demos: tidy up makefiles, fix warnings
Update makefiles so that consistent patterns are used. Object files are compiled from source using an implicit rule (but using our CFLAGS); for linking, we give an explicit rule. Ensure that "make test" works in each subdirectory (even if it does not actually run any applications). The top-level demo makefile now works. The makefiles are not make-agnostic. e.g. they use the variable $(RM) in "clean" recipes, which is defined in gnu-make but may not be defined in others. Part of openssl#17806 Testing: $ cd demo $ make test Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#22698)
- Loading branch information
Showing
37 changed files
with
314 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,37 @@ | ||
# | ||
# To run the demos when linked with a shared library (default): | ||
# To run the demos when linked with a shared library (default) ensure | ||
# that libcrypto is on the library path. For example: | ||
# | ||
# LD_LIBRARY_PATH=../.. ./EVP_MD_demo | ||
|
||
CFLAGS = -I../../include -g -Wall | ||
LDFLAGS = -L../.. | ||
LDLIBS = -lcrypto | ||
TESTS = EVP_MD_demo \ | ||
EVP_MD_stdin \ | ||
EVP_MD_xof \ | ||
BIO_f_md | ||
|
||
TESTS=EVP_MD_demo EVP_MD_stdin EVP_MD_xof BIO_f_md | ||
CFLAGS = -I../../include -g -Wall | ||
LDFLAGS = -L../.. | ||
LDLIBS = -lcrypto | ||
|
||
all: $(TESTS) | ||
|
||
%.o: %.c | ||
$(CC) $(CFLAGS) -c $< | ||
|
||
EVP_MD_demo: EVP_MD_demo.o | ||
EVP_MD_stdin: EVP_MD_stdin.o | ||
EVP_MD_xof: EVP_MD_xof.o | ||
BIO_f_md: BIO_f_md.o | ||
|
||
$(TESTS): | ||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) | ||
|
||
clean: | ||
$(RM) *.o $(TESTS) | ||
|
||
.PHONY: test | ||
# Since some of these tests use stdin we use the source file as stdin when running the exes | ||
# Since some of these tests use stdin, we use the source file as stdin | ||
# when running the tests | ||
test: all | ||
@echo "\nDigest tests:" | ||
@set -e; for tst in $(TESTS); do \ | ||
echo "\n"$$tst; \ | ||
cat $$tst.c | ./$$tst; \ | ||
done | ||
|
||
clean: | ||
$(RM) *.o $(TESTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
# | ||
# To run the demos when linked with a shared library (default): | ||
# To run the demos when linked with a shared library (default) ensure | ||
# that libcrypto is on the library path. For example: | ||
# | ||
# LD_LIBRARY_PATH=../.. ./rsa_encode | ||
|
||
CFLAGS = -I../../include -g -Wall | ||
LDFLAGS = -L../.. | ||
LDLIBS = -lcrypto | ||
TESTS = ec_encode \ | ||
rsa_encode | ||
|
||
TESTS=ec_encode rsa_encode | ||
CFLAGS = -I../../include -g -Wall | ||
LDFLAGS = -L../.. | ||
LDLIBS = -lcrypto | ||
|
||
all: $(TESTS) | ||
|
||
%.o: %.c | ||
$(CC) $(CFLAGS) -c $< | ||
ec_encode: ec_encode.o | ||
rsa_encode: rsa_encode.o | ||
|
||
%_encode: %_encode.o | ||
|
||
test: | ||
$(TESTS): | ||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) | ||
|
||
clean: | ||
$(RM) *.o $(TESTS) | ||
|
||
.PHONY: test | ||
test: all | ||
@echo "\nencode tests:" | ||
@echo "skipped" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.