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

update build process #179

Merged
merged 2 commits into from
Sep 9, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/ci_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ jobs:
make -j ${{ steps.cpu-cores.outputs.count }} pretty-timed
endGroup
after_script: |
startGroup "Test parser"
dune build
dune runtest
startGroup "Build binary"
cd ..
make
endGroup
export: "OPAMJOBS OPAMYES"
env:
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
# TODO: redo this makefile properly
.PHONY: all clean

all:
@make -C theories
@dune build

clean:
@make clean -C theories
@dune clean
@echo "Cleaning finished."
2 changes: 1 addition & 1 deletion driver/Main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ let main ?(default_fp = "") () =
with
| Failure s -> prerr_string s; raise Exit) in
let token_stream = loop (Lexing.from_channel chan) in
let res = Entrypoint.main max_int token_stream in
let res = Entrypoint.main 500 token_stream in
Format.printf "%a@."
PrettyPrinter.format_main_result res
10 changes: 10 additions & 0 deletions driver/Mcltt.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
open Mcltt.Main

let () =
if Array.length Sys.argv <> 2 then
begin
Printf.fprintf stderr "incorrect input: %s <input-file>\n" Sys.argv.(0);
exit 1
end;
let filename = Sys.argv.(1) in
main ~default_fp:filename ()
5 changes: 5 additions & 0 deletions driver/dune
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
; (pps ppx_inline_test))
)

(executable
(name mcltt)
(modules Mcltt)
(libraries Mcltt))

(env
(dev
(flags
Expand Down
18 changes: 17 additions & 1 deletion theories/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
NPROCS := 1
OS := $(shell uname)
export NPROCS

ifeq ($J,)

ifeq ($(OS),Linux)
NPROCS := $(shell grep -c ^processor /proc/cpuinfo)
else ifeq ($(OS),Darwin)
NPROCS := $(shell system_profiler | awk '/Number of CPUs/ {print $$4}{next;}')
endif # $(OS)

else
NPROCS := $J
endif # $J

empty :=
space := $(empty) $(empty)

Expand All @@ -19,7 +35,7 @@ COQFILES := $(sort $(shell find ./ -name '*.v') $(COQPARSERFILE))

.PHONY: all
all: $(COQMAKEFILE)
@+$(MAKE) -f "$(COQMAKEFILE)" all
@+$(MAKE) -j "${NPROCS}" -f "$(COQMAKEFILE)" all

.PHONY: clean
clean: $(COQMAKEFILE)
Expand Down
Loading