Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis revisited (still with astyle) and nicer makefile output #80

Merged
merged 11 commits into from
Dec 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ matrix:
packages:
- gcc-4.8
before_install:
- wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz
- tar xzf astyle_2.05.1_linux.tar.gz
- cd astyle/build/gcc && make && export PATH=$(pwd)/bin:$PATH && cd ../../../
- bash .travis/install-astyle-linux.sh
- export PATH=$(pwd)/astyle/build/gcc/bin:$PATH
- os: linux
compiler: gcc
env: CC_OQS=gcc-4.9
Expand All @@ -27,9 +26,8 @@ matrix:
packages:
- gcc-4.9
before_install:
- wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz
- tar xzf astyle_2.05.1_linux.tar.gz
- cd astyle/build/gcc && make && export PATH=$(pwd)/bin:$PATH && cd ../../../
- bash .travis/install-astyle-linux.sh
- export PATH=$(pwd)/astyle/build/gcc/bin:$PATH
- os: linux
compiler: gcc
env: CC_OQS=gcc-5
Expand All @@ -40,9 +38,8 @@ matrix:
packages:
- gcc-5
before_install:
- wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz
- tar xzf astyle_2.05.1_linux.tar.gz
- cd astyle/build/gcc && make && export PATH=$(pwd)/bin:$PATH && cd ../../../
- bash .travis/install-astyle-linux.sh
- export PATH=$(pwd)/astyle/build/gcc/bin:$PATH
- os: linux
compiler: gcc
env: CC_OQS=gcc-6 USE_OPENSSL=1
Expand All @@ -54,18 +51,15 @@ matrix:
- gcc-6
- libssl-dev
before_install:
- wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz
- tar xzf astyle_2.05.1_linux.tar.gz
- cd astyle/build/gcc && make && export PATH=$(pwd)/bin:$PATH && cd ../../../
- bash .travis/install-astyle-linux.sh
- export PATH=$(pwd)/astyle/build/gcc/bin:$PATH
- os: osx
compiler: clang
env: CC_OQS=clang AES_NI=0 USE_OPENSSL=1 ENABLE_CODE_MCBITS=1
before_install:
- brew install astyle openssl libsodium

script:
- make
- make check
- bash .travis-style-check.sh
- bash .travis-global-namespace-check.sh
- bash .travis-banned-functions-check.sh
- CC=$CC_OQS make
- CC=$CC_OQS make check
- for f in $(ls .travis/*-check.sh); do bash $f; done
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions .travis/install-astyle-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
#
# Install astyle on Linux
#

if [ ! -x "$(which astyle)" ]; then
# Download astyle
wget http://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_linux.tar.gz
tar xzf astyle_2.05.1_linux.tar.gz
cd astyle/build/gcc
make
fi;
File renamed without changes.
61 changes: 33 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ifdef CC_OQS
CC=$(CC_OQS)
else
ifndef CC
CC=cc
endif

Expand Down Expand Up @@ -67,26 +65,27 @@ all: links lib tests

objs/%.o: src/%.c | links
@mkdir -p $(@D)
$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
@$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
@echo "CC \t$<"

links:
rm -rf include/oqs
mkdir -p include/oqs
$(LN) ../../src/crypto/aes/aes.h include/oqs
$(LN) ../../src/crypto/sha3/sha3.h include/oqs
$(LN) ../../src/kex/kex.h include/oqs
$(LN) ../../src/kex_rlwe_bcns15/kex_rlwe_bcns15.h include/oqs
$(LN) ../../src/kex_rlwe_newhope/kex_rlwe_newhope.h include/oqs
$(LN) ../../src/kex_rlwe_msrln16/kex_rlwe_msrln16.h include/oqs
@$(RM) -r include/oqs
@mkdir -p include/oqs
@$(LN) ../../src/crypto/aes/aes.h include/oqs
@$(LN) ../../src/crypto/sha3/sha3.h include/oqs
@$(LN) ../../src/kex/kex.h include/oqs
@$(LN) ../../src/kex_rlwe_bcns15/kex_rlwe_bcns15.h include/oqs
@$(LN) ../../src/kex_rlwe_newhope/kex_rlwe_newhope.h include/oqs
@$(LN) ../../src/kex_rlwe_msrln16/kex_rlwe_msrln16.h include/oqs
ifdef ENABLE_CODE_MCBITS
$(LN) ../../src/kex_code_mcbits/kex_code_mcbits.h include/oqs
@$(LN) ../../src/kex_code_mcbits/kex_code_mcbits.h include/oqs
endif
$(LN) ../../src/kex_lwe_frodo/kex_lwe_frodo.h include/oqs
$(LN) ../../src/kex_sidh_cln16/kex_sidh_cln16.h include/oqs
$(LN) ../../src/crypto/rand/rand.h include/oqs
$(LN) ../../src/crypto/rand_urandom_chacha20/rand_urandom_chacha20.h include/oqs
$(LN) ../../src/crypto/rand_urandom_aesctr/rand_urandom_aesctr.h include/oqs
$(LN) ../../src/common/common.h include/oqs
@$(LN) ../../src/kex_lwe_frodo/kex_lwe_frodo.h include/oqs
@$(LN) ../../src/kex_sidh_cln16/kex_sidh_cln16.h include/oqs
@$(LN) ../../src/crypto/rand/rand.h include/oqs
@$(LN) ../../src/crypto/rand_urandom_chacha20/rand_urandom_chacha20.h include/oqs
@$(LN) ../../src/crypto/rand_urandom_aesctr/rand_urandom_aesctr.h include/oqs
@$(LN) ../../src/common/common.h include/oqs

# RAND_URANDOM_CHACHA
RAND_URANDOM_CHACHA_OBJS := $(addprefix objs/crypto/rand_urandom_chacha20/, rand_urandom_chacha20.o)
Expand Down Expand Up @@ -122,7 +121,8 @@ $(KEX_LWE_FRODO_OBJS): $(KEX_LWE_FRODO_HEADERS)
# KEX_SIDH_CLN16
#ifneq (,$(findstring SIDH_ASM,$(CFLAGS)))
objs/kex_sidh_cln16/fp_x64_asm.o: src/kex_sidh_cln16/AMD64/fp_x64_asm.S
$(CC) $(CFLAGS) -c -o $@ src/kex_sidh_cln16/AMD64/fp_x64_asm.S
@$(CC) $(CFLAGS) -c -o $@ src/kex_sidh_cln16/AMD64/fp_x64_asm.S
@echo "CC \t$<"
KEX_SIDH_CLN16_ASM_OBJS = fp_x64_asm.o
#endif
KEX_SIDH_CLN16_OBJS := $(addprefix objs/kex_sidh_cln16/, ec_isogeny.o fpx.o kex_sidh_cln16.o SIDH.o sidh_kex.o SIDH_setup.o validate.o $(KEX_SIDH_CLN16_ASM_OBJS))
Expand Down Expand Up @@ -168,14 +168,19 @@ KEX_OBJS += $(KEX_CODE_MCBITS_OBJS)
endif

lib: $(RAND_OBJS) $(KEX_OBJS) $(AES_OBJS) $(COMMON_OBJS) $(SHA3_OBJS)
rm -f liboqs.a
$(AR) liboqs.a $^
$(RANLIB) liboqs.a
@rm -f liboqs.a
@$(AR) liboqs.a $^
@echo "AR \tliboqs.a"
@$(RANLIB) liboqs.a
@echo "RANLIB \tliboqs.a"

tests: lib src/crypto/rand/test_rand.c src/kex/test_kex.c src/crypto/aes/test_aes.c src/ds_benchmark.h
$(CC) $(CFLAGS) $(INCLUDES) -L. src/crypto/rand/test_rand.c -loqs $(LDFLAGS) -o test_rand
$(CC) $(CFLAGS) $(INCLUDES) -L. src/kex/test_kex.c -loqs $(LDFLAGS) -o test_kex
$(CC) $(CFLAGS) $(INCLUDES) -L. src/crypto/aes/test_aes.c -loqs $(LDFLAGS) -o test_aes
@$(CC) $(CFLAGS) $(INCLUDES) -L. src/crypto/rand/test_rand.c -loqs $(LDFLAGS) -o test_rand
@echo "CC \tsrc/crypto/rand/test_rand.c"
@$(CC) $(CFLAGS) $(INCLUDES) -L. src/kex/test_kex.c -loqs $(LDFLAGS) -o test_kex
@echo "CC \tsrc/kex/test_kex.c"
@$(CC) $(CFLAGS) $(INCLUDES) -L. src/crypto/aes/test_aes.c -loqs $(LDFLAGS) -o test_aes
@echo "CC \tsrc/crypto/aes/test_aes.c"

docs: links
doxygen
Expand All @@ -186,8 +191,8 @@ check: links tests
./test_aes

clean:
rm -rf docs/doxygen objs include
rm -f test_rand test_kex test_aes liboqs.a
$(RM) -r docs/doxygen objs include
$(RM) -r test_rand{,.dSYM} test_kex{,.dSYM} test_aes{,.dSYM} liboqs.a
find . -name .DS_Store -type f -delete

prettyprint:
Expand Down