# Generated automatically from Makefile.in by configure.
# Master Makefile for ncurses library.

basedir=.

include misc/Makefile.inc

OS2ONLY = Readme.os2 misc/Changes.os2 misc/ncemx.htm \
	misc/emx.src misc/*.def misc/cleantic.cmd \
	mkinstalldirs.cmd Makefile ncurses/Makefile \
	menu/Makefile panel/Makefile man/Makefile \
	form/Makefile progs/Makefile test/Makefile \
	misc/Makefile.inc patches.os2

DIRS_TO_MAKE = lib obj_s objects obj_g

NC_MFLAGS = basedir=.. #

all ::	$(DIRS_TO_MAKE)

$(DIRS_TO_MAKE) :
	mkinstalldirs $@

# Put the common rules here so that we can easily construct the list of
# directories to visit.
all \
clean \
mostlyclean \
install ::
	$(MAKE) -C include $(NC_MFLAGS) $@
	$(MAKE) -C man $(NC_MFLAGS) $@
	$(MAKE) -C ncurses $(NC_MFLAGS) $@
	$(MAKE) -C progs $(NC_MFLAGS) $@
	$(MAKE) -C panel $(NC_MFLAGS) $@
	$(MAKE) -C menu $(NC_MFLAGS) $@
	$(MAKE) -C form $(NC_MFLAGS) $@
	$(MAKE) -C misc $(NC_MFLAGS) $@

all \
clean \
mostlyclean \
examples ::
	$(MAKE) -C test $(NC_MFLAGS)

install.libs \install.ncurses ::
	$(MAKE) -C ncurses $(NC_MFLAGS) $@

install.libs \install.progs ::
	$(MAKE) -C progs $(NC_MFLAGS) $@

install.libs \install.panel ::
	$(MAKE) -C panel $(NC_MFLAGS) $@

install.libs \install.menu ::
	$(MAKE) -C menu $(NC_MFLAGS) $@

install.libs \install.form ::
	$(MAKE) -C form $(NC_MFLAGS) $@

#install.libs \install.c++ ::
#	cd c++ && $(MAKE) $(NC_MFLAGS) $@

install.libs \install.includes ::
	$(MAKE) -C include $(NC_MFLAGS) $@

install.data ::
	$(MAKE) -C misc $(NC_MFLAGS) $@

install.man ::
	$(MAKE) -C man $(NC_MFLAGS) $@

patches.os2:
	rm -f patches.os2
	-runfor -q -d -r -x RCS* : @rcsdiff -r1.1 -u %F/* 2>NUL > /tmp/patches.os2
	-rcsdiff -r1.1 ./* >> /tmp/patches.os2 2>NUL
	mv /tmp/patches.os2 .

dist ::
	rm -rf *.zip
	echo NCurses-1.9.9e for emx (binaries) > FILE_ID.DIZ
	zip -r9 NC-EMX-B.ZIP $(prefix) FILE_ID.DIZ -x "*/man/*" "*/curses.a"
	echo NCurses-1.9.9e for emx (manual pages) > FILE_ID.DIZ
	zip -r9 NC-EMX-M.ZIP $(mandir) FILE_ID.DIZ
	rm -f FILE_ID.DIZ

srcdist :: $(OS2ONLY)
	echo NCurses-1.9.9e for emx (patches to build the sources) > FILE_ID.DIZ
	zip -9 NC-EMX-P.ZIP $(OS2ONLY) FILE_ID.DIZ
	rm -f FILE_ID.DIZ

clean::
	rm -rf *.zip patches.os2

