Skip to content

Commit

Permalink
Merge pull request #13 from dsprenkels/travis
Browse files Browse the repository at this point in the history
travis: Add emscripten build target
  • Loading branch information
Daan Sprenkels authored Mar 27, 2018
2 parents da118d3 + 392ba61 commit d4a32f8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
21 changes: 20 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,24 @@ matrix:
- musl
- musl-dev
- musl-tools
- language: node_js
node_js: "node"
sudo: required
services: ["docker"]
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash
script:
- docker exec -it emscripten make test.js
- make check-js
- language: node_js
node_js: "lts/*"
sudo: required
services: ["docker"]
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash
script:
- docker exec -it emscripten make test.js
- make check-js
script:
- make && make check
- make
- make check
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,28 @@ all: librandombytes.a
librandombytes.a: randombytes.o
$(AR) -rcs librandombytes.a randombytes.o

test: randombytes.o
randombytes.js: CC := ${EMSCRIPTEN}/emcc
randombytes.js: CFLAGS += -Wno-dollar-in-identifier-extension
randombytes.js: randombytes.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)

test: randombytes.o test.o

test.js: CC := ${EMSCRIPTEN}/emcc
test.js: CFLAGS += -Wno-dollar-in-identifier-extension
test.js: randombytes.c test.c
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)

test: randombytes.o test.o

.PHONY: check
check: test
./test

.PHONY: check
check-js: test.js
node test.js

.PHONY: clean
clean:
$(RM) librandombytes.a randombytes.o test test.o
$(RM) librandombytes.a randombytes.o randombytes.js test test.o test.js

0 comments on commit d4a32f8

Please sign in to comment.