Files
km 11bcc5e0c3 Remove dynamic memory allocation (malloc/calloc/free)
- Add static memory pool implementation (se050_mem_pool.c/h)
- Replace all malloc/calloc with pool allocations
- Replace all free with pool deallocations
- Remove strdup usage (use fixed-size buffer instead)
- Update I2C HAL to use fixed-size dev_path array
- All 24 tests pass with static memory only

Suitable for embedded environments (u-boot, ESP32) without heap.
2026-03-29 19:07:57 +09:00

38 lines
1023 B
Makefile

# SE050 WireGuard Makefile
CC = gcc
AR = ar
CFLAGS = -Wall -Wextra -std=c11 -I include
LDFLAGS =
SRCS = src/se050_i2c_hal.c src/se050_mem_pool.c src/se050_session.c src/se050_keystore.c \
src/se050_rng.c src/se050_x25519.c src/se050_x25519_sw.c \
src/se050_chacha20_poly1305.c src/se050_blake2s.c \
src/se050_hmac_blake2s.c src/se050_hkdf_blake2s.c src/se050_tai64n.c \
src/se050_scp03.c src/se050_scp03_keys.c src/se050_wireguard_proto.c \
src/se050_tai64n_hw.c src/se050_wireguard.c
OBJS = $(SRCS:.c=.o)
LIB = libse050_wireguard.a
.PHONY: all test clean
all: $(LIB) test_blake2s test_hmac_blake2s test_hkdf_blake2s
$(LIB): $(OBJS)
@mkdir -p build
$(AR) rcs build/$@ $^
# WireGuard protocol test
test_wireguard: tests/test_wireguard.c $(LIB)
@mkdir -p build
$(CC) $(CFLAGS) -o build/$@ $< build/$(LIB)
test: all test_wireguard
@./build/test_blake2s
@./build/test_hmac_blake2s
@./build/test_hkdf_blake2s
@./build/test_wireguard
clean:
rm -rf build *.o src/*.o tests/*.o