######################################################################## # $Source: /local/data/cvs/yellowbank/postgres/src/y_octet_t/Makefile,v $ # $Revision: 1.2 $ # $State: Exp $ # $Date: 2008/03/06 15:51:06 $ # $Author: yrp001 $ # $Locker: $ ######################################################################## ######################################################################## # Copyright (c) 2006 # Ronald Peterson # (Y) Yellowbank # All rights reserved. Applicable BSD license terms can be found in # the associated LICENSE file. ######################################################################## ######################################################################## CC = /usr/bin/gcc CXX = /usr/bin/g++ INCLUDEDIRS := -I. INCLUDEDIRS += -I$(shell pg_config --includedir-server) INCLUDEDIRS += -I$(shell pg_config --includedir) # If you are using shared libraries, make sure this location can be # found at runtime (see /etc/ld.so.conf and ldconfig command). LIBDIR = -L$(shell pg_config --libdir) # This is where the shared object should be installed LIBINSTALL = $(shell pg_config --pkglibdir) CONTRIBINSTALL = $(shell pg_config --sharedir)/contrib ######################################################################## ######################################################################## # DATA_built = y_octet_t.sql # MODULES = y_octet_t # # DOCS = README.y_octet_t # PGXS := $(shell pg_config --pgxs) # include $(PGXS) ######################################################################## ######################################################################## YCFLAGS = -Wall -O3 YLFLAGS = -lpq .PHONY: new all: $(MAKE) y_octet_t.so cp y_octet_t.sql $(CONTRIBINSTALL) %.so: %.c Makefile $(CC) -fpic -o $*.o -c $*.c $(INCLUDEDIRS) $(CC) -shared -o $*.so $*.o $(LIBDIR) $(YLFLAGS) cp $*.so $(LIBINSTALL) new: touch *.c *.h ######################################################################## ######################################################################## # Utility targets .PHONY: tags clean .SILENT: clean tags: etags *.c *.h clean: -rm *~ *.tar *.gz *.o *.so core 2>/dev/null ########################################################################