Makefile.am 2.01 KB
Newer Older
1
2
3
4
# From LRDE's TC's src/parse/Makefile.am:
# "[asm-parse.cc] is not part of [FROM_ASM_PARSE_YY] to prevent
#  [asm-parse.cc] from occuring twice in libparse_a_SOURCES to avoid
#  double inclusion of [asm-parse.o]."
Benoit Perrot's avatar
Benoit Perrot committed
5
6
7
FROM_ASM_PARSE_YY =							\
	$(srcdir)/stack.hh $(srcdir)/position.hh $(srcdir)/location.hh	\
	$(srcdir)/asm-parse.hh
Benoit Perrot's avatar
Benoit Perrot committed
8

9
10
11
BUILT_SOURCES =				\
	asm-scan.ll asm-scan.ll.stamp	\
	asm-parse.yy asm-parse.yy.stamp	\
Benoit Perrot's avatar
Benoit Perrot committed
12
13
	$(FROM_ASM_PARSE_YY)

Benoit Perrot's avatar
Benoit Perrot committed
14
15
16
# This code comes from "Handling Tools that Produce Many Outputs",
# from the Automake documentation.

17
18
EXTRA_DIST = $(srcdir)/asm-scan.ll.gen.py
asm-scan.ll.stamp: $(srcdir)/asm-scan.ll.gen.py $(top_srcdir)/dev/nolimips.xml
Benoit Perrot's avatar
Benoit Perrot committed
19
20
	@rm -rf $@.tmp
	@touch $@.tmp
21
	PYTHONPATH="$(top_srcdir)/dev/:$$PYTHONPATH" $(srcdir)/asm-scan.ll.gen.py $(srcdir) < $(top_srcdir)/dev/nolimips.xml
Benoit Perrot's avatar
Benoit Perrot committed
22
	@mv -f $@.tmp $@
23
$(srcdir)/asm-scan.ll: asm-scan.ll.stamp
Benoit Perrot's avatar
Benoit Perrot committed
24

25
26
EXTRA_DIST += $(srcdir)/asm-parse.yy.gen.py
asm-parse.yy.stamp: $(srcdir)/asm-parse.yy.gen.py $(top_srcdir)/dev/nolimips.xml
Benoit Perrot's avatar
Benoit Perrot committed
27
28
	@rm -rf $@.tmp
	@touch $@.tmp
29
	PYTHONPATH="$(top_srcdir)/dev/:$$PYTHONPATH" $(srcdir)/asm-parse.yy.gen.py $(srcdir) < $(top_srcdir)/dev/nolimips.xml
Benoit Perrot's avatar
Benoit Perrot committed
30
	@mv -f $@.tmp $@
31
$(srcdir)/asm-parse.yy: asm-parse.yy.stamp
32

Benoit Perrot's avatar
Benoit Perrot committed
33
34

BISONXX = $(top_srcdir)/config/bison++
35
EXTRA_DIST += $(srcdir)/bison++.stamp
Benoit Perrot's avatar
Benoit Perrot committed
36
37
38
39
40
$(srcdir)/bison++.stamp: $(srcdir)/asm-parse.yy
	@rm -rf bison++.stamp.tmp
	@touch bison++.stamp.tmp
	$(BISONXX) $(srcdir) asm-parse.yy asm-parse.cc -d -ra
	@mv -f bison++.stamp.tmp $@
Benoit Perrot's avatar
Benoit Perrot committed
41
42
43

# Run bison if a file that can be created by it is missing:

Benoit Perrot's avatar
Benoit Perrot committed
44
45
46
47
$(srcdir)/asm-parse.cc $(FROM_ASM_PARSE_YY): $(srcdir)/bison++.stamp
	@if test ! -f $@; then					\
	  rm -f $(srcdir)/bison++.stamp;			\
	  $(MAKE) $(AM_MAKEFLAGS) $(srcdir)/bison++.stamp;	\
Benoit Perrot's avatar
Benoit Perrot committed
48
	fi
49

Benoit Perrot's avatar
Benoit Perrot committed
50
MAINTAINERCLEANFILES = asm-scan.ll asm-scan.yy $(FROM_ASM_PARSE_YY)
51

Benoit Perrot's avatar
Benoit Perrot committed
52
noinst_LIBRARIES = libparse.a
Benoit Perrot's avatar
Benoit Perrot committed
53
54

libparse_a_CPPFLAGS = -I $(top_srcdir)/src -I $(top_builddir)/src
Benoit Perrot's avatar
Benoit Perrot committed
55
libparse_a_SOURCES =					\
56
	asm-parse.yy asm-parse.yy.stamp			\
Benoit Perrot's avatar
Benoit Perrot committed
57
	$(FROM_ASM_PARSE_YY)				\
58
	asm-scan.ll asm-scan.hh asm-scan.ll.stamp	\
Benoit Perrot's avatar
Benoit Perrot committed
59
	libparse.hh libparse.cc