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 1 commit
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
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
# TODO: redo this makefile properly
EXECUTABLE:=_build/default/driver/mcltt.exe

.PHONY: all clean

all:
@cd theories; make
@dune build
HuStmpHrrr marked this conversation as resolved.
Show resolved Hide resolved

clean:
@cd theories; make clean
@dune clean
HuStmpHrrr marked this conversation as resolved.
Show resolved Hide resolved
@echo "Cleaning finished."

${EXECUTABLE}: all
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
11 changes: 11 additions & 0 deletions driver/Mcltt.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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 ();
exit 0
HuStmpHrrr marked this conversation as resolved.
Show resolved Hide resolved
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