Pretty print date in query output.
[beagle.git] / tools / Makefile.am
blob44e0e7df2edb5c36a3dc932cd6d30ebf00887574
1 # Warnings we don't want to see
3 CSC = $(MCS) -debug
5 LOCAL_ASSEMBLIES =                      \
6         ../Util/Util.dll                \
7         ../BeagleClient/Beagle.dll      \
8         ../beagled/BeagleDaemonPlugins.dll \
9         ../beagled/BeagleDaemonLib.dll
11 ASSEMBLIES =                            \
12         $(BEAGLED_LIBS)                 \
13         -r:Mono.Posix                   \
14         $(LOCAL_ASSEMBLIES:%=-r:%)
16 WRAPPER_IN = wrapper.in
17 WRAPPER_SED = sed                                       \
18         -e "s|\@prefix\@|$(prefix)|g"                   \
19         -e "s|\@pkglibdir\@|$(pkglibdir)|g"             \
20         -e "s|\@libdir\@|$(libdir)|g"                   \
21         -e "s|\@libexecdir\@|$(libexecdir)|g"           \
22         -e "s|\@bindir\@|$(bindir)|g"                   \
23         -e "s|\@sbindir\@|$(sbindir)|g"                 \
24         -e "s|\@sysconfdir\@|$(sysconfdir)|g"           \
25         -e "s|\@localstatedir\@|$(localstatedir)|g"     \
26         -e "s|\@gacprefix\@|$(GAC_PREFIX)|g"            \
27         -e "s|\@bash\@|$(BASH)|"
29 CRAWL_WRAPPER = beagle-crawl-system
30 CRAWL_WRAPPER_IN = $(CRAWL_WRAPPER).in
32 $(CRAWL_WRAPPER) : $(CRAWL_WRAPPER_IN)
33         $(WRAPPER_SED) < $(srcdir)/$(CRAWL_WRAPPER_IN) > $@
34         chmod +x $(CRAWL_WRAPPER)
36 CRAWL_RULES = \
37         $(srcdir)/crawl-rules/crawl-windows             \
38         $(srcdir)/crawl-rules/crawl-applications        \
39         $(srcdir)/crawl-rules/crawl-documentation
41 crondir = $(sysconfdir)/cron.daily
42 cron_SCRIPTS = $(CRAWL_WRAPPER)
44 # FIXME: Per-distribution specific crawl rules
45 configdir = $(sysconfdir)/beagle
46 config_DATA = $(CRAWL_RULES)
48 INFO_TARGET  = Info.exe
49 INFO_WRAPPER = beagle-info
50 INFO_CSFILES = $(srcdir)/Info.cs
52 $(INFO_TARGET): $(INFO_CSFILES) $(LOCAL_ASSEMBLIES)
53         $(CSC) -out:$@ $(CSFLAGS) $(INFO_CSFILES) $(ASSEMBLIES)
55 $(INFO_WRAPPER): $(WRAPPER_IN)
56         $(WRAPPER_SED) -e "s|\@target\@|$(INFO_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
57         chmod +x $(INFO_WRAPPER)
59 SHUTDOWN_TARGET  = Shutdown.exe
60 SHUTDOWN_WRAPPER = beagle-shutdown
61 SHUTDOWN_CSFILES = $(srcdir)/Shutdown.cs
63 $(SHUTDOWN_TARGET): $(SHUTDOWN_CSFILES) $(LOCAL_ASSEMBLIES)
64         $(CSC) -out:$@ $(CSFLAGS) $(SHUTDOWN_CSFILES) $(ASSEMBLIES)
66 $(SHUTDOWN_WRAPPER): $(WRAPPER_IN)
67         $(WRAPPER_SED) -e "s|\@target\@|$(SHUTDOWN_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
68         chmod +x $(SHUTDOWN_WRAPPER)
70 QUERY_TARGET  = Query.exe
71 QUERY_WRAPPER = beagle-query
72 QUERY_CSFILES = $(srcdir)/Query.cs
74 $(QUERY_TARGET): $(QUERY_CSFILES) $(LOCAL_ASSEMBLIES)
75         $(CSC) -out:$@ $(CSFLAGS) $(QUERY_CSFILES) $(ASSEMBLIES)
77 $(QUERY_WRAPPER): $(WRAPPER_IN)
78         $(WRAPPER_SED) -e "s|\@target\@|$(QUERY_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
79         chmod +x $(QUERY_WRAPPER)
81 EXERCISE_FILE_SYSTEM_TARGET = ExerciseFileSystem.exe
82 EXERCISE_FILE_SYSTEM_WRAPPER = beagle-exercise-file-system
83 EXERCISE_FILE_SYSTEM_CSFILES = $(srcdir)/ExerciseFileSystem.cs
85 $(EXERCISE_FILE_SYSTEM_TARGET): $(EXERCISE_FILE_SYSTEM_CSFILES) $(LOCAL_ASSEMBLIES)
86         $(CSC) -out:$@ $(CSFLAGS) $(EXERCISE_FILE_SYSTEM_CSFILES) $(ASSEMBLIES)
88 $(EXERCISE_FILE_SYSTEM_WRAPPER): $(WRAPPER_IN)
89         $(WRAPPER_SED) -e "s|\@target\@|$(EXERCISE_FILE_SYSTEM_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
90         chmod +x $(EXERCISE_FILE_SYSTEM_WRAPPER)
92 CONFIG_TARGET = Config.exe
93 CONFIG_WRAPPER = beagle-config
94 CONFIG_CSFILES = $(srcdir)/Config.cs
96 $(CONFIG_TARGET): $(CONFIG_CSFILES) $(LOCAL_ASSEMBLIES)
97         $(CSC) -out:$@ $(CSFLAGS) $(CONFIG_CSFILES) $(ASSEMBLIES)
99 $(CONFIG_WRAPPER): $(WRAPPER_IN)
100         $(WRAPPER_SED) -e "s|\@target\@|$(CONFIG_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
101         chmod +x $(CONFIG_WRAPPER)
103 SETTINGS_TARGET    = Settings.exe
104 SETTINGS_WRAPPER   = beagle-settings
105 SETTINGS_CSFILES   = $(srcdir)/Settings.cs
106 SETTINGS_RESOURCES = $(srcdir)/settings.glade $(top_srcdir)/beagled/beagled-autostart.desktop $(top_srcdir)/search/beagle-search-autostart.desktop
107 SETTINGS_RESOURCES_BUILD = $(foreach res,$(SETTINGS_RESOURCES), $(addprefix -resource:,$(srcdir)/$(res)),$(notdir $(res)))
108 SETTINGS_ASSEMBLIES = $(BEAGLE_UI_LIBS) -r:../Util/UiUtil.dll -r:../images/Images.dll
110 $(SETTINGS_TARGET): $(SETTINGS_CSFILES) $(SETTINGS_RESOURCES) $(LOCAL_ASSEMBLIES)
111         $(CSC) -out:$@ $(SETTINGS_RESOURCES_BUILD) $(CSFLAGS) $(SETTINGS_CSFLAGS) $(SETTINGS_CSFILES) $(ASSEMBLIES) $(SETTINGS_ASSEMBLIES)
113 $(SETTINGS_WRAPPER): $(WRAPPER_IN)
114         $(WRAPPER_SED) -e "s|\@target\@|$(SETTINGS_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
115         chmod +x $(SETTINGS_WRAPPER)
117 TARGETS =                               \
118         $(INFO_TARGET)                  \
119         $(SHUTDOWN_TARGET)              \
120         $(QUERY_TARGET)                 \
121         $(EXERCISE_FILE_SYSTEM_TARGET)  \
122         $(CONFIG_TARGET)
124 if ENABLE_GUI
125 TARGETS += $(SETTINGS_TARGET)
126 endif
128 TARGETS_MDB = $(TARGETS:%=%.mdb)
130 WRAPPERS =                              \
131         $(INFO_WRAPPER)                 \
132         $(SHUTDOWN_WRAPPER)             \
133         $(QUERY_WRAPPER)                \
134         $(EXERCISE_FILE_SYSTEM_WRAPPER) \
135         $(CONFIG_WRAPPER)
137 if ENABLE_GUI
138 WRAPPERS += $(SETTINGS_WRAPPER)
139 endif
141 PREBUILT_WRAPPERS =             \
142         beagle-index-info       \
143         beagle-ping             \
144         beagle-status
146 BIN_WRAPPERS =                  \
147         $(WRAPPERS)             \
148         $(PREBUILT_WRAPPERS)
150 man_MANS =                      \
151         beagle-query.1          \
152         beagle-shutdown.1       \
153         beagle-status.1         \
154         beagle-config.1
156 @INTLTOOL_DESKTOP_RULE@
158 if ENABLE_GUI
159 desktop_in_files = beagle-settings.desktop.in
160 desktop_files = $(desktop_in_files:.desktop.in=.desktop)
162 desktopdir = $(datadir)/applications
163 desktop_DATA = $(desktop_files)
164 endif
166 all: $(TARGETS) $(WRAPPERS)
168 install-data-local: $(TARGETS)
169         $(mkinstalldirs) $(DESTDIR)$(bindir)
170         $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
171         $(INSTALL_DATA) $(TARGETS) $(TARGETS_MDB) $(DESTDIR)$(pkglibdir)
173         @for i in $(WRAPPERS); do                                               \
174                 sed -e "s|\#installed=1|installed=1|" < $$i > $$i.tmp;          \
175                 echo "$(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i";       \
176                 $(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i || exit 1;    \
177                 rm -f $$i.tmp;                                                  \
178         done
180         @for i in $(PREBUILT_WRAPPERS); do                                      \
181                 sed -e "s|\#installed=1|installed=1|" < $(srcdir)/$$i > $$i.tmp;                \
182                 echo "$(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i";       \
183                 $(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i || exit 1;    \
184                 rm -f $$i.tmp;                                                  \
185         done
187 uninstall-local:
188         cd $(DESTDIR)$(pkglibdir) && rm -f $(TARGETS) && rm -f $(TARGETS_MDB)
190         @for i in $(BIN_WRAPPERS); do                           \
191                 echo "rm -f $(DESTDIR)$(bindir)/$$i";           \
192                 rm -f $(DESTDIR)$(bindir)/$$i || exit 1;        \
193         done
195 EXTRA_DIST =                            \
196         $(WRAPPER_IN)                   \
197         $(CRAWL_WRAPPER_IN)             \
198         $(CRAWL_WRAPPER_CRONTAB_IN)     \
199         $(INFO_CSFILES)                 \
200         $(SHUTDOWN_CSFILES)             \
201         $(QUERY_CSFILES)                \
202         $(EXERCISE_FILE_SYSTEM_CSFILES) \
203         $(CONFIG_CSFILES)               \
204         $(SETTINGS_CSFILES)             \
205         $(SETTINGS_RESOURCES)           \
206         $(man_MANS)                     \
207         $(CRAWL_RULES)                  \
208         $(desktop_in_files)             \
209         $(desktop_DATA)                 \
210         beagle-index-info               \
211         beagle-ping                     \
212         beagle-status                   \
213         boot.inotify.init               \
214         beagle-settings.desktop.in.in
216 CLEANFILES =                            \
217         $(TARGETS)                      \
218         $(TARGETS_MDB)                  \
219         $(WRAPPERS)                     \
220         $(CRAWL_WRAPPER)                \
221         $(CRAWL_WRAPPER_CRONTAB)        \
222         $(desktop_DATA)                 \
223         $(desktop_h_files)              \
224         settings.glade.h