6 custom types (tle, eci_position, geodetic, topocentric, observer, pass_event), 67 SQL functions, 2 operators (&&, <->), and a GiST operator class for altitude-band indexing. Wraps Bill Gray's sat_code for SGP4/SDP4 propagation with WGS-72 constants for propagation and WGS-84 for coordinate output. All 5 regression tests pass on PG 18.
37 lines
1.1 KiB
Makefile
37 lines
1.1 KiB
Makefile
MODULE_big = pg_orbit
|
|
EXTENSION = pg_orbit
|
|
DATA = sql/pg_orbit--0.1.0.sql
|
|
|
|
# Our extension C sources
|
|
OBJS = src/pg_orbit.o src/tle_type.o src/eci_type.o src/observer_type.o \
|
|
src/sgp4_funcs.o src/coord_funcs.o src/pass_funcs.o src/gist_tle.o
|
|
|
|
# sat_code C++ sources (compiled with g++, linked with extern "C" symbols)
|
|
SAT_CODE_DIR = lib/sat_code
|
|
SAT_CODE_SRCS = $(SAT_CODE_DIR)/sgp4.cpp $(SAT_CODE_DIR)/sdp4.cpp \
|
|
$(SAT_CODE_DIR)/deep.cpp $(SAT_CODE_DIR)/common.cpp \
|
|
$(SAT_CODE_DIR)/basics.cpp $(SAT_CODE_DIR)/get_el.cpp \
|
|
$(SAT_CODE_DIR)/tle_out.cpp
|
|
SAT_CODE_OBJS = $(SAT_CODE_SRCS:.cpp=.o)
|
|
|
|
OBJS += $(SAT_CODE_OBJS)
|
|
|
|
# Regression tests
|
|
REGRESS = tle_parse sgp4_propagate coord_transforms pass_prediction gist_index
|
|
REGRESS_OPTS = --inputdir=test
|
|
|
|
# Need C++ runtime for sat_code
|
|
SHLIB_LINK += -lstdc++ -lm
|
|
|
|
# Compiler flags
|
|
PG_CPPFLAGS = -I$(SAT_CODE_DIR)
|
|
|
|
# Use PGXS
|
|
PG_CONFIG ?= pg_config
|
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
|
include $(PGXS)
|
|
|
|
# Rule for compiling sat_code C++ files
|
|
$(SAT_CODE_DIR)/%.o: $(SAT_CODE_DIR)/%.cpp
|
|
$(CXX) $(CXXFLAGS) -fPIC -I$(SAT_CODE_DIR) -c -o $@ $<
|