mirror of
https://github.com/postgres/postgres.git
synced 2025-08-02 09:26:47 +03:00
Update of contrib stuff from massimo.
This commit is contained in:
@ -1,12 +1,62 @@
|
||||
D=/usr/postgres
|
||||
P=$D/lib/datetime_functions.so
|
||||
CFLAGS=-fpic -O -I../../src/include -I../../src/backend
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Makefile--
|
||||
# Makefile for new date/time functions.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
all: $P datetime_functions.sql
|
||||
PGDIR = ../..
|
||||
SRCDIR = $(PGDIR)/src
|
||||
|
||||
$P:datetime_functions.o
|
||||
ld -Bshareable -o $P datetime_functions.o
|
||||
include $(SRCDIR)/Makefile.global
|
||||
|
||||
datetime_functions.sql: datetime.prot
|
||||
sh datetime.prot $P
|
||||
psql -c "\idatetime_functions.sql" template1
|
||||
INCLUDE_OPT = -I ./ \
|
||||
-I $(SRCDIR)/ \
|
||||
-I $(SRCDIR)/include \
|
||||
-I $(SRCDIR)/port/$(PORTNAME)
|
||||
|
||||
CFLAGS += $(INCLUDE_OPT)
|
||||
|
||||
ifeq ($(PORTNAME), linux)
|
||||
ifdef LINUX_ELF
|
||||
ifeq ($(CC), gcc)
|
||||
CFLAGS += -fPIC
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PORTNAME), i386_solaris)
|
||||
CFLAGS+= -fPIC
|
||||
endif
|
||||
|
||||
MODNAME = datetime_functions
|
||||
|
||||
MODULE = $(MODNAME)$(DLSUFFIX)
|
||||
|
||||
all: module sql
|
||||
|
||||
module: $(MODULE)
|
||||
|
||||
sql: $(MODNAME).sql
|
||||
|
||||
install: $(MODULE)
|
||||
cp -p $(MODULE) $(LIBDIR)
|
||||
cd $(LIBDIR); strip $(MODULE)
|
||||
|
||||
%.sql: %.sql.in
|
||||
sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@
|
||||
|
||||
.SUFFIXES: $(DLSUFFIX)
|
||||
|
||||
%$(DLSUFFIX): %.c
|
||||
cc $(CFLAGS) -shared -o $@ $<
|
||||
|
||||
depend dep:
|
||||
$(CC) -MM $(INCLUDE_OPT) *.c >depend
|
||||
|
||||
clean:
|
||||
rm -f $(MODULE) $(MODNAME).sql
|
||||
|
||||
ifeq (depend,$(wildcard depend))
|
||||
include depend
|
||||
endif
|
||||
|
Reference in New Issue
Block a user