pg-libphonenumber/Makefile

33 lines
739 B
Makefile
Raw Permalink Normal View History

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