Ticket #18775: Makefile

File Makefile, 11.0 KB (added by ndoc2@…, 15 years ago)

makefile for base source directory of bacula build

Line 
1#
2# Version $Id: Makefile.in 4463 2007-03-30 21:46:04Z kerns $
3#
4#
5# This file is pulled in by all the Unix Bacula Makefiles
6#   so it has all the "common" definitions
7#
8
9DATE="28 December 2008"
10LSMDATE=28Dec08
11VERSION=2.4.4
12VERNAME=bacula-$(VERSION)#
13MAINT=Kern Sibbald#
14MAINTEMAIL=<kern@sibbald.com>#
15WEBMAINT=#
16WEBMAINTEMAIL=#
17WEBPAGE=#
18FTPSITENAME=#
19FTPSITEDIR=#
20#-------------------------------------------------------------------------
21
22SHELL = /bin/sh
23
24# Installation target directories & other installation stuff
25prefix = /opt/local
26exec_prefix = /opt/local
27binprefix =
28manprefix =
29sbindir = /opt/local/sbin
30sysconfdir = /opt/local/etc/bacula
31scriptdir = /opt/local/etc/bacula
32datarootdir = /opt/local/share
33mandir = /opt/local/share/man
34manext = 8
35
36NO_ECHO = @
37
38# Tools & program stuff
39CC = /usr/bin/gcc-4.0
40CPP = /usr/bin/cpp-4.0
41CXX = /usr/bin/g++-4.0
42MV = /bin/mv
43RM = /bin/rm
44RMF = /bin/rm -f
45CP = /bin/cp
46SED = /usr/bin/sed
47AWK = /opt/local/bin/gawk
48ECHO = /bin/echo
49CMP = /usr/bin/cmp
50TBL = /usr/bin/tbl
51AR = /usr/bin/ar
52RANLIB = ranlib
53MKDIR = /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_bacula/work/bacula-2.4.4/autoconf/mkinstalldirs
54INSTALL = /usr/bin/install -c
55# add the -s to the following in PRODUCTION mode
56INSTALL_PROGRAM = /usr/bin/install -c -m 0754
57INSTALL_DATA = /usr/bin/install -c -m 644
58INSTALL_SCRIPT = /usr/bin/install -c -m 0754
59INSTALL_CONFIG = /usr/bin/install -c -m 640
60
61# Flags & libs
62CFLAGS = -O2 -I/opt/local/include
63CPPFLAGS = -I/opt/local/include -I/opt/local/ncurses -I/opt/local/include
64LDFLAGS = 
65TTOOL_LDFLAGS = 
66#DEFS = -DHAVE_CONFIG_H
67LIBS = -lpthread
68WRAPLIBS = 
69DINCLUDE = 
70DLIB = 
71DB_LIBS = 
72PYTHON_LIBS = 
73PYTHON_INC = 
74OPENSSL_LIBS = -L/opt/local/lib -lssl -lcrypto
75
76# Windows (cygwin) flags
77WCFLAGS = 
78WLDFLAGS = 
79
80# X Include directory
81#XINC =  -I/usr/X11/include @XPM_CFLAGS@
82
83# extra libraries needed by X on some systems, X library location
84#XLIB =  -L/usr/X11/lib -R/usr/X11/lib @XPM_LIBS@ -lX11
85
86# End of common section of the Makefile
87#-------------------------------------------------------------------------
88
89working_dir=/opt/local/var/bacula/working
90dir_group=
91dir_user=
92
93srcdir =        .
94
95.PATH:          .
96topdir = .
97thisdir = .
98
99
100first_rule: all
101dummy:
102
103# --client-only directories
104fd_subdirs = src scripts src/lib src/findlib src/filed \
105            \
106       src/console
107
108# Non-client-only directores
109subdirs =    src/cats src/dird src/stored src/tools
110
111all_subdirs = ${fd_subdirs} ${} manpages
112
113DIST =  INSTALL README.configure configure Makefile Makefile.in ChangeLog
114
115DIST_CFG = autoconf/aclocal.m4 autoconf/configure.in \
116        autoconf/config.h.in  autoconf/acconfig.h  autoconf/Make.common.in \
117        autoconf/install-sh autoconf/mkinstalldirs
118
119MKDIR = $(srcdir)/autoconf/mkinstalldirs
120
121#-------------------------------------------------------------------------
122
123all: Makefile
124        @for I in ${all_subdirs}; \
125          do (cd $$I; echo "==>Entering directory `pwd`"; \
126              $(MAKE) $@ || (echo ""; echo ""; echo "  ====== Error in `pwd` ======"; \
127                            echo ""; echo "";)); \
128        done
129
130depend:
131        @for I in ${all_subdirs}; \
132          do (cd $$I; echo "==>Entering directory `pwd`"; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
133       
134bacula-fd: Makefile       
135        @for I in ${fd_subdirs}; \
136          do (cd $$I; echo "==>Entering directory `pwd`"; \
137              $(MAKE) all || (echo ""; echo ""; echo "   ====== Error in `pwd` ======; \
138                            echo ""; echo "";)); \
139        done
140
141#-------------------------------------------------------------------------
142autoconf/aclocal.m4: autoconf/configure.in autoconf/bacula-macros/* autoconf/gettext-macros/*
143        cd autoconf && aclocal -I bacula-macros -I gettext-macros
144
145configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h autoconf/config.h.in
146        cd $(srcdir);
147        ${RMF} -f config.cache config.log config.out config.status src/config.h
148        ${RMF} -rf autoconf/autom4te.cache autom4te.cache
149        autoconf --prepend-include=$(srcdir)/autoconf \
150        autoconf/configure.in > configure
151        chmod 755 configure
152
153old-configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h
154        cd $(srcdir);
155        ${RMF} -f config.cache config.log config.out config.status src/config.h
156        autoconf --include=$(srcdir)/autoconf \
157        autoconf/configure.in > configure
158        chmod 755 configure
159        @rm -f config.cache
160
161config.status:
162        if test -x config.status; then config.status --recheck; \
163        else $(SHELL) configure; fi
164
165autoconf/config.h.in: autoconf/configure.in autoconf/acconfig.h
166        cd $(srcdir);
167        ${RMF} -f config.cache config.log config.out config.status src/config.h
168        autoheader --prepend-include=$(srcdir)/autoconf \
169        autoconf/configure.in > autoconf/config.h.in
170        chmod 644 autoconf/config.h.in
171
172installdirs:
173        $(MKDIR) $(DESTDIR)$(sbindir)
174        $(MKDIR) $(DESTDIR)$(sysconfdir)
175        $(MKDIR) $(DESTDIR)$(scriptdir)
176        -if test ! -d $(DESTDIR)$(working_dir) ; then \
177           $(MKDIR) $(DESTDIR)$(working_dir); \
178           chmod 770 $(DESTDIR)$(working_dir); \
179        fi
180        -if test "x$(dir_user)" != "x" ; then \
181           chown $(dir_user) $(DESTDIR)$(working_dir); \
182        fi
183        -if test "x$(dir_group)" != "x" ; then \
184           chgrp $(dir_group) $(DESTDIR)$(working_dir); \
185        fi
186
187gnomedirs:
188        $(MKDIR) $(DESTDIR)/usr/share/pixmaps
189        $(MKDIR) $(DESTDIR)/usr/share/gnome/apps/System
190        $(MKDIR) $(DESTDIR)/usr/share/applications
191        $(MKDIR) $(DESTDIR)/etc/security/console.apps
192        $(MKDIR) $(DESTDIR)/etc/pam.d
193
194install-menu: gnomedirs
195        ${INSTALL_DATA} scripts/bacula.png $(DESTDIR)/usr/share/pixmaps/bacula.png
196        ${INSTALL_DATA} scripts/bacula.desktop.gnome1 $(DESTDIR)/usr/share/gnome/apps/System/bacula.desktop
197        ${INSTALL_DATA} scripts/bacula.desktop.gnome2 $(DESTDIR)/usr/share/applications/bacula.desktop
198
199install-menu-xsu: gnomedirs
200        ${INSTALL_DATA} scripts/bacula.png $(DESTDIR)/usr/share/pixmaps/bacula.png
201        ${INSTALL_DATA} scripts/bacula.desktop.gnome1.xsu $(DESTDIR)/usr/share/gnome/apps/System/bacula.desktop
202        ${INSTALL_DATA} scripts/bacula.desktop.gnome2.xsu $(DESTDIR)/usr/share/applications/bacula.desktop
203
204install-menu-consolehelper: gnomedirs
205        ${INSTALL_DATA} scripts/bacula.png $(DESTDIR)/usr/share/pixmaps/bacula.png
206        ${INSTALL_DATA} scripts/bacula.desktop.gnome1.consolehelper $(DESTDIR)/usr/share/gnome/apps/System/bacula.desktop
207        ${INSTALL_DATA} scripts/bacula.desktop.gnome2.consolehelper $(DESTDIR)/usr/share/applications/bacula.desktop
208        ${INSTALL_DATA} scripts/gnome-console.console_apps $(DESTDIR)/etc/security/console.apps/gnome-console
209        ${INSTALL_DATA} scripts/gnome-console.pamd $(DESTDIR)/etc/pam.d/gnome-console
210        ln -s $(DESTDIR)/usr/bin/consolehelper $(DESTDIR)/usr/bin/gnome-console
211
212install: installdirs
213        @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
214
215uninstall:
216        @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
217
218install-autostart:
219        (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
220
221install-autostart-dir:
222        (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
223
224install-autostart-fd:
225        (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
226
227install-autostart-sd:
228        (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) 
229
230uninstall-autostart:
231        (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
232
233uninstall-autostart-dir:
234        (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
235
236uninstall-autostart-fd:
237        (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
238
239uninstall-autostart-sd:
240        (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
241
242uninstall-menu:
243        rm -f $(DESTDIR)/usr/share/pixmaps/bacula.png
244        rm -f $(DESTDIR)/usr/share/gnome/apps/System/bacula.desktop
245        rm -f $(DESTDIR)/usr/share/applications/bacula.desktop
246
247uninstall-menu-consolehelper:
248        rm -f $(DESTDIR)/usr/share/pixmaps/bacula.png
249        rm -f $(DESTDIR)/usr/share/gnome/apps/System/bacula.desktop
250        rm -f $(DESTDIR)/usr/share/applications/bacula.desktop
251        rm -f $(DESTDIR)/etc/security/console.apps/gnome-console
252        rm -f $(DESTDIR)/etc/pam.d/gnome-console
253        rm -f $(DESTDIR)/usr/bin/gnome-console
254
255
256Makefile: Makefile.in
257        cd $(topdir) \
258            && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
259
260Makefiles:
261        $(SHELL) config.status
262        (cd scripts; \
263         chmod 755 startmysql stopmysql bacula startit stopit btraceback; \
264         chmod 755 mtx-changer bconsole gconsole devel_bacula; \
265         chmod 755 dvd-handler)
266
267        (cd src/cats; \
268         chmod 755 create_bacula_database      update_bacula_tables     make_bacula_tables; \
269         chmod 755 grant_bacula_privileges     drop_bacula_tables       drop_bacula_database; \
270         chmod 755 create_none_database   update_none_tables    make_none_tables; \
271         chmod 755 grant_none_privileges  drop_none_tables      drop_none_database; \
272         chmod 755 make_catalog_backup delete_catalog_backup)
273
274clean:
275        @for I in ${all_subdirs} src/win32; \
276          do (cd $$I; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1); done
277        @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
278        @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
279        @$(RMF) examples/1 examples/2 examples/devices/1 examples/devices/2
280        @$(RMF) -r autom4te.cache
281        @find . -name ".#*" -exec $(RMF) {} \;
282
283
284# clean for distribution
285distclean:
286        @for I in $(all_subdirs); do (cd $$I && $(MAKE) $@ || exit 1); done
287        @for I in $(all_subdirs); do (cd $$I && $(RMF) startit stopit btraceback); done
288        @(cd $(srcdir) && $(RMF) *~ config.cache config.h config.log config.status config.out)
289        @(cd $(srcdir) && $(RMF) Makefile autoconf/Make.common)
290        @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
291        @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback
292        @$(RMF) bconsole gconsole
293        @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
294        @$(RMF) working/* kerns-*
295        @$(RMF) -rf txt diff src/python src/testprogs
296
297devclean:
298        @for I in $(all_subdirs); do (cd $$I && $(MAKE) $@ || exit 1); done
299        @for I in $(all_subdirs); do (cd $$I && $(RMF) startit stopit btraceback); done
300        @(cd $(srcdir) && $(RMF) *~ config.cache config.h config.log config.status config.out)
301        @(cd $(srcdir) && $(RMF) Makefile autoconf/Make.common)
302        @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
303        @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback
304        @$(RMF) bconsole gconsole
305        @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
306        @$(RMF) working/*
307
308distdirs:
309        mkdir ../$(VERNAME);
310        mkdir ../$(VERNAME)/autoconf;
311        @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || (echo "Failed to make distclean in $$I"; exit 0) ); done
312
313distcopy:
314        $(CP) -p $(DIST) ../$(VERNAME);
315        $(CP) -p $(DIST_CFG) ../$(VERNAME)/autoconf;
316        @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
317
318distrib: configure autoconf/config.h.in distdirs distcopy
319
320test:
321
322
323tar.gz:  ../$(VERNAME).tar.gz
324../$(VERNAME).tar.gz:
325        (cd ..; tar cvf - $(VERNAME) | gzip -f9 > $(VERNAME).tar.gz)
326
327tar.Z: ../$(VERNAME).tar.Z
328../$(VERNAME).tar.Z:
329        (cd ..; tar cvf - $(VERNAME) | compress > $(VERNAME).tar.Z)
330
331tar.bz2: ../$(VERNAME).tar.bz2
332../$(VERNAME).tar.bz2:
333        (cd ..; tar cvf - $(VERNAME) | bzip2 -f9 > $(VERNAME).tar.bz2)
334
335uuencode: tar.gz
336        uuencode ../$(VERNAME).tar.gz $(VERNAME).tar.gz > ../$(VERNAME).tgz.uu
337
338# ------------------------------------------------------------------------