# Makefile for a language sample
# Last edited on 2012-02-11 08:12:17 by stolfilocal

.PHONY: all make_wds make_txt

all: make_wds make_txt
        
######################################################################
# "make make_wds" should be executed in a LANG/SMP sub-directory

BANKBIN = ${STOLFIHOME}/projects/langbank/tools

SRC_FILE = ufcg.src
WDS_FILE = ufcg.wds
TXT_FILE = ufcg.txt

${WDS_FILE}: ${SRC_FILE} Makefile \
          ${BANKBIN}/expand-includes \
          ${BANKBIN}/src-to-wds
	${BANKBIN}/expand-includes ${SRC_FILE} > /tmp/.src
	${BANKBIN}/src-to-wds /tmp/.src > ${WDS_FILE}
	/bin/rm -f /tmp/.src

make_wds: ${WDS_FILE}

make_txt: ${TXT_FILE}

${TXT_FILE}: ${WDS_FILE} ../main.txt ${BANKBIN}/wds-to-plaintext.gawk
	rm -rf ${TXT_FILE}
	${BANKBIN}/wds-to-plaintext.gawk < ${WDS_FILE} > ${TXT_FILE}
	chmod a-w ${TXT_FILE}
	prdiff -Bb ${TXT_FILE} ../main.txt > .diff