Fix error in kg conversion
[gcalctool.git] / src / Makefile.am
blobf0f79ef6f83f35811660341e3aaed89179e54c95
1 bin_PROGRAMS = gcalctool gcalccmd
3 INCLUDES = \
4         -DUI_DIR=\""$(datadir)/gcalctool"\" \
5         -DVERSION=\""$(VERSION)"\" \
6         -DLOCALE_DIR=\""$(localedir)"\" \
7         -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
8         $(WARN_CFLAGS) \
9         $(GCALCTOOL_CFLAGS)
11 gcalctool_SOURCES = \
12         currency.c \
13         currency.h \
14         currency-manager.c \
15         currency-manager.h \
16         gcalctool.c \
17         math-buttons.c \
18         math-buttons.h \
19         math-converter.c \
20         math-converter.h \
21         math-display.c \
22         math-display.h \
23         math-equation.c \
24         math-equation.h \
25         math-preferences.c \
26         math-preferences.h \
27         math-variables.c \
28         math-variables.h \
29         math-variable-popup.c \
30         math-variable-popup.h \
31         math-window.c \
32         math-window.h \
33         math-enums.c \
34         math-enums.h \
35         mp.c \
36         mp.h \
37         mp-binary.c \
38         mp-convert.c \
39         mp-private.h \
40         mp-trigonometric.c \
41         mp-equation.c \
42         mp-equation.h \
43         mp-equation-private.h \
44         mp-equation-lexer.c \
45         mp-equation-lexer.h \
46         mp-equation-parser.c \
47         mp-equation-parser.h \
48         mp-serializer.c \
49         mp-serializer.h \
50         financial.c \
51         financial.h \
52         unit.c \
53         unit.h \
54         unit-category.c \
55         unit-category.h \
56         unit-manager.c \
57         unit-manager.h \
58         unittest.c \
59         unittest.h
61 gcalctool_LDADD = \
62         $(GCALCTOOL_LIBS)
64 gcalccmd_SOURCES = \
65         gcalccmd.c \
66         currency.c \
67         currency.h \
68         currency-manager.c \
69         currency-manager.h \
70         mp.c \
71         mp-convert.c \
72         mp-binary.c \
73         mp-trigonometric.c \
74         mp-equation.c \
75         mp-equation-parser.c \
76         mp-equation-lexer.c \
77         mp-serializer.c \
78         mp-serializer.h\
79         math-enums.c \
80         math-enums.h \
81         unit.c \
82         unit.h \
83         unit-category.c \
84         unit-category.h \
85         unit-manager.c \
86         unit-manager.h
88 gcalccmd_LDADD = \
89         $(GCALCCMD_LIBS) \
90         -lm
92 CLEANFILES = \
93         mp-equation-parser.h \
94         mp-equation-parser.c \
95         mp-equation-lexer.c \
96         mp-equation-lexer.h \
97         math-enums.c \
98         math-enums.h
100 # Generate parser files
101 mp-equation-parser.c mp-equation-parser.h: mp-equation-parser.y mp-equation-lexer.h
102         $(AM_V_GEN)$(YACC) -d -o mp-equation-parser.c $(srcdir)/mp-equation-parser.y
104 # Generate lexer files
105 mp-equation-lexer.c mp-equation-lexer.h: mp-equation-lexer.l
106         $(AM_V_GEN)$(LEX) $(srcdir)/mp-equation-lexer.l
108 # Rebuild parser when source files change
109 mp-equation-parser.o: mp-equation-lexer.h
110 mp-equation-lexer.o: mp-equation-parser.h
111 mp-equation.c: mp-equation-lexer.h mp-equation-parser.h
113 # Generate enum types
114 math-enums.h: math-enums.h.template mp-serializer.h
115         $(AM_V_GEN)$(GLIB_MKENUMS) --template $(srcdir)/math-enums.h.template $(srcdir)/mp-serializer.h > math-enums.h
117 math-enums.c: math-enums.c.template math-enums.h mp-serializer.h
118         $(AM_V_GEN)$(GLIB_MKENUMS) --template $(srcdir)/math-enums.c.template $(srcdir)/mp-serializer.h > math-enums.c
120 # Fix dependencies
121 math-serializer.c: math-enums.h
122 math-equation.c: math-enums.h
124 # Install a symlink between gcalctool and gnome-calculator
125 install-exec-hook:
126         test -e "$(DESTDIR)$(bindir)/gnome-calculator" \
127         || (cd "$(DESTDIR)$(bindir)" && ln -s gcalctool gnome-calculator)
129 # Remove the symlink between gcalctool and gnome-calculator
130 uninstall-local:
131         test -h "$(DESTDIR)$(bindir)/gnome-calculator" \
132         && rm -f "$(DESTDIR)$(bindir)/gnome-calculator"
134 EXTRA_DIST = \
135         mp-equation-parser.y \
136         mp-equation-lexer.l \
137         math-enums.c.template \
138         math-enums.h.template
140 DISTCLEANFILES = \
141         Makefile.in
143 test: gcalctool
144         ./gcalctool -u