# Makefile for Freedom remailer
# 1995 jfleming@indiana.edu
# 1997 hanne@squirrel.owl.de

# Define these for your system and your tastes
CC = gcc
#CC = cc
CFLAGS = -Wall -O3
#CFLAGS = -g -DDEBUG

# For HP/UX C optional C compiler
# CC = cc
# CFLAGS = +O2 -Aa -D_HPUX_SOURCE

# Delete "-s" if you compile with debugging options
LDFLAGS = -s

# Delete  "-lrx" if you don't want to use the Rx library
REMAILER_LIBS = -lrx

########################################################################
# Things after this point probably don't need to be changed.
########################################################################

PGP_OBJS = idea.o md5.o randpool.o

REMAILER_OBJS = remailer.o util1.o util2.o util3.o util4.o util5.o \
		stats.o genid.o $(PGP_OBJS)

TESTCRYPT_OBJS = testcrypt.o $(PGP_OBJS)

all:		remailer testcrypt

remailer:	$(REMAILER_OBJS)
		$(CC) $(LDFLAGS) -o $@ $(REMAILER_OBJS) $(REMAILER_LIBS)
		chmod 511 $@

testcrypt:	$(TESTCRYPT_OBJS)
		$(CC) $(LDFLAGS) -o $@ $(TESTCRYPT_OBJS)

remailer.o:	config.h freedom.h
util1.o:	config.h freedom.h
util2.o:	config.h freedom.h
util3.o:	config.h freedom.h
util4.o:	config.h freedom.h
util5.o:	config.h freedom.h idea.h usuals.h md5.h
stats.o:	config.h freedom.h

testcrypt.o:	idea.h usuals.h md5.h

idea.o:		idea.h randpool.h usuals.h
md5.o:		md5.h
randpool.o:	randpool.h usuals.h md5.h

.PHONY:		clean
clean:
		rm -f remailer testcrypt $(REMAILER_OBJS) $(TESTCRYPT_OBJS)
