Merge the recent changes from HEAD onto the branch
[beagle.git] / tools / Makefile.am
blob0ee998ee3b0bb62d5865ef4b0791b5fe94c3dad8
1 # Warnings we don't want to see
2 # 0169 = The private field is never used
4 CSC = $(MCS) -debug -nowarn:0169
6 LOCAL_ASSEMBLIES =                      \
7         ../Util/Util.dll                \
8         ../BeagleClient/Beagle.dll      \
9         ../beagled/BeagleDaemonPlugins.dll \
10         ../beagled/BeagleDaemonLib.dll
12 ASSEMBLIES =                            \
13         $(BEAGLED_LIBS)                 \
14         -r:Mono.Posix                   \
15         $(LOCAL_ASSEMBLIES:%=-r:%)
17 WRAPPER_IN = wrapper.in
18 WRAPPER_SED = sed                                       \
19         -e "s|\@prefix\@|$(prefix)|g"                   \
20         -e "s|\@pkglibdir\@|$(pkglibdir)|g"             \
21         -e "s|\@libdir\@|$(libdir)|g"                   \
22         -e "s|\@libexecdir\@|$(libexecdir)|g"           \
23         -e "s|\@bindir\@|$(bindir)|g"                   \
24         -e "s|\@sbindir\@|$(sbindir)|g"                 \
25         -e "s|\@sysconfdir\@|$(sysconfdir)|g"           \
26         -e "s|\@localstatedir\@|$(localstatedir)|g"     \
27         -e "s|\@gacprefix\@|$(GAC_PREFIX)|g"            \
28         -e "s|\@bash\@|$(BASH)|"
30 CRAWL_WRAPPER = beagle-crawl-system
31 CRAWL_WRAPPER_IN = $(CRAWL_WRAPPER).in
33 $(CRAWL_WRAPPER) : $(CRAWL_WRAPPER_IN)
34         $(WRAPPER_SED) < $(srcdir)/$(CRAWL_WRAPPER_IN) > $@
35         chmod +x $(CRAWL_WRAPPER)
37 CRAWL_RULES = \
38         $(srcdir)/crawl-rules/crawl-windows             \
39         $(srcdir)/crawl-rules/crawl-applications        \
40         $(srcdir)/crawl-rules/crawl-documentation
42 crondir = $(sysconfdir)/cron.daily
43 cron_SCRIPTS = $(CRAWL_WRAPPER)
45 # FIXME: Per-distribution specific crawl rules
46 configdir = $(sysconfdir)/beagle
47 config_DATA = $(CRAWL_RULES)
49 INFO_TARGET  = Info.exe
50 INFO_WRAPPER = beagle-info
51 INFO_CSFILES = $(srcdir)/Info.cs
53 $(INFO_TARGET): $(INFO_CSFILES) $(LOCAL_ASSEMBLIES)
54         $(CSC) -out:$@ $(CSFLAGS) $(INFO_CSFILES) $(ASSEMBLIES)
56 $(INFO_WRAPPER): $(WRAPPER_IN)
57         $(WRAPPER_SED) -e "s|\@target\@|$(INFO_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
58         chmod +x $(INFO_WRAPPER)
60 SHUTDOWN_TARGET  = Shutdown.exe
61 SHUTDOWN_WRAPPER = beagle-shutdown
62 SHUTDOWN_CSFILES = $(srcdir)/Shutdown.cs
64 $(SHUTDOWN_TARGET): $(SHUTDOWN_CSFILES) $(LOCAL_ASSEMBLIES)
65         $(CSC) -out:$@ $(CSFLAGS) $(SHUTDOWN_CSFILES) $(ASSEMBLIES)
67 $(SHUTDOWN_WRAPPER): $(WRAPPER_IN)
68         $(WRAPPER_SED) -e "s|\@target\@|$(SHUTDOWN_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
69         chmod +x $(SHUTDOWN_WRAPPER)
71 QUERY_TARGET  = Query.exe
72 QUERY_WRAPPER = beagle-query
73 QUERY_CSFILES = $(srcdir)/Query.cs
75 $(QUERY_TARGET): $(QUERY_CSFILES) $(LOCAL_ASSEMBLIES)
76         $(CSC) -out:$@ $(CSFLAGS) $(QUERY_CSFILES) $(ASSEMBLIES)
78 $(QUERY_WRAPPER): $(WRAPPER_IN)
79         $(WRAPPER_SED) -e "s|\@target\@|$(QUERY_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
80         chmod +x $(QUERY_WRAPPER)
82 EXERCISE_FILE_SYSTEM_TARGET = ExerciseFileSystem.exe
83 EXERCISE_FILE_SYSTEM_WRAPPER = beagle-exercise-file-system
84 EXERCISE_FILE_SYSTEM_CSFILES = $(srcdir)/ExerciseFileSystem.cs
86 $(EXERCISE_FILE_SYSTEM_TARGET): $(EXERCISE_FILE_SYSTEM_CSFILES) $(LOCAL_ASSEMBLIES)
87         $(CSC) -out:$@ $(CSFLAGS) $(EXERCISE_FILE_SYSTEM_CSFILES) $(ASSEMBLIES)
89 $(EXERCISE_FILE_SYSTEM_WRAPPER): $(WRAPPER_IN)
90         $(WRAPPER_SED) -e "s|\@target\@|$(EXERCISE_FILE_SYSTEM_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
91         chmod +x $(EXERCISE_FILE_SYSTEM_WRAPPER)
93 CONFIG_TARGET = Config.exe
94 CONFIG_WRAPPER = beagle-config
95 CONFIG_CSFILES = $(srcdir)/Config.cs
97 $(CONFIG_TARGET): $(CONFIG_CSFILES) $(LOCAL_ASSEMBLIES)
98         $(CSC) -out:$@ $(CSFLAGS) $(CONFIG_CSFILES) $(ASSEMBLIES)
100 $(CONFIG_WRAPPER): $(WRAPPER_IN)
101         $(WRAPPER_SED) -e "s|\@target\@|$(CONFIG_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
102         chmod +x $(CONFIG_WRAPPER)
104 SETTINGS_TARGET    = Settings.exe
105 SETTINGS_WRAPPER   = beagle-settings
106 SETTINGS_CSFILES   = $(srcdir)/Settings.cs
107 SETTINGS_RESOURCES = $(srcdir)/settings.glade
108 SETTINGS_RESOURCES_BUILD = $(foreach res,$(SETTINGS_RESOURCES), $(addprefix -resource:,$(srcdir)/$(res)),$(notdir $(res)))
109 SETTINGS_ASSEMBLIES = $(BEAGLE_UI_LIBS) -r:../Util/UiUtil.dll -r:../images/Images.dll
111 $(SETTINGS_TARGET): $(SETTINGS_CSFILES) $(SETTINGS_RESOURCES) $(LOCAL_ASSEMBLIES)
112         $(CSC) -out:$@ $(SETTINGS_RESOURCES_BUILD) $(CSFLAGS) $(SETTINGS_CSFLAGS) $(SETTINGS_CSFILES) $(ASSEMBLIES) $(SETTINGS_ASSEMBLIES)
114 $(SETTINGS_WRAPPER): $(WRAPPER_IN)
115         $(WRAPPER_SED) -e "s|\@target\@|$(SETTINGS_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
116         chmod +x $(SETTINGS_WRAPPER)
118 TARGETS =                               \
119         $(INFO_TARGET)                  \
120         $(SHUTDOWN_TARGET)              \
121         $(QUERY_TARGET)                 \
122         $(EXERCISE_FILE_SYSTEM_TARGET)  \
123         $(CONFIG_TARGET)
125 if ENABLE_GUI
126 TARGETS += $(SETTINGS_TARGET)
127 endif
129 TARGETS_MDB = $(TARGETS:%=%.mdb)
131 WRAPPERS =                              \
132         $(INFO_WRAPPER)                 \
133         $(SHUTDOWN_WRAPPER)             \
134         $(QUERY_WRAPPER)                \
135         $(EXERCISE_FILE_SYSTEM_WRAPPER) \
136         $(CONFIG_WRAPPER)
138 if ENABLE_GUI
139 WRAPPERS += $(SETTINGS_WRAPPER)
140 endif
142 PREBUILT_WRAPPERS =             \
143         beagle-index-info       \
144         beagle-ping             \
145         beagle-status
147 BIN_WRAPPERS =                  \
148         $(WRAPPERS)             \
149         $(PREBUILT_WRAPPERS)
151 man_MANS =                      \
152         beagle-query.1          \
153         beagle-shutdown.1       \
154         beagle-status.1         \
155         beagle-config.1
157 @INTLTOOL_DESKTOP_RULE@
159 if ENABLE_GUI
160 desktop_in_files = beagle-settings.desktop.in
161 desktop_files = $(desktop_in_files:.desktop.in=.desktop)
163 desktopdir = $(datadir)/applications
164 desktop_DATA = $(desktop_files)
165 endif
167 all: $(TARGETS) $(WRAPPERS)
169 install-data-local: $(TARGETS)
170         $(mkinstalldirs) $(DESTDIR)$(bindir)
171         $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
172         $(INSTALL_DATA) $(TARGETS) $(TARGETS_MDB) $(DESTDIR)$(pkglibdir)
174         @for i in $(WRAPPERS); do                                               \
175                 sed -e "s|\#installed=1|installed=1|" < $$i > $$i.tmp;          \
176                 echo "$(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i";       \
177                 $(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i || exit 1;    \
178                 rm -f $$i.tmp;                                                  \
179         done
181         @for i in $(PREBUILT_WRAPPERS); do                                      \
182                 sed -e "s|\#installed=1|installed=1|" < $(srcdir)/$$i > $$i.tmp;                \
183                 echo "$(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i";       \
184                 $(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i || exit 1;    \
185                 rm -f $$i.tmp;                                                  \
186         done
188 uninstall-local:
189         cd $(DESTDIR)$(pkglibdir) && rm -f $(TARGETS) && rm -f $(TARGETS_MDB)
191         @for i in $(BIN_WRAPPERS); do                           \
192                 echo "rm -f $(DESTDIR)$(bindir)/$$i";           \
193                 rm -f $(DESTDIR)$(bindir)/$$i || exit 1;        \
194         done
196 EXTRA_DIST =                            \
197         $(WRAPPER_IN)                   \
198         $(CRAWL_WRAPPER_IN)             \
199         $(CRAWL_WRAPPER_CRONTAB_IN)     \
200         $(INFO_CSFILES)                 \
201         $(SHUTDOWN_CSFILES)             \
202         $(QUERY_CSFILES)                \
203         $(EXERCISE_FILE_SYSTEM_CSFILES) \
204         $(CONFIG_CSFILES)               \
205         $(SETTINGS_CSFILES)             \
206         $(SETTINGS_RESOURCES)           \
207         $(man_MANS)                     \
208         $(CRAWL_RULES)                  \
209         $(desktop_in_files)             \
210         $(desktop_DATA)                 \
211         beagle-index-info               \
212         beagle-ping                     \
213         beagle-status                   \
214         boot.inotify.init               \
215         beagle-settings.desktop.in.in
217 CLEANFILES =                            \
218         $(TARGETS)                      \
219         $(TARGETS_MDB)                  \
220         $(WRAPPERS)                     \
221         $(CRAWL_WRAPPER)                \
222         $(CRAWL_WRAPPER_CRONTAB)        \
223         $(desktop_DATA)                 \
224         $(desktop_h_files)              \
225         settings.glade.h