dune/Makefile

54 lines
1.1 KiB
Makefile
Raw Normal View History

2017-02-27 12:06:59 +00:00
INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),)
BIN := ./_build/default/bin/main.exe
2016-12-02 13:54:32 +00:00
default: boot.exe
./boot.exe -j 4 --dev
release: boot.exe
./boot.exe -j 4
boot.exe: bootstrap.ml
ocaml bootstrap.ml
2016-12-02 13:54:32 +00:00
install:
2017-02-27 12:06:59 +00:00
$(BIN) install $(INSTALL_ARGS)
2016-12-02 13:54:32 +00:00
uninstall:
2017-02-27 12:06:59 +00:00
$(BIN) uninstall $(INSTALL_ARGS)
2016-12-02 13:54:32 +00:00
reinstall: uninstall reinstall
test:
$(BIN) runtest --dev
2017-02-27 15:04:49 +00:00
all-supported-ocaml-versions:
$(BIN) build --dev @install @runtest --workspace jbuild-workspace.dev --root .
2017-02-27 15:04:49 +00:00
2016-12-02 13:54:32 +00:00
clean:
$(BIN) clean
rm -f ./boot.exe
2016-12-02 13:54:32 +00:00
doc:
cd doc && sphinx-build . _build
CMDS = $(shell $(BIN) --help=plain | \
sed -n '/COMMANDS/,/OPTIONS/p' | sed -En 's/^ ([a-z-]+)/\1/p')
update-jbuilds: $(BIN)
sed -n '1,/;;GENERATED/p' doc/jbuild > doc/jbuild.tmp
{ for cmd in $(CMDS); do \
echo -ne "\n"\
"(rule\n"\
" ((targets (jbuilder-$$cmd.1))\n"\
" (action (with-stdout-to $$""{@}\n"\
" (run $$""{bin:jbuilder} $$cmd --help=groff)))))\n"\
"\n"\
"(install\n"\
" ((section man)\n"\
" (files (jbuilder-$$cmd.1))))\n"; \
done } >> doc/jbuild.tmp
rm -f doc/jbuild
mv doc/jbuild.tmp doc/jbuild
.PHONY: default install uninstall reinstall clean test doc