

include Makefile.config

# build order.
DIRS = lib util collection thread checker nfo pre nukes bouncer who unzip \
	zip reset sfv

all: help

help:
	@echo Available targets:
	@echo "  make build     - builds most."
	@echo "  make show      - shows build binaries."
	@echo "  make webspy    - makes webspy."
	@echo "  make clean     - cleans."

build:
	@echo Building ..
	@for x in $(DIRS); do \
		(cd $$x; make) \
	done

show:
	@echo These are the programs build ..
	@size bouncer/simple_entry nfo/nfocleaner nukes/foo-nukes pre/foo-pre \
	reset/foo-reset sfv/blehsfv sfv/createsfv who/spy who/webspy

webspy: build
	(cd who; make webspy)

clean:
	for x in $(DIRS); do \
		(cd $$x; make clean) \
	done

distclean: clean
	/bin/rm -f Makefile config.h config.status config.cache config.log
	@for dir in ${DIRS}; do \
	  (cd $$dir && $(MAKE) distclean) \
	  || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
	done && test -z "$$fail"

