99# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010# See the License for the specific language governing permissions and
1111# limitations under the License.
12-
13-
1412APP_NAME := function-stream
1513VERSION := $(shell grep '^version' Cargo.toml | head -1 | awk -F '"' '{print $$2}')
1614DATE := $(shell date -u +"% Y-% m-% dT% H:% M:% SZ")
@@ -29,30 +27,22 @@ endif
2927OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
3028OS_NAME := $(shell uname -s)
3129
32- # 2. Configure RUSTFLAGS and target triple per platform
30+ # 2. Configure target triple per platform
3331DIST_ROOT := dist
3432ifeq ($(OS_NAME ) , Linux)
3533 TRIPLE := $(ARCH ) -unknown-linux-gnu
3634 STATIC_FLAGS :=
3735else ifeq ($(OS_NAME), Darwin)
38- # macOS: strip symbols but keep dynamic linking (Apple system restriction)
3936 TRIPLE := $(ARCH ) -apple-darwin
4037 STATIC_FLAGS :=
4138else ifneq (,$(findstring MINGW,$(OS_NAME))$(findstring MSYS,$(OS_NAME)))
42- # Windows (Git Bash / MSYS2): static-link MSVC runtime
4339 TRIPLE := $(ARCH ) -pc-windows-msvc
4440 STATIC_FLAGS := -C target-feature=+crt-static
4541else
46- # Fallback
4742 TRIPLE := $(ARCH ) -unknown-linux-gnu
4843 STATIC_FLAGS :=
4944endif
5045
51- # 3. Aggressive optimization flags
52- # opt-level=z : size-oriented, minimize binary footprint
53- # strip=symbols: remove debug symbol table at link time
54- # Note: panic=abort is intentionally omitted to preserve stack unwinding
55- # for better fault tolerance in the streaming runtime
5646OPTIMIZE_FLAGS := -C opt-level=z -C strip=symbols $(STATIC_FLAGS )
5747
5848TARGET_DIR := target/$(TRIPLE ) /release
@@ -110,7 +100,7 @@ help:
110100 (printf " $( C_Y) [!] Auto-installing target toolchain for $( OS_NAME) : $( TRIPLE) $( C_0) \n" && \
111101 rustup target add $(TRIPLE ) )
112102
113- # 5. Build targets (depend on .ensure-target for automatic toolchain setup)
103+ # 5. Build targets
114104build : .check-env .ensure-target .build-wasm
115105 $(call log,BUILD,Rust Full [$(OS_NAME ) / $(TRIPLE ) ])
116106 @RUSTFLAGS=" $( OPTIMIZE_FLAGS) " \
@@ -128,24 +118,24 @@ build: .check-env .ensure-target .build-wasm
128118
129119build-lite : .check-env .ensure-target
130120 $(call log,BUILD,Rust Lite [$(OS_NAME ) / $(TRIPLE ) ])
131- @RUSTFLAGS=" $( OPTIMIZE_FLAGS ) " \
121+ @RUSTFLAGS=" $( INDUSTRIAL_RUSTFLAGS ) " \
132122 cargo build --release \
133- --target $(TRIPLE ) \
134- --no-default-features \
135- --features incremental-cache \
136- --quiet
123+ --target $(TRIPLE ) \
124+ --no-default-features \
125+ --features incremental-cache \
126+ --quiet
137127 $(call log,BUILD,CLI for dist)
138- @RUSTFLAGS=" $( OPTIMIZE_FLAGS ) " \
128+ @RUSTFLAGS=" $( INDUSTRIAL_RUSTFLAGS ) " \
139129 cargo build --release \
140- --target $(TRIPLE ) \
141- -p function-stream-cli \
142- --quiet
130+ --target $(TRIPLE ) \
131+ -p function-stream-cli \
132+ --quiet
143133 $(call success,Target: $(TARGET_DIR ) /$(APP_NAME ) $(TARGET_DIR ) /cli)
144134
145135.build-wasm :
146136 $(call log,WASM,Building Python Runtime using $(PYTHON_EXEC ) )
147137 @cd $(PYTHON_ROOT ) /functionstream-runtime && \
148- PYTHONPATH=../functionstream-api:../functionstream-api-advanced ../../$(PYTHON_EXEC ) build.py > /dev/null
138+ PYTHONPATH=../functionstream-api:../functionstream-api-advanced ../../$(PYTHON_EXEC ) build.py > /dev/null
149139 @[ -f " $( WASM_SOURCE) " ] || (printf " $( C_R) [X] WASM Build Failed$( C_0) \n" && exit 1)
150140
151141dist : build
@@ -223,9 +213,9 @@ docker:
223213docker-run :
224214 $(call log,DOCKER,Starting Container)
225215 @docker run --rm -it \
226- -p 8080:8080 \
227- -v $(CURDIR ) /logs:/app/logs \
228- $(IMAGE_NAME )
216+ -p 8080:8080 \
217+ -v $(CURDIR ) /logs:/app/logs \
218+ $(IMAGE_NAME )
229219
230220docker-push :
231221 $(call log,DOCKER,Pushing $(IMAGE_NAME ) )
0 commit comments