mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Refactor ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description Move source files under new directory. ---- #### AI description (iteration 1) #### PR Classification Code reorganization #### PR Summary This pull request moves the `helio_api` and `helio_distributed` sources under the `documentdb` directory, updating references and initialization logic accordingly. - Added `pg_documentdb.c` for initializing the `pg_documentdb` extension. - Added `documentdb_distributed.c` for initializing the `pg_documentdb_distributed` extension. - Updated `validate_helio_extension_state.sh` to include new checks for `documentdb`. - Moved `helio_api_extension_version.c` to `documentdb_extension_version.c` without code changes. - Updated various `Makefile` configurations to reflect the new directory structure and dependencies.
96 lines
2.7 KiB
Makefile
Executable File
96 lines
2.7 KiB
Makefile
Executable File
EXTENSION = documentdb_distributed
|
|
|
|
# compilation configuration
|
|
MODULE_big = pg_$(EXTENSION)
|
|
|
|
SQL_DEPDIR=.deps/sql
|
|
SQL_BUILDDIR=build/sql
|
|
|
|
template_sql_files = $(wildcard sql/*.sql)
|
|
generated_sql_files = $(patsubst %,build/%,$(template_sql_files))
|
|
DATA_built = $(generated_sql_files)
|
|
sql_file_inputs = $(wildcard sql/**/*.sql)
|
|
|
|
BUILD_SCRIPT_DIR = ../../
|
|
OSS_SRC_DIR = ../../
|
|
OSS_COMMON_SQL_HEADER = $(wildcard $(OSS_SRC_DIR)/common_header.sql)
|
|
|
|
# Extension defines
|
|
POSTGIS_SCHEMA_NAME=public
|
|
API_SCHEMA_NAME=documentdb
|
|
API_SCHEMA_INTERNAL_NAME=documentdb_internal
|
|
API_CATALOG_SCHEMA_NAME=documentdb_catalog
|
|
CORE_SCHEMA_NAME=documentdb_core
|
|
API_DATA_SCHEMA_NAME=documentdb_data
|
|
API_ADMIN_ROLE=documentdb_admin_role
|
|
EXTENSION_OBJECT_PREFIX=documentdb
|
|
|
|
# TODO: Need to remove this with PG16 and expose only valid exports
|
|
ALLOW_DEFAULT_VISIBILITY=yes
|
|
|
|
include $(OSS_SRC_DIR)/Makefile.cflags
|
|
|
|
PG_CPPFLAGS += -I$(OSS_SRC_DIR)/pg_documentdb_core/include/ -I$(OSS_SRC_DIR)/pg_documentdb/include/
|
|
|
|
SOURCES = $(wildcard src/*.c) $(wildcard src/**/*.c)
|
|
|
|
OBJS = $(patsubst %.c,%.o,$(SOURCES))
|
|
|
|
DEBUG ?= no
|
|
ifeq ($(DEBUG),yes)
|
|
PG_CPPFLAGS += -ggdb -O0 -g
|
|
PG_CFLAGS += -ggdb -O0 -g
|
|
endif
|
|
|
|
SHLIB_LINK = $(libpq)
|
|
|
|
# clean up files generated to measure code coverage
|
|
EXTRA_CLEAN += $(addprefix src/,*.gcno *.gcda) $(addprefix src/**/,*.gcno *.gcda)
|
|
EXTRA_CLEAN += build/ .deps/
|
|
|
|
PG_CONFIG ?= pg_config
|
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
|
include $(PGXS)
|
|
|
|
ifeq ($(ALLOW_DEFAULT_VISIBILITY),yes)
|
|
override LDFLAGS_SL += -fvisibility=default
|
|
override CFLAGS += -fvisibility=default
|
|
override CXXFLAGS += -fvisibility=default
|
|
endif
|
|
|
|
clean-sql:
|
|
rm -rf .deps/ build/
|
|
|
|
check:
|
|
$(MAKE) -C src/test all
|
|
|
|
check-dist-minimal:
|
|
$(MAKE) -C src/test $@
|
|
|
|
citus-indent:
|
|
citus_indent
|
|
|
|
analysis: citus-indent
|
|
|
|
check-regress:
|
|
$(MAKE) -C src/test check-regress
|
|
|
|
# Before installing, trim any files extension*.sql files in the target install directory
|
|
install: trim_installed_data_files
|
|
|
|
trim_installed_data_files:
|
|
rm -f $(DESTDIR)$(datadir)/$(datamoduledir)/$(EXTENSION)--*.sql
|
|
|
|
build-sql: $(generated_sql_files)
|
|
|
|
$(generated_sql_files): build/%: %
|
|
@mkdir -p $(SQL_DEPDIR) $(SQL_BUILDDIR)
|
|
@# -MF is used to store dependency files(.Po) in another directory for separation
|
|
@# -MT is used to change the target of the rule emitted by dependency generation.
|
|
@# -P is used to inhibit generation of linemarkers in the output from the preprocessor.
|
|
@# -undef is used to not predefine any system-specific or GCC-specific macros.
|
|
@# -imacros is used to specify a file that defines macros for the global context but its output is thrown away.
|
|
@# `man cpp` for further information
|
|
cpp -undef -w $(SQL_DEFINES) -imacros $(OSS_COMMON_SQL_HEADER) -P -MMD -MP -MF$(SQL_DEPDIR)/$(*F).Po -MT$@ $< > $@
|
|
|