33 lines
739 B
Makefile
Raw Normal View History

2017-02-18 17:46:11 +00:00
# The build configuration (debug or release)
2015-07-21 16:49:01 -05:00
CONFIG := release
2017-02-18 17:46:11 +00:00
# Extension packaging options
EXTENSION := pg_libphonenumber
DATA := sql/$(EXTENSION)--*.sql
2015-07-30 13:19:20 -05:00
REGRESS := regression
2017-02-18 17:46:11 +00:00
# Build options
cpp_files := $(wildcard src/*.cpp)
2015-07-22 12:44:00 -05:00
2017-02-18 17:46:11 +00:00
# The native module to build
MODULE_big := pg_libphonenumber
2017-02-18 17:46:11 +00:00
# The object files that go into the module
2015-07-22 12:44:00 -05:00
OBJS := $(patsubst %.cpp,%.o,$(cpp_files))
2017-02-18 17:46:11 +00:00
# C flags
2019-07-18 23:03:42 -07:00
PG_CPPFLAGS := -fPIC -std=c++14
PG_CPPFLAGS += -Isrc/ -I/usr/include -I/usr/local/include
2017-12-09 15:42:41 -08:00
PG_CPPFLAGS += -Wall -Wextra
2015-07-21 16:49:01 -05:00
ifeq ($(CONFIG),debug)
2015-07-21 16:51:52 -05:00
PG_CPPFLAGS += -g -Og
else
PG_CPPFLAGS += -O3
2015-07-21 16:49:01 -05:00
endif
2017-02-18 17:46:11 +00:00
# Extra libraries to link
2015-07-10 15:58:40 -05:00
SHLIB_LINK := -lphonenumber -lstdc++
2017-02-18 17:46:11 +00:00
# Load PGXS.
2015-07-10 15:58:40 -05:00
PG_CONFIG := pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)