From b6d0e33dfce284ede3667c4bb9be33e279a110de Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Tue, 14 May 2019 06:23:06 -0700 Subject: [PATCH] [sledge] Simplify build Reviewed By: jvillard Differential Revision: D15316845 fbshipit-source-id: ff7864fb7 --- .gitignore | 1 + sledge/.gitignore | 1 + sledge/Makefile | 28 ++++++++++++++++++++-------- sledge/bin/{sledge.opt => sledge} | 0 sledge/dune-project | 2 +- sledge/sledge.opam | 1 + 6 files changed, 24 insertions(+), 9 deletions(-) rename sledge/bin/{sledge.opt => sledge} (100%) diff --git a/.gitignore b/.gitignore index bce6fca4c..ae38add62 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,7 @@ duplicates.txt /Makefile.autoconf /.buckversion /*/.gitignore +/*/*/.gitignore # IntelliJ files /scripts/.idea/ diff --git a/sledge/.gitignore b/sledge/.gitignore index 962fb543d..f5a70988c 100644 --- a/sledge/.gitignore +++ b/sledge/.gitignore @@ -1,4 +1,5 @@ .merlin +/bin/ /llvm/ /model/cxxabi.bc /src/dune diff --git a/sledge/Makefile b/sledge/Makefile index 93fcc6c44..e74b85b70 100644 --- a/sledge/Makefile +++ b/sledge/Makefile @@ -6,8 +6,20 @@ .PHONY: default default: exes -DUNEINS=$(shell find src -name dune.in) -DUNES=$(patsubst %.in,%,$(DUNEINS)) +EXES = src/sledge +INSTALLS = sledge + +facebook/Makefile: + -@${MAKE} -s -C ../facebook setup + -@${MAKE} -s -C facebook + +-include facebook/Makefile + +DBG_TARGETS = $(patsubst %,_build/dev/%.exe,$(EXES)) $(patsubst %,_build/dev/%.install,$(INSTALLS)) +OPT_TARGETS = $(patsubst %,_build/release/%.exe,$(EXES)) $(patsubst %,_build/release/%.install,$(INSTALLS)) + +DUNEINS = $(shell find src facebook -name dune.in) +DUNES = $(patsubst %.in,%,$(DUNEINS)) .PHONY: dunes dunes: $(DUNES) @@ -16,7 +28,7 @@ dunes: $(DUNES) @cat $+ > $@ .PHONY: setup -setup: dunes +setup: facebook/Makefile dunes .PHONY: check check: setup @@ -24,25 +36,25 @@ check: setup .PHONY: exes exes: setup - dune build _build/dev/src/sledge.exe _build/release/src/sledge.exe _build/dev/sledge.install _build/release/sledge.install + dune build $(DBG_TARGETS) $(OPT_TARGETS) .PHONY: dbg dbg: setup - dune build _build/dev/src/sledge.exe _build/dev/sledge.install + dune build $(DBG_TARGETS) .PHONY: opt opt: setup - dune build _build/release/src/sledge.exe _build/release/sledge.install + dune build $(OPT_TARGETS) .PHONY: watch watch: setup - dune build --watch _build/dev/src/sledge.exe _build/release/src/sledge.exe + dune build --watch $(DBG_TARGETS) $(OPT_TARGETS) .PHONY: test test: setup dune build @_build/dev/runtest --auto-promote -BISECT_DIR=$(CURDIR)/_coverage/out +BISECT_DIR = $(CURDIR)/_coverage/out .PHONY: coverage coverage: setup diff --git a/sledge/bin/sledge.opt b/sledge/bin/sledge similarity index 100% rename from sledge/bin/sledge.opt rename to sledge/bin/sledge diff --git a/sledge/dune-project b/sledge/dune-project index b38208cca..54fee445b 100644 --- a/sledge/dune-project +++ b/sledge/dune-project @@ -1,2 +1,2 @@ (lang dune 1.1) -(using fmt 1.0) +(using fmt 1.1) diff --git a/sledge/sledge.opam b/sledge/sledge.opam index f440512f4..246d7279e 100644 --- a/sledge/sledge.opam +++ b/sledge/sledge.opam @@ -21,6 +21,7 @@ depends: [ "ppx_compare" "ppx_deriving_cmdliner" {>= "0.4.2"} "ppx_hash" + "shexp" "zarith" ] synopsis: "SLEdge analyzer"