summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: c01c037a731030c02db1cb11e7482fb302cc017e (plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
bin_PROGRAMS = mate-calc mate-calc-cmd

INCLUDES = \
	-DUI_DIR=\""$(datadir)/mate-calc"\" \
	-DVERSION=\""$(VERSION)"\" \
	-DLOCALE_DIR=\""$(localedir)"\" \
	-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
	$(WARN_CFLAGS) \
	$(MATE_CALC_CFLAGS)

mate_calc_SOURCES = \
	currency.c \
	currency.h \
	mate-calc.c \
	math-buttons.c \
	math-buttons.h \
	math-display.c \
	math-display.h \
	math-equation.c \
	math-equation.h \
	math-preferences.c \
	math-preferences.h \
	math-variables.c \
	math-variables.h \
	math-window.c \
	math-window.h \
	mp.c \
	mp.h \
	mp-binary.c \
	mp-convert.c \
	mp-private.h \
	mp-trigonometric.c \
	mp-equation.c \
	mp-equation.h \
	mp-equation-private.h \
	mp-equation-lexer.c \
	mp-equation-lexer.h \
	mp-equation-parser.c \
	mp-equation-parser.h \
	financial.c \
	financial.h \
	unittest.c \
	unittest.h

mate_calc_LDADD = \
	$(MATE_CALC_LIBS)

mate_calc_cmd_SOURCES = \
	mate-calc-cmd.c \
	mp.c \
	mp-convert.c \
	mp-binary.c \
	mp-trigonometric.c \
	mp-equation.c \
	mp-equation-parser.c \
	mp-equation-lexer.c

mate_calc_cmd_LDADD = \
	$(MATE_CALC_CMD_LIBS) \
	-lm

CLEANFILES = \
	mp-equation-parser.h \
	mp-equation-parser.c \
	mp-equation-lexer.c \
	mp-equation-lexer.h

# Generate parser files
mp-equation-parser.c mp-equation-parser.h: mp-equation-parser.y mp-equation-lexer.h
	$(AM_V_GEN)$(YACC) -d -o mp-equation-parser.c $(srcdir)/mp-equation-parser.y

# Generate lexer files
mp-equation-lexer.c mp-equation-lexer.h: mp-equation-lexer.l
	$(AM_V_GEN)$(LEX) $(srcdir)/mp-equation-lexer.l

# Rebuild parser when source files change
mp-equation-parser.o: mp-equation-lexer.h
mp-equation-lexer.o: mp-equation-parser.h
mp-equation.c: mp-equation-lexer.h mp-equation-parser.h

# Install a symlink between mate-calc and mate-calculator
install-exec-hook:
	test -e "$(DESTDIR)$(bindir)/mate-calculator" \
	|| (cd "$(DESTDIR)$(bindir)" && ln -s mate-calc mate-calculator)

# Remove the symlink between mate-calc and mate-calculator
uninstall-local:
	test -h "$(DESTDIR)$(bindir)/mate-calculator" \
	&& rm -f "$(DESTDIR)$(bindir)/mate-calculator"

EXTRA_DIST = \
	mp-equation-parser.y \
	mp-equation-lexer.l

DISTCLEANFILES = \
	Makefile.in

test: mate-calc
	./mate-calc -u