summaryrefslogtreecommitdiff
path: root/source4/Makefile.in
blob: aa099a9945c80bf42e109dd31ed14983bd44a7ef (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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
#########################################################################
# Makefile.in for Samba - rewritten for autoconf support
# Copyright Andrew Tridgell 1992-2003
# Copyright (C) 2001 by Martin Pool <mbp@samba.org>
# Copyright (C) 2002 Andrew Bartlett <abartlet@samba.org>
# Copyright (C) 2003 Anthony Liguori <aliguor@us.ibm.com>
# Copyright (C) 2003 James Myers <myersjj@samba.org>
# Copyright (C) 2002-2003 Jelmer Vernooij <jelmer@samba.org>
# Copyright (C) 2004 Stefan Metzmacher <metze@samba.org>
###########################################################################

prefix=@prefix@
exec_prefix=@exec_prefix@

LIBS=@LIBS@ @LDAP_LIBS@ @KRB5_LIBS@
CC=@CC@
SHLD=@SHLD@
CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@
LDSHFLAGS=@LDSHFLAGS@ @LDFLAGS@ @CFLAGS@
PERL=@PERL@
DYNEXP=@DYNEXP@

TERMLDFLAGS=@TERMLDFLAGS@
TERMLIBS=@TERMLIBS@

VPATH=@srcdir@
srcdir=@srcdir@
builddir=@builddir@
SHELL=/bin/sh

BASEDIR= @prefix@
BINDIR = @bindir@
SBINDIR = @sbindir@
LIBDIR = @libdir@
CONFIGDIR = @configdir@
VARDIR = @localstatedir@

# The permissions to give the executables
INSTALLPERMS = 0755

# set these to where to find various files
# These can be overridden by command line switches (see smbd(8))
# or in smb.conf (see smb.conf(5))
LOGFILEBASE = @logfilebase@
CONFIGFILE = $(CONFIGDIR)/smb.conf
LMHOSTSFILE = $(CONFIGDIR)/lmhosts

# This is where smbpasswd et al go
PRIVATEDIR = @privatedir@
SMB_PASSWD_FILE = $(PRIVATEDIR)/smbpasswd

# the directory where lock files go
LOCKDIR = @lockdir@

# the directory where pid files go
PIDDIR = @piddir@

FLAGS = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I. $(CPPFLAGS) -I$(srcdir)
FLAGS32 =

PASSWD_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATEDIR)\"
PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\"  -DSBINDIR=\"$(SBINDIR)\"
PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\" 
PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" 
PATH_FLAGS4 = $(PATH_FLAGS3) -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\"
PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" \
	      -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\"
PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\"
PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS)

# Note that all executable programs now provide for an optional executable suffix.

SBIN_PROGS = bin/smbd@EXEEXT@

BIN_PROGS = bin/smbclient@EXEEXT@ 

TORTURE_PROGS = bin/smbtorture@EXEEXT@ \
		bin/gentest@EXEEXT@ \
		bin/locktest@EXEEXT@ \
		bin/masktest@EXEEXT@ \
		bin/ndrdump@EXEEXT@

CHARSET_MODULES = @CHARSET_MODULES@
CHARSET_LIBDIR = $(LIBDIR)/charset
DCERPC_MODULES = @DCERPC_MODULES@
DCERPC_LIBDIR = $(LIBDIR)/dcerpc
NTVFS_MODULES = @NTVFS_MODULES@
NTVFS_LIBDIR = $(LIBDIR)/ntvfs

MODULES = $(CHARSET_MODULES) $(DCERPC_MODULES) $(NTVFS_MODULES)

######################################################################
# object file lists
######################################################################

TDBBASE_OBJ = tdb/tdb.o tdb/spinlock.o
TDB_OBJ = $(TDBBASE_OBJ) tdb/tdbutil.o 

CHARSET_OBJS = @CHARSET_OBJS@

LIB_OBJ = lib/version.o lib/debug.o lib/fault.o \
          lib/getsmbpass.o lib/interface.o lib/md4.o \
          lib/interfaces.o lib/pidfile.o lib/replace.o \
          lib/signal.o lib/system.o lib/sendfile.o lib/time.o \
	  lib/genrand.o lib/username.o \
	  lib/util_getent.o lib/util_pw.o lib/smbrun.o \
	  lib/bitmap.o lib/crc32.o lib/snprintf.o lib/dprintf.o \
	  lib/xfile.o lib/wins_srv.o \
	  lib/util_str.o lib/util_sid.o lib/util_uuid.o \
	  lib/util_unistr.o lib/util_file.o lib/data_blob.o \
	  lib/util.o lib/util_sock.o \
	  lib/talloc.o lib/substitute.o lib/fsusage.o \
	  lib/ms_fnmatch.o lib/select.o lib/messages.o \
	  lib/tallocmsg.o lib/dmallocmsg.o \
	  lib/md5.o lib/hmacmd5.o lib/smbpasswd.o \
	  nsswitch/wb_client.o nsswitch/wb_common.o \
	  lib/pam_errors.o intl/lang_tdb.o lib/account_pol.o \
	  lib/gencache.o $(TDB_OBJ) \
	  lib/module.o \
	  lib/ldap_escape.o lib/events.o lib/mutex.o $(CHARSET_OBJS)

READLINE_OBJ = lib/readline.o

POPT_LIB_OBJ = lib/popt_common.o 

PARAM_OBJ = param/loadparm.o param/params.o dynconfig.o

SECRETS_OBJ = passdb/secrets.o

LIBNMB_OBJ =	libcli/unexpected.o libcli/namecache.o libcli/nmblib.o \
		libcli/namequery.o 

LIBCLIUTIL_OBJ = libcli/util/asn1.o \
		libcli/util/smberr.o \
		libcli/util/doserr.o libcli/util/errormap.o \
		libcli/util/pwd_cache.o libcli/util/clierror.o libcli/util/cliutil.o \
		libcli/util/nterr.o libcli/util/smbdes.o libcli/util/smbencrypt.o

LIBRAW_NDR_OBJ = librpc/ndr/ndr.o librpc/ndr/ndr_basic.o librpc/ndr/ndr_sec.o \
		librpc/ndr/ndr_spoolss_buf.o \
		librpc/gen_ndr/tables.o librpc/gen_ndr/ndr_dcerpc.o \
		librpc/gen_ndr/ndr_echo.o librpc/gen_ndr/ndr_misc.o \
		librpc/gen_ndr/ndr_lsa.o librpc/gen_ndr/ndr_dfs.o \
		librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_spoolss.o \
		librpc/gen_ndr/ndr_wkssvc.o librpc/gen_ndr/ndr_srvsvc.o \
		librpc/gen_ndr/ndr_atsvc.o librpc/gen_ndr/ndr_eventlog.o \
		librpc/gen_ndr/ndr_epmapper.o librpc/gen_ndr/ndr_winreg.o \
		librpc/gen_ndr/ndr_mgmt.o librpc/gen_ndr/ndr_protected_storage.o \
		librpc/gen_ndr/ndr_dcom.o librpc/gen_ndr/ndr_wzcsvc.o \
		librpc/gen_ndr/ndr_browser.o librpc/gen_ndr/ndr_w32time.o \
		librpc/gen_ndr/ndr_scerpc.o librpc/gen_ndr/ndr_ntsvcs.o \
		librpc/gen_ndr/ndr_netlogon.o librpc/gen_ndr/ndr_trkwks.o \
		librpc/gen_ndr/ndr_keysvc.o

LIBRAW_RPC_OBJ = librpc/rpc/dcerpc.o librpc/rpc/dcerpc_auth.o \
		librpc/rpc/dcerpc_util.o \
		librpc/rpc/dcerpc_schannel.o librpc/rpc/dcerpc_ntlm.o \
		librpc/rpc/dcerpc_smb.o librpc/rpc/dcerpc_tcp.o

LIBNTLMSSP_OBJ = libcli/auth/ntlmssp.o libcli/auth/ntlmssp_parse.o \
		libcli/auth/ntlmssp_sign.o libcli/auth/schannel.o

LIBCLIAUTH_OBJ = $(LIBNTLMSSP_OBJ) libcli/auth/credentials.o

LIBRAW_OBJ = libcli/raw/rawfile.o libcli/raw/smb_signing.o  \
	     libcli/raw/clisocket.o libcli/raw/clitransport.o \
	     libcli/raw/clisession.o libcli/raw/clitree.o \
	     libcli/raw/clikrb5.o libcli/raw/clispnego.o libcli/raw/rawrequest.o \
	     libcli/raw/rawreadwrite.o \
	     libcli/raw/rawsearch.o libcli/raw/rawsetfileinfo.o libcli/raw/raweas.o \
	     libcli/raw/rawtrans.o libcli/raw/clioplock.o \
	     libcli/raw/rawnegotiate.o libcli/raw/rawfsinfo.o \
	     libcli/raw/rawfileinfo.o libcli/raw/rawnotify.o \
	     libcli/raw/rawioctl.o libcli/raw/rawacl.o \
	     $(LIBRAW_NDR_OBJ) $(LIBRAW_RPC_OBJ) $(LIBCLIUTIL_OBJ) \
	     $(LIBNMB_OBJ) $(LIBCLIAUTH_OBJ) 

LIBSMB_OBJ = libcli/clireadwrite.o libcli/cliconnect.o \
	     libcli/clifile.o libcli/clilist.o libcli/clitrans2.o  \
	     libcli/climessage.o \
	     libcli/clideltree.o \
	     $(LIBRAW_OBJ)

SMBD_OBJ_MAIN = smbd/server.o

SMB_OBJS = @SMB_OBJS@
SMB_LIBS = @SMB_LIBS@

AUTH_OBJS = @AUTH_OBJS@
AUTH_LIBS = @AUTH_LIBS@

PASSDB_OBJS = @PASSDB_OBJS@
PASSDB_LIBS = @PASSDB_LIBS@

NTVFS_OBJS = @NTVFS_OBJS@
NTVFS_LIBS = @NTVFS_LIBS@

DCERPC_OBJS = @DCERPC_OBJS@
DCERPC_LIBS = @DCERPC_LIBS@

SMBD_OBJ_SRV =	smbd/process.o \
		lib/server_mutex.o \
		smbd/build_options.o \
		smbd/rewrite.o \
		$(DCERPC_OBJS) $(SMB_OBJS) $(AUTH_OBJS) $(PASSDB_OBJS) $(NTVFS_OBJS) @SMBD_EXTRA_OBJS@

PROCESS_MODEL_OBJS = @PROCESS_MODEL_OBJS@
PROCESS_MODEL_LIBS = @PROCESS_MODEL_LIBS@

SMBD_OBJ_BASE = $(PROCESS_MODEL_OBJS) $(SMBD_OBJ_SRV) \
		$(PARAM_OBJ) $(SECRETS_OBJ)  \
		$(LIB_OBJ) $(POPT_LIB_OBJ) $(LIBSMB_OBJ)

SMBD_OBJS = $(SMBD_OBJ_MAIN) $(SMBD_OBJ_BASE) @BUILD_POPT@
SMBD_LIBS = $(LIBS) $(SMB_LIBS) $(PROCESS_MODEL_LIBS) $(DCERPC_LIBS) $(AUTH_LIBS) $(PASSDB_LIBS) $(NTVFS_LIBS)

CLIENT_OBJ1 = client/client.o client/clitar.o libcli/raw/clirewrite.o

CLIENT_OBJ = $(CLIENT_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(SECRETS_OBJ) \
	     $(LIB_OBJ) \
             $(READLINE_OBJ) $(POPT_LIB_OBJ)

TORTURE_RAW_OBJS = @TORTURE_RAW_OBJS@

TORTURE_RPC_OBJS = @TORTURE_RPC_OBJS@

TORTURE_OBJS = @TORTURE_OBJS@

SMBTORTURE_OBJS = $(TORTURE_OBJS) $(SECRETS_OBJ) $(LIBSMB_OBJ) $(PARAM_OBJ) $(LIB_OBJ)
SMBTORTURE_LIBS = $(LIBS)

GENTEST_OBJ = torture/gentest.o torture/torture_util.o $(LIBSMB_OBJ) $(PARAM_OBJ) \
		$(LIB_OBJ) $(SECRETS_OBJ) libcli/raw/clirewrite.o

MASKTEST_OBJ = torture/masktest.o $(LIBSMB_OBJ) $(PARAM_OBJ) \
		$(LIB_OBJ) $(SECRETS_OBJ) libcli/raw/clirewrite.o

LOCKTEST_OBJ = torture/locktest.o $(LIBSMB_OBJ) $(PARAM_OBJ) \
		$(LIB_OBJ) $(SECRETS_OBJ) libcli/raw/clirewrite.o

NDRDUMP_OBJ = utils/ndrdump.o utils/rewrite.o \
		$(LIBSMB_OBJ) $(PARAM_OBJ) $(LIB_OBJ) $(SECRETS_OBJ)

PROTO_OBJ = $(SMBD_OBJ_SRV) \
	    $(SMBD_OBJ_MAIN) $(PROCESS_MODEL_OBJS) \
	    $(LIBSMB_OBJ) \
	    $(TORTURE_OBJS) \
	    $(PARAM_OBJ) $(SECRETS_OBJ) \
	    $(READLINE_OBJ) $(CLIENT_OBJ1) \
	    $(LIB_OBJ) $(POPT_LIB_OBJ)

POPT_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
          popt/popthelp.o popt/poptparse.o

######################################################################
# now the rules...
######################################################################
all: SHOWFLAGS $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) $(MODULES)

torture : SHOWFLAGS $(TORTURE_PROGS)

smbtorture : SHOWFLAGS bin/smbtorture@EXEEXT@

gentest: SHOWFLAGS bin/gentest@EXEEXT@

masktest : SHOWFLAGS bin/masktest@EXEEXT@

locktest : SHOWFLAGS bin/locktest@EXEEXT@

modules: SHOWFLAGS proto_exists $(MODULES)

everything: all

.SUFFIXES:
.SUFFIXES: .c .o .po .po32 .lo

SHOWFLAGS: basics
	@echo "Using FLAGS = $(FLAGS)"
	@echo "      FLAGS32 = $(FLAGS32)"
	@echo "      LIBS = $(LIBS)"
	@echo "      LDSHFLAGS = $(LDSHFLAGS)"
	@echo "      LDFLAGS = $(LDFLAGS)"

MAKEDIR = || exec false; \
	  if test -d "$$dir"; then :; else \
	  echo mkdir "$$dir"; \
	  mkdir -p "$$dir" >/dev/null 2>&1 || \
	  test -d "$$dir" || \
	  mkdir "$$dir" || \
	  exec false; fi || exec false

.c.o:
	@echo Compiling $*.c
	@$(CC) -I. -I$(srcdir) $(FLAGS) -c $< \
	  -o $@ 
@BROKEN_CC@	-mv `echo $@ | sed 's%^.*/%%g'` $@

# 'make pch' is extremely useful for fast compiles if you have gcc-3.4
pch: basics
	rm -f $(srcdir)/include/includes.h.gch
	$(CC) -I. -I$(srcdir) $(FLAGS) -c $(srcdir)/include/includes.h -o $(srcdir)/include/includes.h.gch


idl_full: build/pidl/idl.pm
	CPP="@CPP@" script/build_idl.sh FULL

idl: build/pidl/idl.pm
	@CPP="@CPP@" script/build_idl.sh

basics: idl proto_test

build/pidl/idl.pm: build/pidl/idl.yp
	-yapp -s build/pidl/idl.yp

# These dependencies are only approximately correct: we want to make
# sure Samba's paths are updated if ./configure is re-run.  Really it
# would be nice if "make prefix=/opt/samba all" also rebuilt things,
# but since we also require "make install prefix=/opt/samba" *not* to
# rebuild it's a bit hard.

dynconfig.o: dynconfig.c Makefile
	@echo Compiling $*.c
	@$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@ 

dynconfig.po: dynconfig.c Makefile
	@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
	  dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
	@echo Compiling $*.c with @PICFLAG@
	@$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAG@ -c $< -o $*.@PICSUFFIX@
@BROKEN_CC@	-mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.po$$%.o%'` $@
@POBAD_CC@	@mv $*.po.o $@

lib/version.o: lib/version.c include/version.h
	@echo Compiling $*.c
	@$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) -c $< -o $@ 

lib/version.po: lib/version.c include/version.h
	@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
	  dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
	@echo Compiling $*.c with @PICFLAG@
	@$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAG@ -c $< -o $*.@PICSUFFIX@
@BROKEN_CC@	-mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.po$$%.o%'` $@
@POBAD_CC@	@mv $*.po.o $@

.c.po: 
	@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
	  dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
	@echo Compiling $*.c with @PICFLAG@
	@$(CC) -I. -I$(srcdir) $(FLAGS) @PICFLAG@ -c $< -o $*.@PICSUFFIX@
@BROKEN_CC@	-mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.po$$%.o%'` $@
@POBAD_CC@	@mv $*.po.o $@

# this is for IRIX
.c.po32: 
	@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
	  dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
	@echo Compiling $*.c with @PICFLAG@ and -32
	@$(CC) -32 -I. -I$(srcdir) $(FLAGS32) $(PATH_FLAGS) @PICFLAG@ -c $< \
	  -o $*.po32.o 
@BROKEN_CC@	-mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.po32$$%.o%'` $@.o
	@mv $*.po32.o $@

bin/.dummy:
	@if (: >> $@ || : > $@) >/dev/null 2>&1; then :; else \
	  dir=bin $(MAKEDIR); fi
	@: >> $@ || : > $@ # what a fancy emoticon!

bin/smbd@EXEEXT@: $(SMBD_OBJS) bin/.dummy
	@echo Linking $@
	@$(CC) $(FLAGS) -o $@ $(SMBD_OBJS) $(LDFLAGS) $(DYNEXP) $(SMBD_LIBS)

bin/smbclient@EXEEXT@: $(CLIENT_OBJ) @BUILD_POPT@ bin/.dummy
	@echo Linking $@
	@$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @BUILD_POPT@

bin/smbtorture@EXEEXT@: $(SMBTORTURE_OBJS) bin/.dummy
	@echo Linking $@
	@$(CC) $(FLAGS) -o $@ $(SMBTORTURE_OBJS) $(LDFLAGS) $(SMBTORTURE_LIBS)

bin/ndrdump@EXEEXT@: $(NDRDUMP_OBJ) bin/.dummy
	@echo Linking $@
	@$(CC) $(FLAGS) -o $@ $(NDRDUMP_OBJ) $(LDFLAGS) $(LIBS)

bin/gentest@EXEEXT@: $(GENTEST_OBJ) bin/.dummy
	@echo Linking $@
	@$(CC) $(FLAGS) -o $@ $(GENTEST_OBJ) $(LDFLAGS) $(LIBS)

bin/masktest@EXEEXT@: $(MASKTEST_OBJ) bin/.dummy
	@echo Linking $@
	@$(CC) $(FLAGS) -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(LIBS)

bin/locktest@EXEEXT@: $(LOCKTEST_OBJ) bin/.dummy
	@echo Linking $@
	@$(CC) $(FLAGS) -o $@ $(LOCKTEST_OBJ) $(LDFLAGS) $(LIBS)

install: installbin installtorture installdat 

# DESTDIR is used here to prevent packagers wasting their time
# duplicating the Makefile. Remove it and you will have the privelege
# of package each samba release for muliple versions of multiple
# distributions and operating systems, or at least supplying patches
# to all the packaging files required for this, prior to committing
# the removal of DESTDIR. Do not remove it even though you think it
# is not used

installdirs:
	@$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) $(DESTDIR)$(LOCKDIR)
	@$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSET_LIBDIR) $(DESTDIR)$(DCERPC_LIBDIR) $(DESTDIR)$(NTVFS_LIBDIR)

installservers: all installdirs
	@$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)

installbin: all installdirs
	@$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)
	@$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(BIN_PROGS)

installtorture: all installdirs
	@$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(TORTURE_PROGS)

installmodules: all installdirs
	@$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(NTVFS_LIBDIR) $(NTVFS_MODULES)
	@$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(DCERPC_LIBDIR) $(DCERPC_MODULES)
	@$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSET_LIBDIR) $(CHARSET_MODULES)

installdat: installdirs
	@$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)

# revert to the previously installed version
revert:
	@$(SHELL) $(srcdir)/script/revert.sh $(SBINDIR) $(SBIN_PROGS)

.PHONY: showlayout

showlayout: 
	@echo "Samba will be installed into:"
	@echo "  basedir: $(BASEDIR)"
	@echo "  bindir:  $(BINDIR)"
	@echo "  sbindir: $(SBINDIR)"
	@echo "  libdir:  $(LIBDIR)"
	@echo "  vardir:  $(VARDIR)"

uninstall: uninstallbin uninstalltorture

uninstallbin:
	@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
	@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)

uninstalltorture:
	@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(TORTURE_PROGS)

uninstallmodules:
	@$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(NTVFS_LIBDIR) $(DESTDIR)$(NTVFS_MODULES)
	@$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(DCERPC_LIBDIR) $(DESTDIR)$(DCERPC_MODULES)
	@$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSET_LIBDIR) $(DESTDIR)$(CHARSET_MODULES)

# Toplevel clean files
TOPFILES=dynconfig.o dynconfig.po

clean: delheaders
	-rm -f core */*~ *~ */*.o */*/*.o */*/*.po */*/*.po32 */*.po */*.po32 */*.@SHLIBEXT@ \
		$(TOPFILES) $(BIN_PROGS) $(SBIN_PROGS) $(MODULES) $(TORTURE_PROGS) \
		.headers.stamp 
	-rm -rf librpc/gen_*

# Making this target will just make sure that the prototype files
# exist, not necessarily that they are up to date.  Since they're
# removed by "make clean" this will always be run when you do anything
# afterwards.
proto_exists: include/proto.h include/build_env.h

delheaders:
	@/bin/rm -f $(srcdir)/include/proto.h $(srcdir)/include/build_env.h 

include/proto.h:
	@cd $(srcdir) && $(SHELL) script/mkproto.sh $(PERL) \
	  -h _PROTO_H_ $(builddir)/include/proto.h \
	  $(PROTO_OBJ)

include/build_env.h:
	@echo Building include/build_env.h
	@cd $(srcdir) && $(SHELL) script/build_env.sh $(srcdir) $(builddir) $(CC) > $(builddir)/include/build_env.h

# "make headers" or "make proto" calls a subshell because we need to
# make sure these commands are executed in sequence even for a
# parallel make.
headers: delheaders include/proto.h include/build_env.h 

proto: idl headers 

proto_test:
	@[ -f include/proto.h ] || $(MAKE) proto

.PHONY: headers proto

etags:
	etags `find $(srcdir) -name "*.[ch]" | grep -v /CVS/`

ctags:
	ctags `find $(srcdir) -name "*.[ch]" | grep -v /CVS/`

realclean: clean delheaders
	-rm -f config.log bin/.dummy

distclean: realclean
	-rm -f include/config.h Makefile
	-rm -f config.status config.cache

realdistclean: distclean
	-rm -f include/config.h.in
	-rm -f lib/version.h
	-rm -f configure

# when configure.in is updated, reconfigure
$(srcdir)/configure: $(srcdir)/configure.in
	@echo "WARNING: you need to rerun ./autogen.sh"

config.status: $(srcdir)/configure
	@echo "WARNING: you need to run configure"

Makefile: $(srcdir)/Makefile.in config.status
	@echo "WARNING: you need to run ./config.status"