Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

56 lines (43 sloc) 1.445 kB
# $PostgreSQL$
HASHTYPESVERSION = 0.1.1
MODULES = hashtypes
EXTENSION = hashtypes
DOCS = README.hashtypes
MODULE_big = hashtypes
OBJS = src/common.o src/md5.o src/crc32.o $(LN_OBJS)
DATA_built = sql/hashtypes--$(HASHTYPESVERSION).sql
REGRESS = regress_sha
PG_CONFIG = pg_config
LN_OBJS = src/sha1.o src/sha224.o src/sha256.o src/sha384.o src/sha512.o
LN_SOURCES = $(subst .o,.c,$(LN_OBJS))
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
$(LN_SOURCES) : % : src/sha.c
rm -f $@ && $(LN_S) $(notdir $<) $@
clean: clean-ln clean-sql.in
clean-ln:
rm -f $(LN_SOURCES)
clean-sql.in:
rm -f sql/hashtypes--$(HASHTYPESVERSION).sql.in
TYPES=1 224 256 384 512
length_1=20
length_224=28
length_256=32
length_384=48
length_512=64
sql/hashtypes--$(HASHTYPESVERSION).sql.in: sql/sha.sql.type sql/md5.sql sql/crc32.sql
> $@
$(foreach type,$(TYPES),sed -e "s/@SHATYPE@/$(type)/g" -e "s/@SHALENGTH@/$(length_$(type))/g" $< >> $@ ; )
cat sql/md5.sql >> $@
cat sql/crc32.sql >> $@
# Maybe this can be built using $(TYPES) too but I don't see how
src/sha1.o: CFLAGS+=-DSHA_NAME=1 -DSHA_LENGTH=20
src/sha224.o: CFLAGS+=-DSHA_NAME=224 -DSHA_LENGTH=28
src/sha256.o: CFLAGS+=-DSHA_NAME=256 -DSHA_LENGTH=32
src/sha384.o: CFLAGS+=-DSHA_NAME=384 -DSHA_LENGTH=48
src/sha512.o: CFLAGS+=-DSHA_NAME=512 -DSHA_LENGTH=64
dist:
git archive --format zip \
--prefix=hashtypes-$(HASHTYPESVERSION)/ \
--output hashtypes-$(HASHTYPESVERSION).zip \
master
Jump to Line
Something went wrong with that request. Please try again.