Sepehr fa480ed303 feat: implement mass balance validation for Story 7.1
- Added port_mass_flows to Component trait and implements for core components.
- Added System::check_mass_balance and integrated it into the solver.
- Restored connect methods for ExpansionValve, Compressor, and Pipe to fix integration tests.
- Updated Python and C bindings for validation errors.
- Updated sprint status and story documentation.
2026-02-21 23:21:34 +01:00

46 lines
1.2 KiB
Makefile

CC ?= gcc
CFLAGS = -Wall -Wextra -O2 -I../../../target
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LIB_EXT = dylib
LDFLAGS = -L../../../target/release -lentropyk_ffi
else ifeq ($(UNAME_S),Linux)
LIB_EXT = so
LDFLAGS = -L../../../target/release -lentropyk_ffi -Wl,-rpath,'$$ORIGIN/../../../target/release'
else
LIB_EXT = dll
LDFLAGS = -L../../../target/release -lentropyk_ffi
endif
TESTS = test_lifecycle test_errors test_solve test_latency test_memory
.PHONY: all clean run valgrind
all: $(TESTS)
$(TESTS): %: %.c ../../../target/entropyk.h ../../../target/release/libentropyk_ffi.$(LIB_EXT)
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
../../../target/entropyk.h ../../../target/release/libentropyk_ffi.$(LIB_EXT):
cd ../../.. && cargo build --release -p entropyk-c
run: $(TESTS)
@echo "Running all tests..."
@for test in $(TESTS); do \
echo "\n=== $$test ==="; \
./$$test || exit 1; \
done
@echo "\nAll tests PASSED"
valgrind: $(TESTS)
@echo "Running valgrind memory checks..."
@for test in $(TESTS); do \
echo "\n=== $$test (valgrind) ==="; \
valgrind --leak-check=full --error-exitcode=1 ./$$test || exit 1; \
done
@echo "\nAll valgrind checks PASSED"
clean:
rm -f $(TESTS)