Skip to content

Commit

Permalink
update build process (#179)
Browse files Browse the repository at this point in the history
* update build process

* address issues and update CI
  • Loading branch information
HuStmpHrrr authored Sep 9, 2024
1 parent 63c6d64 commit e1a03fd
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
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

0 comments on commit e1a03fd

Please sign in to comment.