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 c files from pg_helio_core -> pg_documentdb_core - Make helio_core, and other extensions depend on pg_documentdb_core as a lib dependency ---- #### AI description (iteration 1) #### PR Classification Code reorganization #### PR Summary This pull request moves source files from `pg_helio_core` to `pg_documentdb_core` to better organize the project structure. - Deleted `oss/pg_helio_core/include/utils/helio_codes.txt`. - Added `oss/pg_documentdb_core/src/pg_documentdb_core.c` for initializing the shared library. - Updated `oss/Makefile.cflags` to include new paths and installation rules for `pg_documentdb_core`. - Moved `oss/pg_helio_core/src/bson_init.c` and `oss/pg_helio_core/include/bson_init.h` to `oss/pg_documentdb_core/src/bson_init.c` and `oss/pg_documentdb_core/include/bson_init.h` respectively. - Modified various `Makefile` files to set `USE_DOCUMENTDB_CORE` and adjust include paths.
87 lines
2.5 KiB
Makefile
87 lines
2.5 KiB
Makefile
EXTENSION = pg_helio_core
|
|
|
|
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)
|
|
|
|
HELIO_CORE_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
BUILD_SCRIPT_DIR = ../
|
|
OSS_SRC_DIR = $(HELIO_CORE_DIR)/../
|
|
OSS_COMMON_SQL_HEADER = $(wildcard $(OSS_SRC_DIR)/common_header.sql)
|
|
|
|
# Extension configuration
|
|
SKIP_API_SCHEMA=yes
|
|
CORE_SCHEMA_NAME=helio_core
|
|
EXTENSION_OBJECT_PREFIX=helio
|
|
|
|
# TODO: Need to remove this with PG16 and expose only valid exports
|
|
ALLOW_DEFAULT_VISIBILITY=yes
|
|
|
|
# compilation configuration
|
|
MODULE_big = $(EXTENSION)
|
|
|
|
USE_DOCUMENTDB_CORE = 1
|
|
include $(OSS_SRC_DIR)/Makefile.cflags
|
|
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
|
|
|
|
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$@ $< > $@
|
|
|
|
include $(OSS_SRC_DIR)/Makefile.docdb |