################################################################
# Makefile generated by qmakefile/1
################################################################

.SUFFIXES: .pl .qlf
.PHONY: all qlf checkwd

PL=	swipl

QLF1=	pce.qlf
QLF2=	pce_manual.qlf pcedraw.qlf dialog/dialog.qlf \
	emacs/emacs.qlf trace/trace.qlf emacs/prolog_mode.qlf
QLF=	$(QLF1) $(QLF2)

all:	
	$(MAKE) checkwd
	$(MAKE) INDEX.pl qlf

qlf:	$(QLF) .pwd

clean:
	rm -f $(QLF)

checkwd:
		@pwd > .pwd%
		@if cmp -s .pwd% .pwd; then rm .pwd%; else mv .pwd% .pwd; fi

.pwd:		checkwd

$(QLF):		INDEX.pl
$(QLF2):	$(QLF1)

pce.qlf:	pce.pl \
		../boot/pce_expand.pl ../boot/pce_pl.pl \
		english/pce_messages.pl ../boot/pce_principal.pl \
		../boot/pce_error.pl \
		../boot/pce_global.pl ../boot/pce_expansion.pl \
		../boot/pce_realise.pl ../boot/pce_autoload.pl \
		../boot/pce_editor.pl ../boot/pce_portray.pl

pce_manual.qlf:	pce_manual.pl man/util.pl man/p_card.pl man/p_data.pl \
		man/classmap.pl man/v_manual.pl

pcedraw.qlf:	pcedraw.pl draw/draw.pl draw/gesture.pl draw/shapes.pl \
		draw/canvas.pl draw/align.pl draw/menu.pl draw/config.pl \
		draw/exportpl.pl

dialog/dialog.qlf:	dialog/dialog.pl dialog/proto.pl \
			dialog/layout.pl dialog/generate.pl \
			dialog/pretty_print.pl dialog/behaviour.pl \
			dialog/meta.pl dialog/load.pl dialog/util.pl

emacs/emacs.qlf:	emacs/emacs.pl emacs/window.pl emacs/buffer.pl \
			emacs/buffer_menu.pl emacs/server.pl \
			emacs/fundamental_mode.pl emacs/language_mode.pl \
			emacs/outline_mode.pl emacs/application.pl \
			emacs/bookmarks.pl

trace/trace.qlf:	trace/trace.pl trace/clause.pl trace/util.pl \
			trace/settings.pl trace/break.pl trace/source.pl \
			trace/stack.pl trace/pprint.pl trace/viewterm.pl \
			trace/gui.pl

emacs/prolog_mode.qlf:	emacs/prolog_mode.pl emacs/prolog_colour.pl \
			xref/common.pl


INDEX.pl:	.
	$(PL) -f none -g "make_library_index('.')" -t halt

.pl.qlf:
	@echo '****************'
	@echo '* QLF compilation of $*'
	@echo '****************'
	$(PL) -f none -O -g "qcompile('$*')" -t halt -- -nopce
