######################################################################## # Copyright (c) 2009 # (Y) Yellowbank # Ronald Peterson # # https://www.yellowbank.com/ # # This file is part of y_crypto. # # y_crypto 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 code under construction, so leave out for now.) # # 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\" # # 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) ######################################################################## ######################################################################## 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) CONTRIBDIR = $(shell pg_config --sharedir)/contrib YCFLAGS = -Wall -O2 YLFLAGS = -lpq -lgmp -lmhash -lnettle -lhogweed -ly_clib ######################################################################## ######################################################################## y_crypto.o: y_crypto.c $(CC) -fpic -o $@ -c $< $(PGINCLUDE) $(YCFLAGS) y_crypto.so: y_crypto.o $(CC) -shared -o $@ $^ $(PGINCLUDE) $(LIBDIR) $(YLFLAGS) install: y_crypto.so y_crypto.sql install -D y_crypto.so $(LIBINSTALL) install -D y_crypto.sql $(CONTRIBDIR) # 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 ########################################################################