# Makefile for Hide4PGP v2.0 by Heinz Repp
# Unix-version -- tested with gcc on Linux (i386)
# Makefile by Thomas Hertweck
# modified by Heinz Repp
#
# type 'make' for a short help
#
# ... and above all, some special greetings to the
# SuSE Linux mailing list and all the people currently
# subscribed spending so much time by helping others :-)

SHELL = /bin/sh
thisdir := $(shell pwd)
srcdir = $(patsubst %/Unix,%/Source,$(thisdir))
CC = gcc
CFLAGS = -O2 -ansi -I$(srcdir) -DUNIX
LDFLAGS = -lm
PROGRAM = hide4pgp
VPATH = $(srcdir)
SRC = hide4pgp.c bmp.c scramble.c utils.c voc.c wav.c
OBJ = $(patsubst %.c,%.o,$(SRC))

.SUFFIXES:
.SUFFIXES: .c .o

.c.o:
	$(CC) $(CFLAGS) -c -o$@ $<

.PHONY: help all clean distclean

help:
	@echo
	@echo "Makefile for $(PROGRAM):"
	@echo "Type <make all> to compile and link program $(PROGRAM)"
	@echo "Type <make clean> to clean up directory (object files)"
	@echo "Type <make distclean> to clean up everything"
	@echo

all: $(OBJ)
	$(CC) -o$(PROGRAM) $(LDFLAGS) $(OBJ)

clean:
	-@rm -f $(OBJ)

distclean: clean
	-@rm -f $(PROGRAM)

patched: patches
	patch -d $(srcdir) < $< ; echo Done. > $@

hide4pgp.o: hide4pgp.c hide4pgp.h utils.h patched
utils.o: utils.c hide4pgp.h utils.h scramble.h
scramble.o: scramble.c hide4pgp.h scramble.h
bmp.o: bmp.c hide4pgp.h utils.h scramble.h
voc.o: voc.c hide4pgp.h utils.h
wav.o: wav.c hide4pgp.h utils.h
