Files
tai/taicpp/tests/misc.mk
T

35 lines
1013 B
Makefile

# Standalone build of the misc modules (skills, sched, telegram, rag, install) and their tests.
# Usage (from taicpp/): make -f tests/misc.mk test
# The integrator can fold these into the main Makefile; see docs/wiring/misc.md.
CXX ?= g++
CXXFLAGS ?= -std=c++23 -Wall -Wextra -O1
B = build/misc
DIRS = src/skills src/sched src/telegram src/rag src/install
INC = $(foreach d,$(DIRS),-I$d)
SRCS = $(foreach d,$(DIRS),$(wildcard $(d)/*.cpp))
OBJS = $(patsubst %.cpp,$(B)/%.o,$(SRCS))
LIBS = -lsqlite3 -lcurl -lz -lpthread
all: $(B)/misc_test $(B)/misc_driver
$(B)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $(INC) -MMD -MP -c $< -o $@
$(B)/misc_test: tests/misc_test.cpp $(OBJS)
@mkdir -p $(B)
$(CXX) $(CXXFLAGS) $(INC) tests/misc_test.cpp $(OBJS) $(LIBS) -o $@
$(B)/misc_driver: tests/misc_driver.cpp $(OBJS)
@mkdir -p $(B)
$(CXX) $(CXXFLAGS) $(INC) tests/misc_driver.cpp $(OBJS) $(LIBS) -lz -o $@
test: $(B)/misc_test
$(B)/misc_test
objs: $(OBJS)
.PHONY: all test objs
-include $(OBJS:.o=.d)