#
# Imakefile for Quixote Interface
#

SUBDIRS = config dotsrc emacs parser term qshell

all:: util

MakeSubdirs($(SUBDIRS))
MakefileSubdirs($(SUBDIRS))
InstallSubdirs(install,$(SUBDIRS))
CleanSubdirs($(SUBDIRS))
CleanTarget()

/* For GNU Flex, lexcal analyzer generator which doesn't have Imakefile */
/*
   We don't need to install Flex, we need it just for compiling our sources.
   We must not make Makefile for Flex, for it already has its own Makefile.

   All we have to do is provide the targets for `all' and `clean.'
*/

#ifdef SYSV
FlexCFLAGS= ${CFLAGS} -DUSG
#else
FlexCFLAGS= ${CFLAGS}
#endif

util::
	@case '${MAKEFLAGS}' in *[ik]*) set +e;; esac; \
	echo "making all in ${CURRENT}/flex-2.3.7.."; \
	(cd flex-2.3.7; rm -f scan.c; cp initscan.c scan.c; \
	 ${MAKE} -${MAKEFLAGS} \
	 CC="${CC}" LDFLAGS="${LDFLAGS}" CFLAGS="${FlexCFLAGS}" \
	 flex);

clean::
	@case '${MAKEFLAGS}' in *[ik]*) set +e;; esac; \
	echo "making clean in ${CURRENT}/flex-2.3.7.."; \
	(cd flex-2.3.7; ${MAKE} -${MAKEFLAGS} clean);
