@@ -26,13 +26,14 @@ SCARB_VERSION := 2.8.4
2626
2727.DEFAULT_GOAL := usage
2828.SILENT : clean
29- .PHONY : usage help check-llvm native-deps native-deps-macos native-deps-linux native-deps-windows build-explorer contracts clean deps install-scarb test-artifacts snos-artifacts db-compat-artifacts install-pyenv
29+ .PHONY : usage help check-llvm native-deps native-deps-macos native-deps-linux native-deps-windows build-explorer contracts clean deps install-scarb test-artifacts snos-artifacts db-compat-artifacts install-pyenv build-tee
3030
3131usage help :
3232 @echo " Usage:"
3333 @echo " deps: Install all required dependencies for building Katana with all features (incl. tests)."
3434 @echo " snos-deps: Install SNOS test dependencies (pyenv, Python 3.9.15)."
3535 @echo " build-explorer: Build the explorer."
36+ @echo " build-tee: Build reproducible TEE binary (requires Docker)."
3637 @echo " contracts: Build the contracts."
3738 @echo " test-artifacts: Prepare tests artifacts (including test database)."
3839 @echo " snos-artifacts: Prepare SNOS tests artifacts."
@@ -71,6 +72,21 @@ build-explorer:
7172
7273contracts : $(CONTRACTS_BUILD_DIR )
7374
75+ build-tee : contracts
76+ @which docker > /dev/null 2>&1 || { echo " Error: docker is required but not installed." ; exit 1; }
77+ @echo " Building reproducible TEE binary..."
78+ @docker build \
79+ -f reproducible.Dockerfile \
80+ --build-arg SOURCE_DATE_EPOCH=$$(git log -1 --format=%ct ) \
81+ -t katana-reproducible \
82+ .
83+ @echo " Extracting binary..."
84+ @docker create --name katana-tee-extract katana-reproducible > /dev/null
85+ @docker cp katana-tee-extract:/katana ./katana-tee
86+ @docker rm katana-tee-extract > /dev/null
87+ @echo " Reproducible TEE binary built: ./katana-tee"
88+ @echo " SHA-384: $$ (sha384sum ./katana-tee | cut -d ' ' -f 1)"
89+
7490# Generate the list of sources dynamically to make sure Make can track all files in all nested subdirs
7591$(CONTRACTS_BUILD_DIR ) : $(shell find $(CONTRACTS_DIR ) -type f)
7692 @echo " Building contracts..."
@@ -180,5 +196,5 @@ snos-deps-macos: install-pyenv
180196
181197clean :
182198 echo " Cleaning up generated files..."
183- -rm -rf $(SNOS_DB_DIR ) $(COMPATIBILITY_DB_DIR ) $(SNOS_OUTPUT ) $(EXPLORER_UI_DIST ) $(CONTRACTS_BUILD_DIR )
199+ -rm -rf $(SNOS_DB_DIR ) $(COMPATIBILITY_DB_DIR ) $(SNOS_OUTPUT ) $(EXPLORER_UI_DIST ) $(CONTRACTS_BUILD_DIR ) katana-tee
184200 echo " Clean complete."
0 commit comments