######################################################################## # $Source: /local/data/cvs/yellowbank/postgres/src/y_crypto/Makefile,v $ # $Revision: 1.2 $ # $State: Exp $ # $Date: 2007/11/20 01:06:16 $ # $Author: yrp001 $ # $Locker: $ ######################################################################## ######################################################################## # Copyright (c) 2007 # (Y) Yellowbank # Ronald Peterson # # https://www.yellowbank.com/ # # This file is part of y_pgcrypto. # # y_pgcrypto is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero GPL version 3.0. These license # terms can be found in the included file agpl-3.0.txt. ######################################################################## ######################################################################## # Configure these as you would like for your installation. # FLOB_HASH_TYPE = \"SHA256\" FLOB_ROOT = \"/var/tmp/flob\" FLOB_DIR_DEPTH = 4 FLOB_MAX_DIRSTR_LEN = 2048 # # Random device to use - set this as appropriate for your system # and required security level. RANDDEV = \"/dev/urandom\" ######################################################################## ######################################################################## CC = /usr/bin/gcc CXX = /usr/bin/g++ PGINCLUDE := -I. PGINCLUDE += -I$(shell pg_config --includedir-server) PGINCLUDE += -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) YCFLAGS = -Wall -O3 YLFLAGS = -lpq -lgmp -lmhash -lpqxx # YDEFINES = -D FLOB_HASH_TYPE=$(FLOB_HASH_TYPE) YDEFINES += -D FLOB_ROOT=$(FLOB_ROOT) YDEFINES += -D FLOB_DIR_DEPTH=$(FLOB_DIR_DEPTH) YDEFINES += -D FLOB_MAX_DIRSTR_LEN=$(FLOB_MAX_DIRSTR_LEN) YDEFINES += -D RANDDEV=$(RANDDEV) ######################################################################## ######################################################################## y_clib.o: y_clib.c y_clib.h $(CC) $< -c -o $@ $(YCFLAGS) $(YDEFINES) y_pgcrypto.o: y_pgcrypto.c $(CC) -fpic -o $@ -c $< $(PGINCLUDE) $(YCFLAGS) y_pgcrypto.so: y_pgcrypto.o y_clib.o $(CC) -shared -o $@ $^ $(PGINCLUDE) $(LIBDIR) $(YLFLAGS) cp $@ $(LIBINSTALL) ## y_pkcs_client: y_pkcs_client.cpp Makefile $(CXX) -o $@ $< $(PGINCLUDE) $(LIBDIR) $(YLFLAGS) test: test.c y_clib.o $(CC) $^ -o $@ $(YCFLAGS) $(YLFLAGS) # default object file rule .PRECIOUS: %.o %.o: %.c %.h $(CC) -fpic -o $@ -c $< $(YCFLAGS) # default shared object file rule %.so: %.c Makefile $(CC) -fpic -o $*.o -c $*.c $(PGINCLUDE) $(YCFLAGS) $(CC) -shared -o $*.so $*.o $(LIBDIR) $(YLFLAGS) cp $*.so $(LIBINSTALL) .PHONY: new 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 ########################################################################