| 1 |
# $Id: Makefile,v 1.9 2006/11/11 15:36:03 hxml Exp $ |
| 2 |
|
| 3 |
HXT_HOME = ../../.. |
| 4 |
PKGFLAGS = |
| 5 |
GHCFLAGS = -Wall -O2 |
| 6 |
GHC = ghc $(GHCFLAGS) $(PKGFLAGS) |
| 7 |
|
| 8 |
DIST = $(HXT_HOME)/dist/examples/arrows |
| 9 |
DIST_DIR = $(DIST)/RegexXMLSchema |
| 10 |
|
| 11 |
CNT = 3 |
| 12 |
|
| 13 |
ropts = +RTS -s -RTS |
| 14 |
|
| 15 |
prog = ./REtest |
| 16 |
prog2 = ./Lines |
| 17 |
prog3 = ./RElines |
| 18 |
prog4 = ./Words |
| 19 |
prog5 = ./REwords |
| 20 |
prog0 = ./Copy |
| 21 |
|
| 22 |
progs = $(prog) $(prog0) $(prog2) $(prog3) $(prog4) $(prog5) |
| 23 |
|
| 24 |
all : $(progs) |
| 25 |
|
| 26 |
$(prog) : $(prog).hs |
| 27 |
$(GHC) --make -o $@ $< |
| 28 |
|
| 29 |
local : |
| 30 |
$(GHC) --make -o $(prog) -fglasgow-exts -ignore-package hxt -i../../../src $(prog).hs |
| 31 |
|
| 32 |
$(prog2) : $(prog) |
| 33 |
ln -f $(prog) $(prog2) |
| 34 |
|
| 35 |
$(prog3) : $(prog) |
| 36 |
ln -f $(prog) $(prog3) |
| 37 |
|
| 38 |
$(prog4) : $(prog) |
| 39 |
ln -f $(prog) $(prog4) |
| 40 |
|
| 41 |
$(prog5) : $(prog) |
| 42 |
ln -f $(prog) $(prog5) |
| 43 |
|
| 44 |
$(prog0) : $(prog) |
| 45 |
ln -f $(prog) $(prog0) |
| 46 |
|
| 47 |
# generate and read documents containing a binary tree |
| 48 |
# with 2^i leaf nodes containing the numbers 1 to 2^i |
| 49 |
# for i up to at least 22 (8M XML elements) output works fine |
| 50 |
# for i up to 19 (1M XML elements) input works without swapping |
| 51 |
# with i=20 swapping starts, but the program it still terminates |
| 52 |
# the size of the XML file for i=20 is about 36Mb |
| 53 |
# these tests have run on a box with 1Gb memory |
| 54 |
|
| 55 |
tests = 18 |
| 56 |
|
| 57 |
test : $(prog) |
| 58 |
$(MAKE) genfiles tests="$(tests)" |
| 59 |
$(MAKE) copy tests="$(tests)" |
| 60 |
$(MAKE) lines tests="$(tests)" |
| 61 |
$(MAKE) relines tests="$(tests)" |
| 62 |
$(MAKE) words tests="$(tests)" |
| 63 |
$(MAKE) rewords tests="$(tests)" |
| 64 |
|
| 65 |
perftest : $(prog) |
| 66 |
$(MAKE) test tests="2 3 10 11 12 13 14 15 16 17 18 19 20" |
| 67 |
|
| 68 |
genfiles : |
| 69 |
@for i in $(tests) ; \ |
| 70 |
do \ |
| 71 |
echo time $(prog) $(ropts) $$i ; \ |
| 72 |
time $(prog) $(ropts) $$i ; \ |
| 73 |
ls -l tree-*$$i.xml ; \ |
| 74 |
echo ; \ |
| 75 |
done |
| 76 |
|
| 77 |
copy : |
| 78 |
@for i in $(tests) ; \ |
| 79 |
do \ |
| 80 |
echo time $(prog0) $(ropts) $$i ; \ |
| 81 |
time $(prog0) $(ropts) $$i ; \ |
| 82 |
ls -l tree-*$$i.xml.copy ; \ |
| 83 |
echo ; \ |
| 84 |
done |
| 85 |
|
| 86 |
lines : |
| 87 |
@for i in $(tests) ; \ |
| 88 |
do \ |
| 89 |
echo time $(prog2) $(ropts) $$i ; \ |
| 90 |
time $(prog2) $(ropts) $$i ; \ |
| 91 |
ls -l tree-*$$i.xml.lines ; \ |
| 92 |
echo ; \ |
| 93 |
done |
| 94 |
|
| 95 |
relines : |
| 96 |
@for i in $(tests) ; \ |
| 97 |
do \ |
| 98 |
echo time $(prog3) $(ropts) $$i ; \ |
| 99 |
time $(prog3) $(ropts) $$i ; \ |
| 100 |
ls -l tree-*$$i.xml.relines ; \ |
| 101 |
echo ; \ |
| 102 |
done |
| 103 |
|
| 104 |
words : |
| 105 |
@for i in $(tests) ; \ |
| 106 |
do \ |
| 107 |
echo time $(prog4) $(ropts) $$i ; \ |
| 108 |
time $(prog4) $(ropts) $$i ; \ |
| 109 |
ls -l tree-*$$i.xml.words ; \ |
| 110 |
echo ; \ |
| 111 |
done |
| 112 |
|
| 113 |
rewords : |
| 114 |
@for i in $(tests) ; \ |
| 115 |
do \ |
| 116 |
echo time $(prog5) $$i ; \ |
| 117 |
time $(prog5) $(ropts) $$i ; \ |
| 118 |
ls -l tree-*$$i.xml.rewords ; \ |
| 119 |
echo ; \ |
| 120 |
done |
| 121 |
|
| 122 |
dist : |
| 123 |
[ -d $(DIST_DIR) ] || mkdir -p $(DIST_DIR) |
| 124 |
cp Makefile REtest.hs $(DIST_DIR) |
| 125 |
|
| 126 |
clean : |
| 127 |
rm -f $(progs) *.o *.hi *.xml *.xml.* |
| 128 |
|