
CONFIG_EXISTS := $(wildcard config.mk)

all: ncursesw

clean:
	cd src/ncursesw ; make clean

distclean: clean
	rm fizmo

ifeq ($(strip $(CONFIG_EXISTS)),)

test_config:
	@echo
	@echo No file \"config.mk\" was found.
	@echo
	@false

install:
	@echo
	@echo No file \"config.mk\" was found.
	@echo
	@false

else

include config.mk

ifeq ($(FIZMO_BIN_DIR),)
FIZMO_BIN_DIR = games
endif

test_config:
	@true

install: ncursesw
	mkdir -p $(INSTALL_PREFIX)/$(FIZMO_BIN_DIR) $(INSTALL_PREFIX)/share/man/man6
	install fizmo $(INSTALL_PREFIX)/$(FIZMO_BIN_DIR)
	install src/man/fizmo.6 $(INSTALL_PREFIX)/share/man/man6

endif

ncursesw: test_config
	cd src/ncursesw ; make fizmo
	mv src/ncursesw/fizmo .

