Justin Traglia dc28b03f9d
Cleanup the Makefile (#119)
* Cleanup the Makefile some

* Fix compiler error

* Fix compiler errors in tests

* Fix problems on Linux

* Add test_c_kzg_4844_cov to gitignore

* Add back closing brace for cpp

* Split clean rule into two lines

* Not echo commands when running them

* Allow other compilers to be used

* Update comment

* Only allow clang, actually
2023-02-08 17:35:33 +00:00

38 lines
833 B
Makefile

all: clean build format test bundle
clean:
yarn node-gyp clean
rm -rf build
rm -rf dist
rm -f *.node
rm -f *.a
rm -f *.o
build: kzg.cxx kzg.ts package.json binding.gyp Makefile
cd ../../src && make c_kzg_4844.o && cp c_kzg_4844.o ../bindings/node.js
yarn install
yarn node-gyp rebuild
test: build
yarn jest
format:
yarn prettier --write .
bundle: clean
yarn rollup --config rollup.config.js --bundleConfigAsCjs
mkdir -p dist/deps/c-kzg
cp -r ../../blst dist/deps
cp ../../src/c_kzg_4844.c dist/deps/c-kzg
cp ../../src/c_kzg_4844.h dist/deps/c-kzg
publish: bundle
mv binding.gyp binding.gyp.bak
cp binding.dist.gyp binding.gyp
npm publish && mv binding.gyp.bak binding.gyp || mv binding.gyp.bak binding.gyp
linux-test: bundle
docker build -t "linux-test" .
docker logs --follow `docker run -d linux-test`