#
# Makefile for StegFS components
#

CC = gcc
CFLAGS = -Wall
# CFLAGS = -g -Wall -DDEVEL_ZEROFILL
AR = ar rc
CIPHEROBJS = serpent.o rc6.o nullenc.o

all: mkstegfs rerepl stegfslevel tunestegfs
devtools: readdata junkblock inolist

mkstegfs: mkstegfs.o stegfs.o sha1.o $(CIPHEROBJS)
	$(CC) $(CFLAGS) -o mkstegfs mkstegfs.o stegfs.o sha1.o $(CIPHEROBJS)

mkstegfs.o: mkstegfs.c stegfs.h
	$(CC) $(CFLAGS) -c mkstegfs.c

stegfs.o: stegfs.c stegfs.h sha1.h serpent.h rc6.h nullenc.h
	$(CC) $(CFLAGS) -c stegfs.c

sha1.o: sha1.c sha1.h
	$(CC) $(CFLAGS) -c sha1.c

serpent.o: serpent.c serpent.h
	$(CC) $(CFLAGS) -c serpent.c

rc6.o: rc6.c rc6.h
	$(CC) $(CFLAGS) -c rc6.c

nullenc.o: nullenc.c nullenc.h
	$(CC) $(CFLAGS) -c nullenc.c

readdata: readdata.o stegfs.o sha1.o $(CIPHEROBJS)
	$(CC) $(CFLAGS) -o readdata readdata.o stegfs.o sha1.o $(CIPHEROBJS)

readdata.o: readdata.c
	$(CC) $(CFLAGS) -c readdata.c

inolist: inolist.o stegfs.o sha1.o $(CIPHEROBJS)
	$(CC) $(CFLAGS) -o inolist inolist.o stegfs.o sha1.o $(CIPHEROBJS)

inolist.o: inolist.c
	$(CC) $(CFLAGS) -c inolist.c

junkblock: junkblock.o
	$(CC) $(CFLAGS) -o junkblock junkblock.o

junkblock.o: junkblock.c
	$(CC) $(CFLAGS) -c junkblock.c

rerepl: rerepl.o
	$(CC) $(CFLAGS) -o rerepl rerepl.o

rerepl.o: rerepl.c
	$(CC) $(CFLAGS) -c rerepl.c

stegfslevel: stegfslevel.o
	$(CC) $(CFLAGS) -o stegfslevel stegfslevel.o

stegfslevel.o: stegfslevel.c
	$(CC) $(CFLAGS) -c stegfslevel.c

tunestegfs: tunestegfs.o
	$(CC) $(CFLAGS) -o tunestegfs tunestegfs.o

tunestegfs.o: tunestegfs.c
	$(CC) $(CFLAGS) -c tunestegfs.c

clean:
	rm -f *.o *.so *.a mkstegfs readdata junkblock inolist rerepl \
	stegfslevel tunestegfs a.out

