blob: e9f4786d34ccb2cb83a79fda7dbc03669a57b012 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
# Rules file for Samba 4
# This relies on GNU make.
#
# Dependencies command
DEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.o) -MT $@ -MT : \
$(CFLAGS) $(CPPFLAGS) $< -o $@
# Dependencies for host objects
HDEPENDS = $(CC) -M -MG -MP -MT $(<:.c=.ho) -MT $@ -MT : \
$(HOSTCC_FLAGS) $(CPPFLAGS) $< -o $@
# Dependencies for precompiled headers
PCHDEPENDS = $(CC) -M -MG -MT include/includes.h.gch -MT $@ \
$(CFLAGS) $(CPPFLAGS) $< -o $@
# Run a static analysis checker
CHECK = $(CC_CHECKER) $(CFLAGS) $(PICFLAG) $(CPPLAGS) -c $< -o $@
# Run the configured compiler
COMPILE = $(CC) $(CFLAGS) $(PICFLAG) \
$(CPPFLAGS) \
-c $< -o $@
# Run the compiler for the build host
HCOMPILE = $(HOSTCC) $(HOSTCC_FLAGS) $(CPPFLAGS) -c $< -o $@
# Precompile headers
PCHCOMPILE = @$(CC) -Ilib/replace \
$(CFLAGS) $(PICFLAG) $(CPPFLAGS) -c $< -o $@
# Partial linking
PARTLINK = @$(PROG_LD) -r
make_utility_dir = $(srcdir)/build/make/
include/config.h:
@echo "include/config.h not present"
@echo "You need to rerun ./autogen.sh and ./configure"
@/bin/false
pch::
clean:: clean_pch
@echo Removing objects
@-find . -name '*.o' -exec rm -f '{}' \;
@echo Removing hostcc objects
@-find . -name '*.ho' -exec rm -f '{}' \;
@echo Removing libraries
@-rm -f $(STATIC_LIBS) $(SHARED_LIBS)
@-rm -f bin/static/*.a $(shliboutputdir)/*.$(SHLIBEXT) bin/mergedobj/*.o
@echo Removing modules
@-rm -f bin/modules/*/*.$(SHLIBEXT)
@-rm -f bin/*_init_module.c
@echo Removing dummy targets
@-rm -f bin/.*_*
@echo Removing generated files
@-rm -f bin/*_init_module.c
@-rm -rf librpc/gen_*
distclean:: clean
-rm -f include/config.h include/config_tmp.h include/build.h
-rm -f data.mk
-rm -f config.status
-rm -f config.log config.cache
-rm -f config.pm config.mk
-rm -f $(PC_FILES)
removebackup::
-rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~
realdistclean:: distclean removebackup
-rm -f include/config_tmp.h.in
-rm -f version.h
-rm -f configure
-rm -f $(MANPAGES)
check:: test
unused_macros:
$(srcdir)/script/find_unused_macros.pl `find . -name "*.[ch]"` | sort
# Create a static library
%.a:
@echo Linking $@
@rm -f $@
@mkdir -p $(@D)
@$(STLD) $(STLD_FLAGS) $@ $^
include $(make_utility_dir)/templates.mk
###############################################################################
# File types
###############################################################################
.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
.c.d:
@echo "Generating dependencies for $<"
@$(DEPENDS)
.c.hd:
@echo "Generating host-compiler dependencies for $<"
@$(HDEPENDS)
include/includes.d: include/includes.h
@echo "Generating dependencies for $<"
@$(PCHDEPENDS)
.c.o:
@if test -n "$(CC_CHECKER)"; then \
echo "Checking $< with '$(CC_CHECKER)'"; \
$(CHECK) ; \
fi
@echo "Compiling $<"
@-mkdir -p `dirname $@`
@$(COMPILE) && exit 0 ; \
echo "The following command failed:" 1>&2;\
echo "$(subst ",\",$(COMPILE))" 1>&2 && exit 1
.c.ho:
@echo "Compiling $< with host compiler"
@-mkdir -p `dirname $@`
@$(HCOMPILE) && exit 0;\
echo "The following command failed:" 1>&2;\
echo "$(subst ",\",$(HCOMPILE))" 1>&2;\
$(HCOMPILE) >/dev/null 2>&1
.h.h.gch:
@echo "Precompiling $<"
@$(PCHCOMPILE)
.y.c:
@echo "Building $< with $(YACC)"
@-$(make_utility_dir)/yacc_compile.sh "$(YACC)" "$<" "$@"
.l.c:
@echo "Building $< with $(LEX)"
@-$(make_utility_dir)/lex_compile.sh "$(LEX)" "$<" "$@"
%.a:
@echo Linking $@
@rm -f $@
@mkdir -p $(@D)
@$(STLD) $(STLD_FLAGS) $@ $^
DOCBOOK_MANPAGE_URL = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
.1.xml.1:
$(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
.3.xml.3:
$(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
.5.xml.5:
$(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
.7.xml.7:
$(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
.8.xml.8:
$(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
dist:: idl_full manpages configure distclean
configure:
./autogen.sh
showflags::
@echo 'Samba will be compiled with flags:'
@echo ' CPP = $(CPP)'
@echo ' CPPFLAGS = $(CPPFLAGS)'
@echo ' CC = $(CC)'
@echo ' CFLAGS = $(CFLAGS)'
@echo ' PICFLAG = $(PICFLAG)'
@echo ' BNLD = $(BNLD)'
@echo ' BNLD_FLAGS = $(BNLD_FLAGS)'
@echo ' STLD = $(STLD)'
@echo ' STLD_FLAGS = $(STLD_FLAGS)'
@echo ' SHLD = $(SHLD)'
@echo ' SHLD_FLAGS = $(SHLD_FLAGS)'
@echo ' MDLD = $(MDLD)'
@echo ' MDLD_FLAGS = $(MDLD_FLAGS)'
@echo ' SHLIBEXT = $(SHLIBEXT)'
base_srcdirs = $(srcdir) ../librpc/ ../lib/ ../libcli
etags:
etags $(ETAGS_OPTIONS) `find $(base_srcdirs) -name "*.[ch]"`
ctags:
ctags $(CTAGS_OPTIONS) `find $(base_srcdirs) -name "*.[ch]"`
|