GaBuZoMeu/Makefile
2023-09-06 17:56:52 +02:00

41 lines
1.2 KiB
Makefile

GHC=ghc
#GHC_OPTS="-prof"
GHC_OPTS=
MODULES=Grammar.hs Types.hs
REGISTRY_MODULES=Registry/Grammar.hs Registry/Types.hs Registry/Registry.hs Registry/Utils.hs
TESTS=broken-tags.txt well-formed-tags.txt
ALL_MODULES=${MODULES}
REGISTRY=https://www.iana.org/assignments/language-subtag-registry
REGISTRYFILE=language-subtag-registry
ALL_PROGRAMS=check-wf check-valid tests-from-files display-tag registry2xml registry2txt registry2postgresql registry2sqlite registry2mulhtml check-registry
TARBALL=/tmp/gabuzomeu.tar
default: check-wf check-valid check-registry
all: ${ALL_PROGRAMS}
%: %.hs ${ALL_MODULES}
${GHC} ${GHC_OPTS} -o $@ --make $<
%: Registry/%.hs ${MODULES}
${GHC} ${GHC_OPTS} -o $@ --make $<
test: ${REGISTRYFILE} test-tags test-regs
test-tags: tests-from-files ${ALL_MODULES} ${TESTS}
./$<
test-regs: test-registries ${ALL_MODULES} ${REGISTRY_MODULES} ${TESTS}
./$<
${REGISTRYFILE}: check-registry
wget -O $@ ${REGISTRY}
./check-registry ${REGISTRYFILE}
touch ${REGISTRYFILE}
dist: clean
(cd ..; tar cvf ${TARBALL} --exclude hnop --exclude ltr*.txt GaBuZoMeu && gzip --best --force --verbose ${TARBALL})
clean:
rm -f list-grandfathered-tags ${REGISTRYFILE} ${ALL_PROGRAMS} \#*\# *~ *.o *.hi *~ Registry/*.o Registry/*.hi Registry/*~