discover/grub2: Implement load_env
[petitboot] / test / parser / Makefile.am
1 #  This program is free software; you can redistribute it and/or modify
2 #  it under the terms of the GNU General Public License as published by
3 #  the Free Software Foundation; version 2 of the License.
4 #
5 #  This program is distributed in the hope that it will be useful,
6 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8 #  GNU General Public License for more details.
9 #
10 #  You should have received a copy of the GNU General Public License
11 #  along with this program; if not, write to the Free Software
12 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
13
14 AUTOMAKE_OPTIONS = parallel-tests
15
16 AM_CPPFLAGS = \
17         -I$(top_srcdir) \
18         -I$(top_srcdir)/lib \
19         -I$(top_srcdir)/discover \
20         -DLOCAL_STATE_DIR='"$(localstatedir)"' \
21         -DTEST_CONF_BASE='"$(srcdir)/data"' \
22         -DDEBUG -DPETITBOOT_TEST
23
24 AM_CFLAGS = -O0 -ggdb -Wall -Wextra -Werror
25
26 LDADD = $(top_builddir)/lib/libpbcore.la libtest.ro
27
28 TESTS = \
29         test-null \
30         test-grub2-single \
31         test-grub2-default \
32         test-grub2-default-index \
33         test-grub2-default-multiword \
34         test-grub2-multiple-resolve \
35         test-grub2-single-line-if \
36         test-grub2-load-env \
37         test-grub2-f18-ppc64 \
38         test-grub2-ubuntu-13_04-x86 \
39         test-grub2-lexer-error \
40         test-grub2-parser-error \
41         test-kboot-single \
42         test-yaboot-single \
43         test-yaboot-partition \
44         test-yaboot-partition-override \
45         test-yaboot-external \
46         test-yaboot-root-global \
47         test-yaboot-root-override \
48         test-yaboot-device-override \
49         test-yaboot-default \
50         test-yaboot-rh8-ppc64 \
51         test-pxe-empty \
52         test-pxe-single \
53         test-pxe-initrd-in-append \
54         test-pxe-default
55
56 $(TESTS): %: %.embedded-config.o
57 $(TESTS): LDADD += $@.embedded-config.o
58
59 extract_config = $(srcdir)/extract-config.awk
60
61 %.embedded-config.c: %.c $(extract_config)
62         $(AWK) -f $(extract_config) $< > $@
63
64 # objects under test
65 parser_objs = \
66         $(top_srcdir)/discover/yaboot-parser.c \
67         $(top_srcdir)/discover/kboot-parser.c \
68         $(top_srcdir)/discover/pxe-parser.c \
69         $(top_srcdir)/discover/resource.c \
70         $(top_srcdir)/discover/paths.c \
71         $(top_srcdir)/discover/device-handler.c \
72         $(top_srcdir)/discover/parser-conf.c
73
74 libtest_ro_SOURCES = \
75         main.c \
76         utils.c \
77         handler.c \
78         parser-test.h \
79         $(parser_objs)
80
81 libtest_ro_LDADD = \
82         ../../discover/grub2/grub2-parser.ro
83
84 libtest.ro$(EXEEXT): $(libtest_ro_OBJECTS) $(libtest_ro_LDADD)
85         $(LD) -o $@ -r $^
86
87 check_PROGRAMS = $(TESTS) libtest.ro
88
89 check_DATA = \
90         data/grub2-f18-ppc64.conf \
91         data/grub2-ubuntu-13_04-x86.conf \
92         data/yaboot-rh8-ppc64.conf
93
94 EXTRA_DIST = $(check_DATA) $(extract_config)
95
96 CLEANFILES = \
97         $(foreach f, $(TESTS), $(f).embedded-config.c $(f).embedded-config.o)
98
99 MAINTAINERCLEANFILES = Makefile.in