1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

r14554: Write out header dependencies. This means all C files affected will be

rebuilt when a header file is changed. It also means parallel builds work now.

It will take a minute or so to generate all the dependency information,
but there should be no need to rebuild that information later on, unless
a file changes.

This behaviour is only enabled when building in developer mode
(--enable-developer) and requires a GNU make (or compatible). In all other
cases, the file 'static_deps.mk' is included, which contains some basic
hardcoded dependency information.
(This used to be commit eb435386f015ce1d89eb6f7e7837622ebd9e1951)
This commit is contained in:
Jelmer Vernooij 2006-03-19 02:23:52 +00:00 committed by Gerald (Jerry) Carter
parent 781d122fb6
commit c84cfc0ecc
14 changed files with 69 additions and 57 deletions

View File

@ -21,6 +21,7 @@ sub create_cflags($$)
my $ofile = $_;
my $dfile = $_;
$dfile =~ s/\.o$/.d/;
$dfile =~ s/\.ho$/.d/;
print CFLAGS_TXT "$ofile $dfile: CFLAGS+=$key->{EXTRA_CFLAGS}\n";
}
}

View File

@ -509,12 +509,9 @@ sub write($$)
$self->output($self->{mkfile});
if ($self->{developer}) {
$self->output(<<__EOD__
-include \$(DEP_FILES)
__EOD__
);
$self->output("-include \$(DEP_FILES)\n");
} else {
$self->output("include static_deps.mk\n");
}
open(MAKEFILE,">$file") || die ("Can't open $file\n");

View File

@ -418,12 +418,6 @@ OBJ_FILES = ../heimdal/lib/vers/print_version.ho \
# End BINARY compile_et
#######################
heimdal/lib/roken/vis.h: heimdal/lib/roken/vis.hin
@cp heimdal/lib/roken/vis.hin heimdal/lib/roken/vis.h
heimdal/lib/roken/err.h: heimdal/lib/roken/err.hin
@cp heimdal/lib/roken/err.hin heimdal/lib/roken/err.h
include perl_path_wrapper.sh asn1_deps.pl heimdal/lib/hdb/hdb.asn1 hdb_asn1|
include perl_path_wrapper.sh asn1_deps.pl heimdal/lib/gssapi/spnego.asn1 spnego_asn1|
include perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/k5.asn1 krb5_asn1 --encode-rfc1510-bit-string|
@ -434,17 +428,8 @@ include perl_path_wrapper.sh et_deps.pl heimdal/lib/krb5/heim_err.et|
include perl_path_wrapper.sh et_deps.pl heimdal/lib/krb5/k524_err.et|
include perl_path_wrapper.sh et_deps.pl heimdal/lib/krb5/krb5_err.et|
heimdal_basics: \
heimdal/lib/roken/vis.h \
heimdal/lib/roken/err.h \
heimdal/lib/hdb/hdb_asn1.h \
heimdal/lib/gssapi/spnego_asn1.h \
heimdal/lib/asn1/krb5_asn1.h \
heimdal/lib/asn1/asn1_err.h \
heimdal/lib/hdb/hdb_err.h \
heimdal/lib/krb5/heim_err.h \
heimdal/lib/krb5/k524_err.h \
heimdal/lib/krb5/krb5_err.h
./heimdal/lib/krb5/replay.c: ./heimdal/lib/roken/vis.h
./heimdal/lib/roken/vis.c: ./heimdal/lib/roken/vis.h
clean::
@-rm -f heimdal/lib/roken/vis.h heimdal/lib/roken/err.h

View File

@ -33,4 +33,4 @@ struct ldb_message;
struct ldb_dn;
struct cli_credentials;
#include "db_wrap_proto.h"
#include "lib/db_wrap_proto.h"

View File

@ -30,7 +30,7 @@
#include "lib/messaging/irpc.h"
#include "db_wrap.h"
#include "lib/tdb/include/tdbutil.h"
#include "util/unix_privs.h"
#include "lib/util/unix_privs.h"
#include "librpc/rpc/dcerpc.h"
/* change the message version with any incompatible changes in the protocol */

View File

@ -29,5 +29,5 @@ struct iface_struct {
#define MAX_INTERFACES 128
#ifndef AUTOCONF_TEST
#include "netif/proto.h"
#include "lib/netif/proto.h"
#endif

View File

@ -18,7 +18,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "includes.h"
#include "registry.h"
#include "lib/registry/registry.h"
#include "system/filesys.h"
#include "system/time.h"
#include "lib/registry/tdr_regf.h"

View File

@ -164,6 +164,6 @@ struct reg_diff
struct reg_diff_key *keys;
};
#include "registry_proto.h"
#include "lib/registry/registry_proto.h"
#endif /* _REGISTRY_H */

View File

@ -210,6 +210,6 @@ struct samba3
struct samba3_regdb registry;
};
#include "samba3/samba3_proto.h"
#include "lib/samba3/samba3_proto.h"
#endif /* _SAMBA3_H */

View File

@ -62,6 +62,6 @@ struct tdr_print {
typedef NTSTATUS (*tdr_push_fn_t) (struct tdr_push *, const void *);
typedef NTSTATUS (*tdr_pull_fn_t) (struct tdr_pull *, TALLOC_CTX *, void *);
#include "tdr/tdr_proto.h"
#include "lib/tdr/tdr_proto.h"
#endif /* __TDR_H__ */

View File

@ -1,4 +1,4 @@
all: basics bin/asn1_compile bin/compile_et binaries libraries modules
all: bin/asn1_compile bin/compile_et binaries libraries modules
include dynconfig.mk
include heimdal_build/config.mk
@ -192,6 +192,7 @@ IDL_HEADER_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/%.h,$(IDL_FILES))
IDL_NDR_HEADER_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%.h,$(IDL_FILES))
IDL_NDR_PARSE_C_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%.c,$(IDL_FILES))
IDL_NDR_CLIENT_C_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%_c.c,$(IDL_FILES))
IDL_NDR_CLIENT_HEADER_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%_c.h,$(IDL_FILES))
IDL_NDR_SERVER_C_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%_s.c,$(IDL_FILES))
IDL_NDR_EJS_C_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%_ejs.c,$(IDL_FILES))
IDL_NDR_EJS_H_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%_ejs.h,$(IDL_FILES))
@ -200,6 +201,7 @@ $(IDL_HEADER_FILES): idl
$(IDL_NDR_HEADER_FILES): idl
$(IDL_NDR_PARSE_C_FILES): idl
$(IDL_NDR_CLIENT_C_FILES): idl
$(IDL_NDR_CLIENT_H_FILES): idl
$(IDL_NDR_SERVER_C_FILES): idl
$(IDL_NDR_EJS_C_FILES): idl
$(IDL_NDR_EJS_H_FILES): idl
@ -225,32 +227,11 @@ include/config.h:
@echo "You need to rerun ./autogen.sh and ./configure"
@/bin/false
librpc/gen_ndr/misc.h: idl
librpc/ndr/libndr.h: librpc/ndr/libndr_proto.h librpc/gen_ndr/misc.h
librpc/rpc/dcerpc.h: librpc/rpc/dcerpc_proto.h
auth/credentials/credentials.h: auth/credentials/credentials_proto.h
libcli/nbt/libnbt.h: libcli/nbt/nbt_proto.h
lib/charset/charset.h: lib/charset/charset_proto.h
include/includes.h: \
include/config.h \
lib/util/util_proto.h \
lib/charset/charset.h \
param/proto.h \
libcli/util/proto.h \
librpc/gen_ndr/misc.h
clean_pch:
-rm -f include/includes.h.gch
pch: clean_pch include/includes.h.gch
proto: $(PROTO_HEADERS)
basics: include/includes.h \
proto \
idl \
heimdal_basics
clean:: clean_pch
@echo Removing objects
@-find . -name '*.o' -exec rm -f '{}' \;
@ -331,15 +312,22 @@ unused_macros:
# File types
###############################################################################
.SUFFIXES: .x .c .et .y .l .d .o .h .h.gch .a .so .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml .8 .8.xml .ho
.SUFFIXES: .x .c .et .y .l .d .o .h .h.gch .a .so .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml .8 .8.xml .ho .hin .idl
.hin.h:
@cp $< $@
.c.ho:
@echo "Compiling $*.c with host compiler"
@echo "Compiling $< with host compiler"
@$(HOSTCC) `script/cflags.pl $@` $(CFLAGS) -c $*.c -o $@
.c.d:
@echo "Generating dependencies for $<"
@$(CC) -MM -MG -MT $(<:.c=.o) -MF $@ $(CFLAGS) $<
@$(CC) -M -MG -MT $(<:.c=.o) `script/cflags.pl $@` $(CFLAGS) $< -o $@
include/includes.d: include/includes.h
@echo "Generating dependencies for $<"
@$(CC) -M -MG -MT include/includes.h.gch $(CFLAGS) $< -o $@
.c.o:
@if test -n "$(CC_CHECKER)"; then \
@ -377,3 +365,9 @@ DOCBOOK_MANPAGE_URL = http://docbook.sourceforge.net/release/xsl/current/manpage
.8.xml.8:
$(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
DEP_FILES = $(patsubst %.ho,%.d,$(patsubst %.o,%.d,$(ALL_OBJS))) \
include/includes.d
clean-deps:
rm -f $(DEPFILES)

View File

@ -22,7 +22,7 @@
#include "includes.h"
#include "vfs_posix.h"
#include "util/unix_privs.h"
#include "lib/util/unix_privs.h"
#include "librpc/gen_ndr/ndr_xattr.h"
/*

View File

@ -40,7 +40,7 @@
#include "smbd/process_model.h"
#include "smbd/service.h"
#include "passdb/secrets.h"
#include "util/pidfile.h"
#include "lib/util/pidfile.h"
/*
recursively delete a directory tree

35
source4/static_deps.mk Normal file
View File

@ -0,0 +1,35 @@
# These should also be autogenerated at some point
# perhaps by some perl scripts run from config.status ?
#
librpc/gen_ndr/misc.h: idl
librpc/ndr/libndr.h: librpc/ndr/libndr_proto.h librpc/gen_ndr/misc.h
librpc/rpc/dcerpc.h: librpc/rpc/dcerpc_proto.h
auth/credentials/credentials.h: auth/credentials/credentials_proto.h
libcli/nbt/libnbt.h: libcli/nbt/nbt_proto.h
lib/charset/charset.h: lib/charset/charset_proto.h
include/includes.h: \
include/config.h \
lib/util/util_proto.h \
lib/charset/charset.h \
param/proto.h \
libcli/util/proto.h \
librpc/gen_ndr/misc.h
heimdal_basics: \
heimdal/lib/roken/vis.h \
heimdal/lib/roken/err.h \
heimdal/lib/hdb/hdb_asn1.h \
heimdal/lib/gssapi/spnego_asn1.h \
heimdal/lib/asn1/krb5_asn1.h \
heimdal/lib/asn1/asn1_err.h \
heimdal/lib/hdb/hdb_err.h \
heimdal/lib/krb5/heim_err.h \
heimdal/lib/krb5/k524_err.h \
heimdal/lib/krb5/krb5_err.h
proto: basics
basics: include/includes.h \
proto \
idl \
heimdal_basics