mirror of
https://github.com/logos-blockchain/logos-blockchain-pocs.git
synced 2026-03-20 18:43:11 +00:00
Simplify witness generator makefile.
This commit is contained in:
parent
7f75894323
commit
7806db9814
43
.github/resources/witness-generator/Makefile
vendored
Normal file
43
.github/resources/witness-generator/Makefile
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
.PHONY: linux macos windows build clean
|
||||
|
||||
# ---- Common ----
|
||||
CXX := g++
|
||||
CXXFLAGS_COMMON := -std=c++11 -O3 -I. -Wno-address-of-packed-member
|
||||
SRCS := main.cpp calcwit.cpp fr.cpp pol.cpp
|
||||
OBJS := $(SRCS:.cpp=.o)
|
||||
DEPS_HPP := circom.hpp calcwit.hpp fr.hpp
|
||||
BIN_WINDOWS := pol.exe
|
||||
BIN_UNIX := pol
|
||||
BINS := $(BIN_UNIX) $(BIN_WINDOWS)
|
||||
|
||||
# ---- Linux ----
|
||||
linux: BIN=$(BIN_UNIX)
|
||||
linux: CXXFLAGS=$(CXXFLAGS_COMMON)
|
||||
linux: LDFLAGS=-static
|
||||
linux: LDLIBS=-lgmp
|
||||
linux: $(BIN_UNIX)
|
||||
|
||||
# ---- macOS ----
|
||||
macos: BIN=$(BIN_UNIX)
|
||||
macos: CXXFLAGS=$(CXXFLAGS_COMMON) -I/opt/homebrew/include -include gmp_patch.hpp
|
||||
macos: LDFLAGS=-Wl,-search_paths_first -Wl,-dead_strip
|
||||
macos: LDLIBS=/opt/homebrew/lib/libgmp.a
|
||||
macos: $(BIN_UNIX)
|
||||
|
||||
# ---- Windows (MinGW) ----
|
||||
windows: BIN=$(BIN_WINDOWS)
|
||||
windows: CXXFLAGS=$(CXXFLAGS_COMMON) -I/include -Duint="unsigned int"
|
||||
windows: LDFLAGS=-static
|
||||
windows: LDLIBS=-L/lib -lgmp -lmman
|
||||
windows: $(BIN_WINDOWS)
|
||||
|
||||
# ---- Rules ----
|
||||
$(BINS): $(OBJS)
|
||||
$(CXX) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
||||
|
||||
%.o: %.cpp $(DEPS_HPP)
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(BIN_WINDOWS) $(BIN_UNIX)
|
||||
|
||||
12
.github/workflows/build-circuits.yml
vendored
12
.github/workflows/build-circuits.yml
vendored
@ -104,11 +104,11 @@ jobs:
|
||||
|
||||
- name: Replace Witness Generator Makefile # TODO: Make a fork generate the appropriate Linux Makefile
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/${{ env.OS }}.Makefile circom_circuits/Mantle/pol_cpp/Makefile
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/pol_cpp/Makefile
|
||||
|
||||
- name: Compile Witness Generator
|
||||
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
||||
run: make pol
|
||||
run: make linux
|
||||
|
||||
- name: Bundle Rapidsnark Prover
|
||||
working-directory: repo
|
||||
@ -270,12 +270,12 @@ jobs:
|
||||
- name: Replace Witness Generator Makefile # TODO: Make a fork generate the appropriate Windows Makefile
|
||||
shell: msys2 {0}
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/${{ env.OS }}.Makefile circom_circuits/Mantle/pol_cpp/Makefile
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/pol_cpp/Makefile
|
||||
|
||||
- name: Compile Witness Generator
|
||||
shell: msys2 {0}
|
||||
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
||||
run: make pol.exe
|
||||
run: make windows
|
||||
|
||||
- name: Bundle Rapidsnark Prover
|
||||
shell: msys2 {0}
|
||||
@ -394,7 +394,7 @@ jobs:
|
||||
|
||||
- name: Replace Witness Generator's Makefile # TODO: Make a fork generate the appropriate MacOS Makefile
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/${{ env.OS }}.Makefile circom_circuits/Mantle/pol_cpp/Makefile
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/pol_cpp/Makefile
|
||||
|
||||
- name: Patch MacOS GMP
|
||||
working-directory: repo
|
||||
@ -402,7 +402,7 @@ jobs:
|
||||
|
||||
- name: Compile Witness Generator
|
||||
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
||||
run: make pol
|
||||
run: make macos
|
||||
|
||||
- name: Bundle Rapidsnark Prover
|
||||
working-directory: repo
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user