Moved get_sizeof_phonenumber to a subdirectory

This commit is contained in:
BLM 2015-07-22 15:14:05 -05:00
parent 4c6cd64194
commit 006063fe1d
3 changed files with 5 additions and 6 deletions

View File

@ -18,15 +18,15 @@ else
endif
SHLIB_LINK := -lphonenumber -lstdc++
EXTRA_CLEAN := $(extension_script) get_sizeof_phone_number
EXTRA_CLEAN := $(extension_script) tools/get_sizeof_phone_number
PG_CONFIG := pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
$(extension_script): $(EXTENSION).sql.template get_sizeof_phone_number
sed "s/SIZEOF_PHONE_NUMBER/$(shell ./get_sizeof_phone_number)/" $< > $@
$(extension_script): $(EXTENSION).sql.template tools/get_sizeof_phone_number
sed "s/SIZEOF_PHONE_NUMBER/$(shell tools/get_sizeof_phone_number)/" $< > $@
get_sizeof_phone_number: get_sizeof_phone_number.cpp
tools/get_sizeof_phone_number: tools/get_sizeof_phone_number.cpp
$(CXX) -std=c++11 $< -o $@

View File

@ -19,7 +19,6 @@ CREATE FUNCTION phone_number_send(phone_number) RETURNS bytea
LANGUAGE c IMMUTABLE STRICT
AS 'pg_libphonenumber', 'phone_number_send';
--SIZEOF_PHONE_NUMBER is replaced when generating the "real" script.
CREATE TYPE phone_number (
INTERNALLENGTH = SIZEOF_PHONE_NUMBER,
INPUT = phone_number_in,

View File

@ -1,6 +1,6 @@
#include <iostream>
#include "short_phone_number.h"
#include "../short_phone_number.h"
int main(int argc, const char** argv) {
std::cout << sizeof(ShortPhoneNumber) << std::endl;