* Filters/FilterPackage.cs, Filters/FilterRPM.cs,
[beagle.git] / tools / Makefile.am
blobbfa015531940f5597d7138502b589e5fa13bb888
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
74 QUERY_ASSEMBLIES= -r:../beagled/BeagleDaemonLib.dll
76 $(QUERY_TARGET): $(QUERY_CSFILES) $(LOCAL_ASSEMBLIES)
77         $(CSC) -out:$@ $(CSFLAGS) $(QUERY_CSFILES) $(QUERY_ASSEMBLIES) $(ASSEMBLIES)
79 $(QUERY_WRAPPER): $(WRAPPER_IN)
80         $(WRAPPER_SED) -e "s|\@target\@|$(QUERY_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
81         chmod +x $(QUERY_WRAPPER)
83 EXERCISE_FILE_SYSTEM_TARGET = ExerciseFileSystem.exe
84 EXERCISE_FILE_SYSTEM_WRAPPER = beagle-exercise-file-system
85 EXERCISE_FILE_SYSTEM_CSFILES = $(srcdir)/ExerciseFileSystem.cs
87 $(EXERCISE_FILE_SYSTEM_TARGET): $(EXERCISE_FILE_SYSTEM_CSFILES) $(LOCAL_ASSEMBLIES)
88         $(CSC) -out:$@ $(CSFLAGS) $(EXERCISE_FILE_SYSTEM_CSFILES) $(ASSEMBLIES)
90 $(EXERCISE_FILE_SYSTEM_WRAPPER): $(WRAPPER_IN)
91         $(WRAPPER_SED) -e "s|\@target\@|$(EXERCISE_FILE_SYSTEM_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
92         chmod +x $(EXERCISE_FILE_SYSTEM_WRAPPER)
94 CONFIG_TARGET = Config.exe
95 CONFIG_WRAPPER = beagle-config
96 CONFIG_CSFILES = $(srcdir)/Config.cs
98 $(CONFIG_TARGET): $(CONFIG_CSFILES) $(LOCAL_ASSEMBLIES)
99         $(CSC) -out:$@ $(CSFLAGS) $(CONFIG_CSFILES) $(ASSEMBLIES)
101 $(CONFIG_WRAPPER): $(WRAPPER_IN)
102         $(WRAPPER_SED) -e "s|\@target\@|$(CONFIG_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
103         chmod +x $(CONFIG_WRAPPER)
105 if ENABLE_WEBSERVICES
106 SETTINGS_CSFLAGS = -define:ENABLE_WEBSERVICES
107 endif
109 SETTINGS_TARGET    = Settings.exe
110 SETTINGS_WRAPPER   = beagle-settings
111 SETTINGS_CSFILES   = $(srcdir)/Settings.cs
112 SETTINGS_RESOURCES = $(srcdir)/settings.glade
113 SETTINGS_RESOURCES_BUILD = $(foreach res,$(SETTINGS_RESOURCES), $(addprefix -resource:,$(srcdir)/$(res)),$(notdir $(res)))
114 SETTINGS_ASSEMBLIES = $(BEAGLE_UI_LIBS) -r:../Util/UiUtil.dll
116 $(SETTINGS_TARGET): $(SETTINGS_CSFILES) $(SETTINGS_RESOURCES) $(LOCAL_ASSEMBLIES)
117         $(CSC) -out:$@ $(SETTINGS_RESOURCES_BUILD) $(CSFLAGS) $(SETTINGS_CSFLAGS) $(SETTINGS_CSFILES) $(ASSEMBLIES) $(SETTINGS_ASSEMBLIES)
119 $(SETTINGS_WRAPPER): $(WRAPPER_IN)
120         $(WRAPPER_SED) -e "s|\@target\@|$(SETTINGS_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
121         chmod +x $(SETTINGS_WRAPPER)
123 TARGETS =                               \
124         $(INFO_TARGET)                  \
125         $(SHUTDOWN_TARGET)              \
126         $(QUERY_TARGET)                 \
127         $(EXERCISE_FILE_SYSTEM_TARGET)  \
128         $(CONFIG_TARGET)
130 if ENABLE_GUI
131 TARGETS += $(SETTINGS_TARGET)
132 endif
134 TARGETS_MDB = $(TARGETS:%=%.mdb)
136 WRAPPERS =                              \
137         $(INFO_WRAPPER)                 \
138         $(SHUTDOWN_WRAPPER)             \
139         $(QUERY_WRAPPER)                \
140         $(EXERCISE_FILE_SYSTEM_WRAPPER) \
141         $(CONFIG_WRAPPER)
143 if ENABLE_GUI
144 WRAPPERS += $(SETTINGS_WRAPPER)
145 endif
147 PREBUILT_WRAPPERS =             \
148         beagle-index-info       \
149         beagle-ping             \
150         beagle-status
152 BIN_WRAPPERS =                  \
153         $(WRAPPERS)             \
154         $(PREBUILT_WRAPPERS)
156 man_MANS =                      \
157         beagle-query.1          \
158         beagle-shutdown.1       \
159         beagle-status.1         \
160         beagle-config.1
162 @INTLTOOL_DESKTOP_RULE@
164 if ENABLE_GUI
165 desktop_in_files = beagle-settings.desktop.in
166 desktop_files = $(desktop_in_files:.desktop.in=.desktop)
168 desktopdir = $(datadir)/applications
169 desktop_DATA = $(desktop_files)
170 endif
172 all: $(TARGETS) $(WRAPPERS)
174 install-data-local: $(TARGETS)
175         $(mkinstalldirs) $(DESTDIR)$(bindir)
176         $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
177         $(INSTALL_DATA) $(TARGETS) $(TARGETS_MDB) $(DESTDIR)$(pkglibdir)
179         @for i in $(WRAPPERS); do                                               \
180                 sed -e "s|\#installed=1|installed=1|" < $$i > $$i.tmp;          \
181                 echo "$(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i";       \
182                 $(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i || exit 1;    \
183                 rm -f $$i.tmp;                                                  \
184         done
186         @for i in $(PREBUILT_WRAPPERS); do                                      \
187                 sed -e "s|\#installed=1|installed=1|" < $(srcdir)/$$i > $$i.tmp;                \
188                 echo "$(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i";       \
189                 $(INSTALL_SCRIPT) $$i.tmp $(DESTDIR)$(bindir)/$$i || exit 1;    \
190                 rm -f $$i.tmp;                                                  \
191         done
193 uninstall-local:
194         cd $(DESTDIR)$(pkglibdir) && rm -f $(TARGETS) && rm -f $(TARGETS_MDB)
196         @for i in $(BIN_WRAPPERS); do                           \
197                 echo "rm -f $(DESTDIR)$(bindir)/$$i";           \
198                 rm -f $(DESTDIR)$(bindir)/$$i || exit 1;        \
199         done
201 EXTRA_DIST =                            \
202         $(WRAPPER_IN)                   \
203         $(CRAWL_WRAPPER_IN)             \
204         $(CRAWL_WRAPPER_CRONTAB_IN)     \
205         $(INFO_CSFILES)                 \
206         $(SHUTDOWN_CSFILES)             \
207         $(QUERY_CSFILES)                \
208         $(EXERCISE_FILE_SYSTEM_CSFILES) \
209         $(CONFIG_CSFILES)               \
210         $(SETTINGS_CSFILES)             \
211         $(SETTINGS_RESOURCES)           \
212         $(man_MANS)                     \
213         $(CRAWL_RULES)                  \
214         $(desktop_in_files)             \
215         $(desktop_DATA)                 \
216         beagle-index-info               \
217         beagle-ping                     \
218         beagle-status                   \
219         boot.inotify.init               
221 CLEANFILES =                            \
222         $(TARGETS)                      \
223         $(TARGETS_MDB)                  \
224         $(WRAPPERS)                     \
225         $(CRAWL_WRAPPER)                \
226         $(CRAWL_WRAPPER_CRONTAB)        \
227         $(desktop_DATA)                 \
228         $(desktop_h_files)              \
229         settings.glade.h