PostgreSQL-IBAN/Makefile

19 lines
528 B
Makefile
Raw Normal View History

2016-03-01 15:56:02 +00:00
INCLUDEDIRS := -I.
INCLUDEDIRS += -I$(shell pg_config --includedir-server)
INCLUDEDIRS += -I$(shell pg_config --includedir)
LIBDIR = -L$(shell pg_config --libdir)
# This is where the shared object should be installed
LIBINSTALL = $(shell pg_config --pkglibdir)
CFLAGS += -std=c++14 -fpic
all: iban.so
iban.so: iban.cc
$(CC) $(CFLAGS) -o iban.o -c iban.cc $(INCLUDEDIRS)
2016-03-01 18:42:19 +00:00
$(CC) -Wl,--gc-sections -shared -o iban.so iban.o $(LIBDIR) -lpq -lm -lstdc++
2016-03-05 22:17:38 +00:00
cp iban.so $(LIBINSTALL)
2016-03-01 18:42:19 +00:00
clean:
@$(RM) -rf *.o
@$(RM) -rf iban.so