Skip to content

Commit

Permalink
Update Makefile and Z3 auto-compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
perry0513 committed Oct 19, 2022
1 parent ac1f248 commit 57d6316
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
__pycache__/
g.smt2
*.smt2
*.o
slides/
**/prev/
multiseq_alignment/original_betterconcat.fasta
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "recognizer/z3"]
path = recognizer/z3
url = https://github.com/Z3Prover/z3
29 changes: 29 additions & 0 deletions recognizer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
CXX = g++
CFLAGS = -std=c++17 -lstdc++fs -pthread -O3
SRCDIR = ./src
Z3DIR = ./z3
SRC = $(shell find $(SRCDIR) -name '*.cpp')
OBJ = $(SRC:%.cpp=%.o)
STATIC_LIB = $(Z3DIR)/lib/libz3.a
INCLUDE=-I $(Z3DIR)/include/
EXE = recognizer

.PHONY: z3 clean

$(EXE): $(OBJ)
@echo "> Compiling $(EXE)"
@$(CXX) $^ -o $(EXE) $(CFLAGS) $(STATIC_LIB) $(INCLUDE) -w
@mkdir -p ../bin; cp $(EXE) ../bin
@echo $(EXE) copied to ../bin

%.o: %.cpp
@echo "> Compiling $^"
@$(CXX) $(CFLAGS) -c $(INCLUDE) $< -o $@

z3:
@cd $(Z3DIR); python3 scripts/mk_make.py -p ../ --staticlib
@cd $(Z3DIR)/build; make -j4; sudo make install

clean:
@rm $(EXE) $(OBJ)

48 changes: 0 additions & 48 deletions recognizer/src/test.cpp

This file was deleted.

1 change: 1 addition & 0 deletions recognizer/z3
Submodule z3 added at 77cbd8

0 comments on commit 57d6316

Please sign in to comment.