r14554: Write out header dependencies. This means all C files affected will be
authorJelmer Vernooij <jelmer@samba.org>
Sun, 19 Mar 2006 02:23:52 +0000 (02:23 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:58:45 +0000 (13:58 -0500)
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)

14 files changed:
source4/build/smb_build/cflags.pm
source4/build/smb_build/makefile.pm
source4/heimdal_build/config.mk
source4/lib/db_wrap.h
source4/lib/messaging/messaging.c
source4/lib/netif/netif.h
source4/lib/registry/reg_backend_nt4.c
source4/lib/registry/registry.h
source4/lib/samba3/samba3.h
source4/lib/tdr/tdr.h
source4/main.mk
source4/ntvfs/posix/pvfs_xattr.c
source4/smbd/server.c
source4/static_deps.mk [new file with mode: 0644]

index b5525173a07d346e7ea062beb4174aaec1f620ec..299cbab0250c3bbe8a88103287cdb0f3055a16c9 100755 (executable)
@@ -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";
                }
        }
index aeffc79e4d4bf4ac7d1498d97e1d38507fe9d363..3ac4ad53bc6a118ada7dfb9f26e527f0224fe14b 100644 (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");
index b18223192ba84604ff7d4623ea803f24fbaf9b5d..6b10ac7096f5eeba57bb1b2b2a15ccb1fa8b604a 100644 (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
index cf60494b927fe82ba2a8fe19ea7b976f5cebb537..f54bed86130c09f289b4a203b4467e26b0544f45 100644 (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"
index 5680060ee48d188ab9c1a7b15e9fce2fd286b27d..ff5127e79ad43db246937338408ef21eb6758fd1 100644 (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 */
index 36bc8c9b831de440fbf9a7f23626547b514cc436..558fda47922db62659fd194510d8775e7eff0ca8 100644 (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
index 87ae2be070575bedbf9f65f0504d3c5d636bb40b..569b1e194276407f3347cc9ba6afda96c41b321e 100644 (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"
index efe22573c27cc7415983215cbafc62e1fad86fc7..87a23db93d512f3c2632419c05a3299f8c35f6ba 100644 (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 */
index cfe0f7904ae746a3f3374d7ab804c44b78878074..c860c4eddd698c53d1d38c6ca4fb5856cae0cf93 100644 (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 */
index 4c0280d9d6470fe83fa6153791823aceeb9494a5..dfb52c852519d60e2466313bddd5e9333e393fd8 100644 (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__ */
index 2d619cc6f1fa8ae7d4cd982db05e8f9a73a86206..592d6c50e1f6dd3ec643be62c38a07ef8c03e69b 100644 (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)
index cf38d3c1cb8c927e3da8f1bf8175622505a805da..09f1c9fdc8d4ababba9b99741e8cc66b55f21ca6 100644 (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"
 
 /*
index c472581a06c6e20530a929ffff491738ee0e463b..fcaf0b8e39c589f88d9491064836e6ca5fe26eb0 100644 (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
diff --git a/source4/static_deps.mk b/source4/static_deps.mk
new file mode 100644 (file)
index 0000000..09db053
--- /dev/null
@@ -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