Skip to content

Commit

Permalink
Compile static binary on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mhallin committed May 22, 2018
1 parent 59014b7 commit 44f728c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
/lib
/ppx
/graphql_ppx.*
jbuild.flags
.merlin
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
JBUILDER?=jbuilder

build:
OS:=$(shell uname -s)

build: src/jbuild.flags
$(JBUILDER) build @graphql_ppx
cp _build/default/src/graphql_ppx.exe .

Expand All @@ -12,6 +14,14 @@ test: build tests/graphql_schema.json
tests/graphql_schema.json: tests/schema.gql
node ./node_modules/gql-tools/cli/gqlschema.js -o tests/graphql_schema.json tests/schema.gql

ifeq ($(OS),Linux)
src/jbuild.flags:
echo '(-ccopt -static)' > $@
else
src/jbuild.flags:
echo '()' > $@
endif

clean:
$(JBUILDER) clean
rm -rf _build graphql_ppx.exe tests/lib
Expand Down
1 change: 1 addition & 0 deletions src/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
result
yojson
ppx_tools_versioned.metaquot_402))
(flags (:include jbuild.flags))
(preprocess (pps (ppx_tools_versioned.metaquot_402)))))

0 comments on commit 44f728c

Please sign in to comment.