File: Makefile

package info (click to toggle)
lexd 1.3.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 880 kB
  • sloc: cpp: 2,889; makefile: 91; sh: 29
file content (72 lines) | stat: -rw-r--r-- 1,546 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.PHONY: check

tests = \
  alt \
  anonlex \
  anonlex-modifier \
  anonpat \
  anonpat-filter \
  anonpat-filter-ops \
  anonpat-modifier \
  anonpat-nospaces \
  anonpat-ops \
  conflicting-tags \
  diacritic \
  disjoint-opt \
  empty \
  empty-patterns \
  filter-crosstalk \
  lexdeftag \
  lexicon-side-tags \
  lexname-space \
  lextag \
  lexnegtag \
  nontree \
  oneside \
  opt \
  or-filter \
  pairs \
  pattag \
  pattag-coherent \
  pattag-details \
  pattern-independence \
  regex \
  revsieve \
  sieve \
  sieveopt \
  slots-and-operators-nospace \
  xor-filter \
  xor-multi \

sources = $(foreach test,$(tests),test-$(test).lexd)

check-pos: $(foreach src,$(sources),$(O)/$(src).txt.strings.check)

negtests = \
  col0 \
  trailing-bracket \

negsources = $(foreach test,$(negtests),negtest-$(test).lexd)

check-neg: $(foreach src,$(negsources),$(O)/$(src).txt.error)

check: check-pos check-neg

O=.

$(O):
	mkdir $(O)
$(O)/%.lexd.txt: ../../src/lexd %.lexd | $(O)
	$^ $(LEXD_TEST_FLAGS) > $@
$(O)/%.lexd.txt.strings: $(O)/%.lexd.txt
	hfst-txt2fst $< | hfst-fst2strings -X obey-flags -c 10 | LC_ALL=C sort -u > $@
$(O)/%.strings.diff: $(O)/%.strings %.strings.gold
	diff -U0 $^ > $@; [ $$? != 2 ]
$(O)/%.strings.check: $(O)/%.strings.diff
	[ -s "$<" ] && cat "$<" && exit 1; touch $@
$(O)/%.lexd.txt.error: ../../src/lexd %.lexd | $(O)
	$^ $(LEXD_TEST_FLAGS) > /dev/null 2> $@; [ $$? = 1 ]
clean:
	rm $(foreach src,$(sources),$(O)/$(src).txt.strings.check)
	rm $(foreach src,$(negsources),$(O)/$(src).txt.error)
	rmdir $(O)