1#
2# Copyright (C) 2000-2015 Kern Sibbald
3# License: BSD 2-Clause; see file LICENSE-FOSS
4#
5#
6@MCOMMON@
7
8srcdir =	.
9VPATH = 	.
10.PATH:		.
11
12# one up
13basedir = ../../../src
14# top dir
15topdir = ../../..
16# this dir relative to top dir
17thisdir = ../examples/nagios/check_bacula
18
19DEBUG=@DEBUG@
20
21first_rule: all
22dummy:
23
24#
25CHECKSRCS = check_bacula.c authenticate.c
26CHECKOBJS = check_bacula.o authenticate.o
27
28# these are the objects that are changed by the .configure process
29EXTRAOBJS = @OBJLIST@
30
31CHECK_CPPFLAGS=
32CHECK_LDFLAGS=
33
34.SUFFIXES:	.c .o
35.PHONY:
36.DONTCARE:
37
38# inference rules
39.c.o:
40	@echo "Compiling $<"
41	$(NO_ECHO) $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CHECK_CPPFLAGS) \
42 -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
43#-------------------------------------------------------------------------
44all: Makefile check_bacula
45	@echo "==== Make of check_bacula is good ===="
46	@echo " "
47
48check_bacula: Makefile $(CHECKOBJS) $(basedir)/lib/libbac$(DEFAULT_ARCHIVE_TYPE)
49	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) $(CHECK_LDFLAGS) -L$(basedir)/lib -o $@ \
50	  $(CHECKOBJS) $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
51
52
53Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
54	cd $(topdir) \
55	  && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
56
57libtool-clean:
58	$(RMF) -r .libs _libs
59
60clean:
61	@$(RMF) check_bacula core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
62
63realclean: clean
64	@$(RMF) tags
65
66distclean: realclean
67	if test $(srcdir) = .; then $(MAKE) realclean; fi
68	(cd $(srcdir); $(RMF) Makefile)
69
70devclean: realclean
71	if test $(srcdir) = .; then $(MAKE) realclean; fi
72	(cd $(srcdir); $(RMF) Makefile)
73
74install: all
75	$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) check_bacula $(DESTDIR)$(sbindir)/check_bacula
76
77uninstall:
78	(cd $(DESTDIR)$(sbindir); $(RMF) check_bacula)
79
80
81
82# Semi-automatic generation of dependencies:
83# Use gcc -MM because X11 `makedepend' doesn't work on all systems
84# and it also includes system headers.
85# `semi'-automatic since dependencies are generated at distribution time.
86
87depend:
88	@$(MV) Makefile Makefile.bak
89	@$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
90	@$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
91	@$(CXX) -S -M $(CPPFLAGS) $(CHECK_CPPFLAGS) -I$(srcdir) -I$(basedir) *.c >> Makefile
92	@if test -f Makefile ; then \
93	    $(RMF) Makefile.bak; \
94	else \
95	   $(MV) Makefile.bak Makefile; \
96	   echo -e "Something went wrong\n\a"; \
97	fi
98
99# -----------------------------------------------------------------------
100# DO NOT DELETE: nice dependency list follows
101