mirror of
https://github.com/itzmeanjan/ml-kem.git
synced 2026-01-08 23:27:54 -05:00
Run examples using Make command
Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
This commit is contained in:
1
Makefile
1
Makefile
@@ -26,6 +26,7 @@ BUILD_DIR := build
|
||||
|
||||
include tests/test.mk
|
||||
include benchmarks/bench.mk
|
||||
include examples/example.mk
|
||||
|
||||
$(SUBTLE_INC_DIR):
|
||||
git submodule update --init subtle
|
||||
|
||||
15
examples/example.mk
Normal file
15
examples/example.mk
Normal file
@@ -0,0 +1,15 @@
|
||||
EXAMPLE_BUILD_DIR := $(BUILD_DIR)/example
|
||||
|
||||
EXAMPLE_DIR := examples
|
||||
EXAMPLE_SOURCES := $(wildcard $(EXAMPLE_DIR)/*.cpp)
|
||||
EXAMPLE_HEADERS := $(wildcard $(EXAMPLE_DIR)/*.hpp)
|
||||
EXAMPLE_EXECS := $(addprefix $(EXAMPLE_BUILD_DIR)/, $(notdir $(EXAMPLE_SOURCES:.cpp=.exe)))
|
||||
|
||||
$(EXAMPLE_BUILD_DIR):
|
||||
mkdir -p $@
|
||||
|
||||
$(EXAMPLE_BUILD_DIR)/%.exe: $(EXAMPLE_DIR)/%.cpp $(EXAMPLE_BUILD_DIR)
|
||||
$(CXX) $(CXX_DEFS) $(CXX_FLAGS) $(WARN_FLAGS) $(RELEASE_FLAGS) $(I_FLAGS) $(DEP_IFLAGS) $< -o $@
|
||||
|
||||
example: $(EXAMPLE_EXECS) ## Build and run example program, demonstrating usage of ML-KEM API
|
||||
$(foreach exec,$^,./$(exec);)
|
||||
Reference in New Issue
Block a user