include ../paths.mak

OBJS=

#5.0+

OBJS := $(OBJS) pkeenc5.o pkedec5.o sigmak5.o sigchk5.o cnvenc5.o cnvdec5.o
OBJS := $(OBJS) getkey5.o hashdef.o keyout.o cfbconv.o

#common (armor and literal)

OBJS := $(OBJS) armor.o armortab.o dearmor.o
OBJS := $(OBJS) delit.o enlit.o getlit.o skip2ctb.o

#if you want to add pgp compression
#you will need -lz everywhere if dynamically linked
OBJS := $(OBJS) libzglue.o

#2.6.2
OBJS := $(OBJS) pkeenc2.o pkedec2.o sigmak2.o sigchk2.o cnvenc2.o cnvdec2.o
OBJS := $(OBJS) getkey2.o asnchk.o 

#SSLeay RSA to PGP2 pk cert
OBJS := $(OBJS) rsa2pgp.o

#####Optional ciphers
#if you want RSA support (in pgp5, required for pgp2)
CFLAGS := $(CFLAGS) -DRSAKEY

#If you also have cast (will need -lcast until ssleay integrates it)
CFLAGS := $(CFLAGS) -DUSECAST

#Assuming you want IDEA (patented)
CFLAGS := $(CFLAGS) -DUSEIDEA

#Use ripemd (code courtesy of Peter Gutmann)
CFLAGS := $(CFLAGS) -DRIPEMD
OBJS := $(OBJS) ripemd.o

#This allows getsecpubkey to return the first public key with keyid=0
CFLAGS := $(CFLAGS) -DTESTMODE

##############################
# Experimental for the new spec

#Blowfish (Included in SSLeay)
CFLAGS := $(CFLAGS) -DUSEBF

#SAFER/SK128
CFLAGS := $(CFLAGS) -DUSESAFER
OBJS := $(OBJS) safer.o

#Haval
CFLAGS := $(CFLAGS) -DUSEHAVAL
OBJS := $(OBJS) haval.o

##############################

all: libpgp.a libpgp.so

install: all
	cp libpgp.a libpgp.so /usr/local/lib
	cp libpgp2.h libpgp5.h /usr/local/include

libpgp.a: $(OBJS)
	ar rv $@ $?
	ranlib $@

libpgp.so: $(OBJS)
	ld -Bshareable -shared -s -o $@ $^

clean:
	rm -f libpgp.so libpgp.a $(OBJS)


