# Well, this doesn't work unless you used g++ to compile
# the library, but whatever.
CXX       = g++
OPT       = -O
FLAGS     = $(OPT) -ansi -W -Wall -I../../include
STRIP	  = strip

PROGS     = base64 bzip hasher hasher2 hex md5 md5_fd stack

all: $(PROGS)

base64: base64.cpp
	$(CXX) $(FLAGS) $? -L../.. -lopencl -o $@
	$(STRIP) $@

bzip: bzip.cpp
	$(CXX) $(FLAGS) $? -L../.. -lopencl -o $@
	$(STRIP) $@

hasher: hasher.cpp
	$(CXX) $(FLAGS) $? -L../.. -lopencl -o $@
	$(STRIP) $@

hasher2: hasher2.cpp
	$(CXX) $(FLAGS) $? -L../.. -lopencl -o $@
	$(STRIP) $@

hex: hex.cpp
	$(CXX) $(FLAGS) $? -L../.. -lopencl -o $@
	$(STRIP) $@

md5: md5.cpp
	$(CXX) $(FLAGS) $? -L../.. -lopencl -o $@
	$(STRIP) $@

md5_fd: md5_fd.cpp
	$(CXX) $(FLAGS) $? -L../.. -lopencl -o $@
	$(STRIP) $@

stack: stack.cpp
	$(CXX) $(FLAGS) $? -L../.. -lopencl -o $@
	$(STRIP) $@

clean:
	rm -f $(PROGS)
