#
# Makefile
# Copyright (C) 1997-2000 by Richard Dawe
#
# Please see the file license.txt for licensing details.
#

# Include config Makefile
include Makefile.cfg

#
# --- Menu ---
#
default:
	@echo
	@echo "Welcome to libwin!"
	@echo
	@echo "Please use make <target>, where <target> is one of the following:"
	@echo
	@echo "all        - Make everything"
	@echo "demo       - Demo & test programs"
	@echo "lib        - Library"
	@echo "clean      - Clean up object files"
	@echo "distclean  - Clean up everything"
	@echo "install    - Install header files, library"
	@echo "installman - Install man pages"
	@echo

# These aren't real files
.PHONY:	all lib demo install installman

all:	lib demo

lib:
	make -C src all

demo:
	make -C demo all

#
# --- Cleaning ---
#
.PHONY:	clean distclean

clean:
	make -C demo clean
	make -C src  clean
	make -C lib  clean

distclean:	clean
	make -C demo distclean
	make -C src  distclean
	make -C lib  distclean

#
# --- Installation ---
#

# Library and header installation
install:	lib
	cp lib/libwin.a $(DJDIR)/lib
	ginstall -d $(DJDIR)/include/libwin
	cp include/libwin.h $(DJDIR)/include
	cp include/libwin/*.h $(DJDIR)/include/libwin

# Man page installation: Don't forget to set MAN_PLACE to something meaningful
# in Makefile.cfg
installman:
	ginstall -d $(MAN_PLACE)
	cp -r man $(MAN_PLACE)
