Add a unit-manager object to track units
[gcalctool.git] / src / Makefile.am
blobe512538073fdf63e55d738e80f2f5f1670d9e330
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         gcalctool.c \
15         math-buttons.c \
16         math-buttons.h \
17         math-converter.c \
18         math-converter.h \
19         math-display.c \
20         math-display.h \
21         math-equation.c \
22         math-equation.h \
23         math-preferences.c \
24         math-preferences.h \
25         math-variables.c \
26         math-variables.h \
27         math-variable-popup.c \
28         math-variable-popup.h \
29         math-window.c \
30         math-window.h \
31         math-enums.c \
32         math-enums.h \
33         mp.c \
34         mp.h \
35         mp-binary.c \
36         mp-convert.c \
37         mp-private.h \
38         mp-trigonometric.c \
39         mp-equation.c \
40         mp-equation.h \
41         mp-equation-private.h \
42         mp-equation-lexer.c \
43         mp-equation-lexer.h \
44         mp-equation-parser.c \
45         mp-equation-parser.h \
46         mp-serializer.c \
47         mp-serializer.h \
48         financial.c \
49         financial.h \
50         unit-manager.c \
51         unit-manager.h \
52         unittest.c \
53         unittest.h
55 gcalctool_LDADD = \
56         $(GCALCTOOL_LIBS)
58 gcalccmd_SOURCES = \
59         gcalccmd.c \
60         mp.c \
61         mp-convert.c \
62         mp-binary.c \
63         mp-trigonometric.c \
64         mp-equation.c \
65         mp-equation-parser.c \
66         mp-equation-lexer.c \
67         mp-serializer.c \
68         mp-serializer.h\
69         math-enums.c \
70         math-enums.h \
71         unit-manager.c \
72         unit-manager.h
74 gcalccmd_LDADD = \
75         $(GCALCCMD_LIBS) \
76         -lm
78 CLEANFILES = \
79         mp-equation-parser.h \
80         mp-equation-parser.c \
81         mp-equation-lexer.c \
82         mp-equation-lexer.h \
83         math-enums.c \
84         math-enums.h
86 # Generate parser files
87 mp-equation-parser.c mp-equation-parser.h: mp-equation-parser.y mp-equation-lexer.h
88         $(AM_V_GEN)$(YACC) -d -o mp-equation-parser.c $(srcdir)/mp-equation-parser.y
90 # Generate lexer files
91 mp-equation-lexer.c mp-equation-lexer.h: mp-equation-lexer.l
92         $(AM_V_GEN)$(LEX) $(srcdir)/mp-equation-lexer.l
94 # Rebuild parser when source files change
95 mp-equation-parser.o: mp-equation-lexer.h
96 mp-equation-lexer.o: mp-equation-parser.h
97 mp-equation.c: mp-equation-lexer.h mp-equation-parser.h
99 # Generate enum types
100 math-enums.h: math-enums.h.template mp-serializer.h
101         $(AM_V_GEN)$(GLIB_MKENUMS) --template $(srcdir)/math-enums.h.template $(srcdir)/mp-serializer.h > math-enums.h
103 math-enums.c: math-enums.c.template math-enums.h mp-serializer.h
104         $(AM_V_GEN)$(GLIB_MKENUMS) --template $(srcdir)/math-enums.c.template $(srcdir)/mp-serializer.h > math-enums.c
106 # Fix dependencies
107 math-serializer.c: math-enums.h
108 math-equation.c: math-enums.h
110 # Install a symlink between gcalctool and gnome-calculator
111 install-exec-hook:
112         test -e "$(DESTDIR)$(bindir)/gnome-calculator" \
113         || (cd "$(DESTDIR)$(bindir)" && ln -s gcalctool gnome-calculator)
115 # Remove the symlink between gcalctool and gnome-calculator
116 uninstall-local:
117         test -h "$(DESTDIR)$(bindir)/gnome-calculator" \
118         && rm -f "$(DESTDIR)$(bindir)/gnome-calculator"
120 EXTRA_DIST = \
121         mp-equation-parser.y \
122         mp-equation-lexer.l \
123         math-enums.c.template \
124         math-enums.h.template
126 DISTCLEANFILES = \
127         Makefile.in
129 test: gcalctool
130         ./gcalctool -u