2 DEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.o) -MT $@ \
3 $(CFLAGS) $(CPPFLAGS) $< -o $@
4 # Dependencies for host objects
5 HDEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.ho) -MT $@ \
6 $(HOSTCC_FLAGS) $(CPPFLAGS) $< -o $@
7 # Dependencies for precompiled headers
8 PCHDEPENDS = $(CC) -M -MG -MT include/includes.h.gch -MT $@ \
9 $(CFLAGS) $(CPPFLAGS) $< -o $@
11 # Run a static analysis checker
12 CHECK = $(CC_CHECKER) $(CFLAGS) $(PICFLAG) $(CPPLAGS) -c $< -o $@
14 # Run the configured compiler
15 COMPILE = $(CC) $(CFLAGS) $(PICFLAG) \
19 # Run the compiler for the build host
20 HCOMPILE = $(HOSTCC) $(HOSTCC_FLAGS) $(CPPFLAGS) -c $< -o $@
23 PCHCOMPILE = @$(CC) -Ilib/replace \
24 $(CFLAGS) $(PICFLAG) $(CPPFLAGS) -c $< -o $@
27 PARTLINK = @$(PROG_LD) -r
30 @echo "include/config.h not present"
31 @echo "You need to rerun ./autogen.sh and ./configure"
34 $(srcdir)/version.h: $(srcdir)/VERSION
35 @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
38 @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
41 @echo "Removing precompiled headers"
42 @-rm -f include/includes.h.gch
44 pch:: clean_pch include/includes.h.gch
47 @echo Removing objects
48 @-find . -name '*.o' -exec rm -f '{}' \;
49 @echo Removing hostcc objects
50 @-find . -name '*.ho' -exec rm -f '{}' \;
51 @echo Removing binaries
52 @-rm -f $(BIN_PROGS) $(SBIN_PROGS) $(BINARIES) $(TORTURE_PROGS)
53 @echo Removing libraries
54 @-rm -f $(STATIC_LIBRARIES) $(SHARED_LIBRARIES)
55 @-rm -f bin/static/*.a bin/shared/*.$(SHLIBEXT) bin/mergedobj/*.o
56 @echo Removing modules
57 @-rm -f bin/modules/*/*.$(SHLIBEXT)
58 @-rm -f bin/*_init_module.c
59 @echo Removing dummy targets
61 @echo Removing generated files
62 @-rm -f bin/*_init_module.c
64 @echo Removing proto headers
65 @-rm -f $(PROTO_HEADERS)
68 -rm -f include/config.h include/config_tmp.h include/build.h
71 -rm -f config.log config.cache
72 -rm -f config.pm config.mk
76 -rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~
78 realdistclean:: distclean removebackup
79 -rm -f include/config_tmp.h.in
87 $(srcdir)/script/find_unused_macros.pl `find . -name "*.[ch]"` | sort
89 # Create a static library
94 @$(STLD) $(STLD_FLAGS) $@ $^
96 ###############################################################################
98 ###############################################################################
100 .SUFFIXES: .x .c .et .y .l .d .o .h .h.gch .a .$(SHLIBEXT) .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml .8 .8.xml .ho .idl .hd
103 @echo "Generating dependencies for $<"
107 @echo "Generating host-compiler dependencies for $<"
110 include/includes.d: include/includes.h
111 @echo "Generating dependencies for $<"
115 @if test -n "$(CC_CHECKER)"; then \
116 echo "Checking $< with '$(CC_CHECKER)'"; \
120 @-mkdir -p `dirname $@`
121 @$(COMPILE) && exit 0 ; \
122 echo "The following command failed:" 1>&2;\
123 $(COMPILE) >/dev/null 2>&1
126 # echo "$(COMPILE)" 1>&2;\
129 @echo "Compiling $< with host compiler"
130 @-mkdir -p `dirname $@`
131 @$(HCOMPILE) && exit 0;\
132 echo "The following command failed:" 1>&2;\
133 echo "$(HCOMPILE)" 1>&2;\
134 $(HCOMPILE) >/dev/null 2>&1
137 @echo "Precompiling $<"
141 @echo "Building $< with $(YACC)"
142 @-$(srcdir)/script/yacc_compile.sh "$(YACC)" "$<" "$@"
145 @echo "Building $< with $(LEX)"
146 @-$(srcdir)/script/lex_compile.sh "$(LEX)" "$<" "$@"
148 DOCBOOK_MANPAGE_URL = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
151 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
154 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
157 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
160 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
163 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
165 dist:: idl_full manpages configure distclean
171 @echo 'Samba will be compiled with flags:'
172 @echo ' CPP = $(CPP)'
173 @echo ' CPPFLAGS = $(CPPFLAGS)'
175 @echo ' CFLAGS = $(CFLAGS)'
176 @echo ' PICFLAG = $(PICFLAG)'
177 @echo ' BNLD = $(BNLD)'
178 @echo ' BNLD_FLAGS = $(BNLD_FLAGS)'
179 @echo ' STLD = $(STLD)'
180 @echo ' STLD_FLAGS = $(STLD_FLAGS)'
181 @echo ' SHLD = $(SHLD)'
182 @echo ' SHLD_FLAGS = $(SHLD_FLAGS)'
183 @echo ' MDLD = $(MDLD)'
184 @echo ' MDLD_FLAGS = $(MDLD_FLAGS)'
185 @echo ' SHLIBEXT = $(SHLIBEXT)'
188 etags `find $(srcdir) -name "*.[ch]"`
191 ctags `find $(srcdir) -name "*.[ch]"`