Files
moloapp/src/google/google.mk
T
retoorandClaude Sonnet 5.5 6d744a433f feat(clients): google foundation for the agent platform: all-verb client, streaming, typed Gemini content, operations
GoogleClient gets every verb and stream_json (SSE and plain JSON), typed
Content/Part/Tool/GenerateRequest with the LanguageModel seam, CloudContext
resource names, long-running operation polling and pagination, OAuth bearer
tokens via GOOGLE_ACCESS_TOKEN. Example scaffold: one stub per agent module
under example/app/agent, wildcard builds, locust excludes /voice /google
/agent. plans/16-agent-platform.md splits the work into nine modules.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 04:12:52 +02:00

53 lines
1.9 KiB
Makefile

# Per-part fragment for the Google Cloud APIs (owned dir: src/google).
# Included by the root Makefile, or run standalone:
# make -f src/google/google.mk [google|google-test|google-clean]
# Root wiring: `all` depends on `google`, `test` on `google-test`,
# `clean` on `google-clean`.
ROOT ?= .
CXX ?= g++
GOOGLE_CXXFLAGS ?= -std=c++23 -Wall -Wextra -Werror -DMOLO_HAS_WOLFSSL
CLIENTS_LIB ?= $(ROOT)/build/clients/libclients.a
OPERABILITY_LIB ?= build/liboperability.a
GOOGLE_INCS := -I$(ROOT)/src -I$(ROOT)/tests/src/clients
# Recursive: every module under src/google/<module>/ builds without editing
# this file.
GOOGLE_SRCS := $(sort $(shell find $(ROOT)/src/google -name "*.cpp")) \
$(ROOT)/src/security/crypto/Base64.cpp
GOOGLE_TEST_SRCS := $(sort $(shell find $(ROOT)/tests/src/google -name "*.cpp"))
GOOGLE_BUILD := $(ROOT)/build/google
GOOGLE_OBJDIR := $(GOOGLE_BUILD)/objs
GOOGLE_LIB := $(GOOGLE_BUILD)/libgoogle.a
GOOGLE_TEST_BIN := $(ROOT)/build/google_test
GOOGLE_OBJS := $(patsubst $(ROOT)/%.cpp,$(GOOGLE_OBJDIR)/%.o,$(GOOGLE_SRCS))
# Header changes must rebuild dependents (a stale object with an old class
# layout corrupts the heap).
-include $(GOOGLE_OBJS:.o=.d)
.PHONY: google google-test google-clean
google: $(GOOGLE_LIB)
$(GOOGLE_OBJDIR)/%.o: $(ROOT)/%.cpp
@mkdir -p $(dir $@)
$(CXX) $(GOOGLE_CXXFLAGS) -MMD -MP -I$(ROOT)/src -c $< -o $@
$(GOOGLE_LIB): $(GOOGLE_OBJS)
@mkdir -p $(dir $@)
$(AR) rcs $@ $^
# The clients test harness (framework.h plus main.cpp) is reused, not copied.
google-test: $(GOOGLE_TEST_BIN)
$(GOOGLE_TEST_BIN)
$(GOOGLE_TEST_BIN): $(GOOGLE_OBJS) $(GOOGLE_TEST_SRCS) $(CLIENTS_LIB) $(OPERABILITY_LIB) $(ROOT)/tests/src/clients/main.cpp
@mkdir -p $(dir $@)
$(CXX) $(GOOGLE_CXXFLAGS) $(GOOGLE_INCS) $(GOOGLE_OBJS) $(GOOGLE_TEST_SRCS) $(ROOT)/tests/src/clients/main.cpp $(CLIENTS_LIB) $(OPERABILITY_LIB) -lwolfssl -o $@
google-clean:
rm -rf $(GOOGLE_BUILD) $(GOOGLE_TEST_BIN)