37 lines
1.2 KiB
Makefile
37 lines
1.2 KiB
Makefile
# Standalone build of the cli module, its unit test and the argparse parity driver.
|
|
# Usage (from taicpp/): make -f tests/cli.mk test
|
|
# Every output lands in build/cli.
|
|
CXX ?= g++
|
|
CXXFLAGS ?= -std=c++23 -Wall -Wextra -O1
|
|
MOLO ?= /home/retoor/projects/moloapp/src
|
|
B = build/cli
|
|
GEN = $(B)/gen
|
|
SRCS = $(wildcard src/cli/*.cpp)
|
|
INC = -Isrc/cli -I$(GEN) -I$(MOLO)
|
|
|
|
all: $(B)/cli_test $(B)/cli_driver $(B)/cli_main
|
|
|
|
$(GEN)/version.hpp: VERSION src/cli/version.hpp.in
|
|
@mkdir -p $(GEN)
|
|
@sed 's/@VERSION@/$(shell cat VERSION)/' src/cli/version.hpp.in > $@
|
|
|
|
$(B)/cli_test: tests/cli_test.cpp $(SRCS) $(GEN)/version.hpp
|
|
$(CXX) $(CXXFLAGS) $(INC) tests/cli_test.cpp $(SRCS) -o $@
|
|
|
|
$(B)/cli_driver: tests/cli_driver.cpp $(SRCS) $(GEN)/version.hpp
|
|
$(CXX) $(CXXFLAGS) $(INC) tests/cli_driver.cpp $(SRCS) -o $@
|
|
|
|
$(B)/cli_main: tests/cli_main.cpp $(SRCS) $(GEN)/version.hpp
|
|
$(CXX) $(CXXFLAGS) $(INC) tests/cli_main.cpp $(SRCS) -o $@
|
|
|
|
# Parse-only differential cases of tools/parity_diff.py against the cli-only entry point.
|
|
diff: $(B)/cli_main
|
|
python3 tools/parity_diff.py --detz $(CURDIR)/$(B)/cli_main --filter cli.
|
|
|
|
test: $(B)/cli_test $(B)/cli_driver
|
|
$(B)/cli_test
|
|
python3 tests/cli_parity.py --driver $(B)/cli_driver
|
|
|
|
clean:
|
|
rm -rf $(B)
|