Makefile.am 1.32 KB
Newer Older
1
2
3
4
## Makefile.am: this file is part of MonoBURG.		-*-Makefile-*-
##
## MonoBURG, an iburg like code generator generator.
##
5
## Copyright (C) 2001, 2002, 2004, 2005, 2012 Ximian, Inc.
6
7
8
9
10
11
12
13
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
##
## The complete GNU General Public Licence Notice can be found as the
## `NOTICE' file in the root directory.
14

15
16
17
## The test policy is to check if the output of monoburg differ from a
## `reference'. To add a test, just add `file.test' to `TESTS' and put
## `file.brg' and `file.c.ref' in the `tests' directory.
18
19


20
21
TESTS = sample.test

22
23
24
$(top_builddir)/src/monoburg$(EXEEXT):
	cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) monoburg$(EXEEXT)

25
26
27
SUFFIXES = .brg .test

.brg.c: $(top_builddir)/src/monoburg$(EXEEXT)
28
	$(top_builddir)/src/monoburg$(EXEEXT) $< > $@
29

30
.c.test:
Akim Demaille's avatar
Akim Demaille committed
31
	diff_tool='diff -u';				\
32
	test x$(VERBOSE) = x && diff_tool=cmp;		\
Akim Demaille's avatar
Akim Demaille committed
33
	if ! $$diff_tool $(srcdir)/$<.ref $<; then	\
34
35
36
37
		cp -f $< $<.fail;			\
		echo 'rm $$0; exit 1' > $@;		\
	else						\
		echo 'rm $$0; exit 0' > $@;		\
38
	fi
39
	chmod a+x $@
40

41
EXTRA_DIST = $(TESTS:.test=.brg) $(TESTS:.test=.c.ref)
42
CLEANFILES = $(TESTS:.test=.c) $(TESTS:.test=.c.fail)