2009-01-03 21:22:43 +00:00
|
|
|
|
|
|
|
# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
|
2012-05-10 21:26:28 +00:00
|
|
|
# To compile on MinGW: add "-lws2_32" to LDFLAGS or define WINDOWS in your env
|
2011-01-18 15:27:19 +00:00
|
|
|
# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
|
2009-01-03 21:22:43 +00:00
|
|
|
|
2011-01-30 17:10:13 +00:00
|
|
|
CFLAGS += -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement
|
2012-10-23 12:12:53 +00:00
|
|
|
OFLAGS = -O2
|
2011-06-21 08:59:44 +00:00
|
|
|
LDFLAGS += -L../library -lpolarssl $(SYS_LDFLAGS)
|
2009-01-03 21:22:43 +00:00
|
|
|
|
2012-04-05 12:08:29 +00:00
|
|
|
ifdef DEBUG
|
|
|
|
CFLAGS += -g3
|
|
|
|
endif
|
|
|
|
|
2012-05-10 20:49:10 +00:00
|
|
|
ifdef WINDOWS
|
|
|
|
LDFLAGS += -lws2_32
|
|
|
|
endif
|
|
|
|
|
2012-07-03 13:30:23 +00:00
|
|
|
# Zlib shared library extensions:
|
|
|
|
ifdef ZLIB
|
|
|
|
LDFLAGS += -lz
|
|
|
|
endif
|
|
|
|
|
2011-01-21 09:32:12 +00:00
|
|
|
APPS = aes/aescrypt2 aes/crypt_and_hash \
|
2011-01-21 10:21:11 +00:00
|
|
|
hash/hello hash/generic_sum \
|
2010-03-18 20:11:58 +00:00
|
|
|
hash/md5sum hash/sha1sum \
|
2009-01-03 21:22:43 +00:00
|
|
|
hash/sha2sum pkey/dh_client \
|
|
|
|
pkey/dh_genprime pkey/dh_server \
|
2013-09-23 10:05:44 +00:00
|
|
|
pkey/gen_key \
|
2012-02-13 23:11:30 +00:00
|
|
|
pkey/key_app pkey/key_app_writer \
|
2013-09-18 13:34:57 +00:00
|
|
|
pkey/mpi_demo pkey/pk_decrypt \
|
|
|
|
pkey/pk_encrypt pkey/pk_sign \
|
|
|
|
pkey/pk_verify pkey/rsa_genkey \
|
2011-08-09 10:30:36 +00:00
|
|
|
pkey/rsa_decrypt pkey/rsa_encrypt \
|
2009-01-03 21:22:43 +00:00
|
|
|
pkey/rsa_sign pkey/rsa_verify \
|
2011-03-25 14:01:32 +00:00
|
|
|
pkey/rsa_sign_pss pkey/rsa_verify_pss \
|
2009-01-03 21:22:43 +00:00
|
|
|
ssl/ssl_client1 ssl/ssl_client2 \
|
2012-09-25 09:05:17 +00:00
|
|
|
ssl/ssl_server ssl/ssl_server2 \
|
|
|
|
ssl/ssl_fork_server \
|
2011-12-03 21:45:14 +00:00
|
|
|
ssl/ssl_mail_client random/gen_entropy \
|
|
|
|
random/gen_random_havege \
|
|
|
|
random/gen_random_ctr_drbg \
|
2011-01-27 16:50:02 +00:00
|
|
|
test/ssl_cert_test test/benchmark \
|
|
|
|
test/selftest test/ssl_test \
|
2013-08-25 12:50:09 +00:00
|
|
|
util/pem2der util/strerror \
|
2012-02-13 23:11:30 +00:00
|
|
|
x509/cert_app x509/crl_app \
|
|
|
|
x509/cert_req
|
2009-01-03 21:22:43 +00:00
|
|
|
|
2012-05-19 08:43:48 +00:00
|
|
|
ifdef OPENSSL
|
|
|
|
APPS += test/o_p_test
|
|
|
|
endif
|
|
|
|
|
2013-12-19 14:40:58 +00:00
|
|
|
ifdef PTHREAD
|
|
|
|
APPS += ssl/ssl_pthread_server
|
|
|
|
endif
|
|
|
|
|
2009-01-03 21:22:43 +00:00
|
|
|
.SILENT:
|
|
|
|
|
|
|
|
all: $(APPS)
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
aes/aescrypt2: aes/aescrypt2.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC aes/aescrypt2.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) aes/aescrypt2.c $(LDFLAGS) -o $@
|
|
|
|
|
2011-01-21 09:32:12 +00:00
|
|
|
aes/crypt_and_hash: aes/crypt_and_hash.c ../library/libpolarssl.a
|
|
|
|
echo " CC aes/crypt_and_hash.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) aes/crypt_and_hash.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
hash/hello: hash/hello.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC hash/hello.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) hash/hello.c $(LDFLAGS) -o $@
|
|
|
|
|
2011-01-21 10:21:11 +00:00
|
|
|
hash/generic_sum: hash/generic_sum.c ../library/libpolarssl.a
|
|
|
|
echo " CC hash/generic_sum.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) hash/generic_sum.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
hash/md5sum: hash/md5sum.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC hash/md5sum.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) hash/md5sum.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
hash/sha1sum: hash/sha1sum.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC hash/sha1sum.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) hash/sha1sum.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
hash/sha2sum: hash/sha2sum.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC hash/sha2sum.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) hash/sha2sum.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
pkey/dh_client: pkey/dh_client.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC pkey/dh_client.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/dh_client.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
pkey/dh_genprime: pkey/dh_genprime.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC pkey/dh_genprime.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/dh_genprime.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
pkey/dh_server: pkey/dh_server.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC pkey/dh_server.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/dh_server.c $(LDFLAGS) -o $@
|
|
|
|
|
2013-08-09 15:10:27 +00:00
|
|
|
pkey/ecdsa: pkey/ecdsa.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/ecdsa.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/ecdsa.c $(LDFLAGS) -o $@
|
|
|
|
|
2013-09-23 10:05:44 +00:00
|
|
|
pkey/gen_key: pkey/gen_key.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/gen_key.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/gen_key.c $(LDFLAGS) -o $@
|
|
|
|
|
2011-07-13 11:26:43 +00:00
|
|
|
pkey/key_app: pkey/key_app.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/key_app.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/key_app.c $(LDFLAGS) -o $@
|
|
|
|
|
2012-02-13 23:11:30 +00:00
|
|
|
pkey/key_app_writer: pkey/key_app_writer.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/key_app_writer.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/key_app_writer.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
pkey/mpi_demo: pkey/mpi_demo.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC pkey/mpi_demo.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/mpi_demo.c $(LDFLAGS) -o $@
|
|
|
|
|
2013-09-18 13:34:57 +00:00
|
|
|
pkey/pk_decrypt: pkey/pk_decrypt.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/pk_decrypt.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/pk_decrypt.c $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
pkey/pk_encrypt: pkey/pk_encrypt.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/pk_encrypt.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/pk_encrypt.c $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
pkey/pk_sign: pkey/pk_sign.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/pk_sign.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/pk_sign.c $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
pkey/pk_verify: pkey/pk_verify.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/pk_verify.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/pk_verify.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
pkey/rsa_genkey: pkey/rsa_genkey.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC pkey/rsa_genkey.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_genkey.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
pkey/rsa_sign: pkey/rsa_sign.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC pkey/rsa_sign.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_sign.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
pkey/rsa_verify: pkey/rsa_verify.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC pkey/rsa_verify.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_verify.c $(LDFLAGS) -o $@
|
|
|
|
|
2011-03-25 14:01:32 +00:00
|
|
|
pkey/rsa_sign_pss: pkey/rsa_sign_pss.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/rsa_sign_pss.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_sign_pss.c $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
pkey/rsa_verify_pss: pkey/rsa_verify_pss.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/rsa_verify_pss.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_verify_pss.c $(LDFLAGS) -o $@
|
|
|
|
|
2011-08-09 10:30:36 +00:00
|
|
|
pkey/rsa_decrypt: pkey/rsa_decrypt.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/rsa_decrypt.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_decrypt.c $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
pkey/rsa_encrypt: pkey/rsa_encrypt.c ../library/libpolarssl.a
|
|
|
|
echo " CC pkey/rsa_encrypt.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) pkey/rsa_encrypt.c $(LDFLAGS) -o $@
|
|
|
|
|
2011-12-03 21:45:14 +00:00
|
|
|
random/gen_entropy: random/gen_entropy.c ../library/libpolarssl.a
|
|
|
|
echo " CC random/gen_entropy.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) random/gen_entropy.c $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
random/gen_random_havege: random/gen_random_havege.c ../library/libpolarssl.a
|
|
|
|
echo " CC random/gen_random_havege.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) random/gen_random_havege.c $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
random/gen_random_ctr_drbg: random/gen_random_ctr_drbg.c ../library/libpolarssl.a
|
|
|
|
echo " CC random/gen_random_ctr_drbg.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) random/gen_random_ctr_drbg.c $(LDFLAGS) -o $@
|
2011-01-27 16:50:02 +00:00
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
ssl/ssl_client1: ssl/ssl_client1.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC ssl/ssl_client1.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_client1.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
ssl/ssl_client2: ssl/ssl_client2.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC ssl/ssl_client2.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_client2.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
ssl/ssl_server: ssl/ssl_server.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC ssl/ssl_server.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_server.c $(LDFLAGS) -o $@
|
|
|
|
|
2012-09-25 09:05:17 +00:00
|
|
|
ssl/ssl_server2: ssl/ssl_server2.c ../library/libpolarssl.a
|
|
|
|
echo " CC ssl/ssl_server2.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_server2.c $(LDFLAGS) -o $@
|
|
|
|
|
2011-05-20 12:33:05 +00:00
|
|
|
ssl/ssl_fork_server: ssl/ssl_fork_server.c ../library/libpolarssl.a
|
|
|
|
echo " CC ssl/ssl_fork_server.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_fork_server.c $(LDFLAGS) -o $@
|
|
|
|
|
2013-12-19 14:40:58 +00:00
|
|
|
ssl/ssl_pthread_server: ssl/ssl_pthread_server.c ../library/libpolarssl.a
|
|
|
|
echo " CC ssl/ssl_pthread_server.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_pthread_server.c $(LDFLAGS) -o $@ -lpthread
|
|
|
|
|
2011-05-23 12:07:29 +00:00
|
|
|
ssl/ssl_mail_client: ssl/ssl_mail_client.c ../library/libpolarssl.a
|
|
|
|
echo " CC ssl/ssl_mail_client.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) ssl/ssl_mail_client.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-02-09 22:32:35 +00:00
|
|
|
test/ssl_cert_test: test/ssl_cert_test.c ../library/libpolarssl.a
|
|
|
|
echo " CC test/ssl_cert_test.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) test/ssl_cert_test.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
test/benchmark: test/benchmark.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC test/benchmark.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) test/benchmark.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
test/selftest: test/selftest.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC test/selftest.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) test/selftest.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:51:57 +00:00
|
|
|
test/ssl_test: test/ssl_test.c ../library/libpolarssl.a
|
2009-01-03 21:22:43 +00:00
|
|
|
echo " CC test/ssl_test.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) test/ssl_test.c $(LDFLAGS) -o $@
|
|
|
|
|
2012-05-19 08:43:48 +00:00
|
|
|
test/o_p_test: test/o_p_test.c ../library/libpolarssl.a
|
|
|
|
echo " CC test/o_p_test.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) test/o_p_test.c $(LDFLAGS) -o $@ -lssl -lcrypto
|
|
|
|
|
2013-08-25 12:50:09 +00:00
|
|
|
util/pem2der: util/pem2der.c ../library/libpolarssl.a
|
|
|
|
echo " CC util/pem2der.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) util/pem2der.c $(LDFLAGS) -o $@
|
|
|
|
|
2012-05-08 08:36:15 +00:00
|
|
|
util/strerror: util/strerror.c ../library/libpolarssl.a
|
|
|
|
echo " CC util/strerror.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) util/strerror.c $(LDFLAGS) -o $@
|
|
|
|
|
2010-03-18 20:11:58 +00:00
|
|
|
x509/cert_app: x509/cert_app.c ../library/libpolarssl.a
|
|
|
|
echo " CC x509/cert_app.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) x509/cert_app.c $(LDFLAGS) -o $@
|
|
|
|
|
2011-02-12 15:27:28 +00:00
|
|
|
x509/crl_app: x509/crl_app.c ../library/libpolarssl.a
|
|
|
|
echo " CC x509/crl_app.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) x509/crl_app.c $(LDFLAGS) -o $@
|
|
|
|
|
2012-02-13 23:11:30 +00:00
|
|
|
x509/cert_req: x509/cert_req.c ../library/libpolarssl.a
|
|
|
|
echo " CC x509/cert_req.c"
|
|
|
|
$(CC) $(CFLAGS) $(OFLAGS) x509/cert_req.c $(LDFLAGS) -o $@
|
|
|
|
|
2009-01-03 21:22:43 +00:00
|
|
|
clean:
|
2012-05-10 21:26:28 +00:00
|
|
|
ifndef WINDOWS
|
2009-01-03 21:22:43 +00:00
|
|
|
rm -f $(APPS)
|
2012-05-10 21:26:28 +00:00
|
|
|
endif
|
|
|
|
ifdef WINDOWS
|
|
|
|
del /S /Q /F *.o *.exe
|
|
|
|
endif
|
2013-09-16 11:33:42 +00:00
|
|
|
|
|
|
|
list:
|
|
|
|
echo $(APPS)
|