Fix a couple (well, little more than that..) of typos.
[nivanova/samba-autobuild/.git] / source4 / build / make / rules.mk
index 44277fe3e201473afd11b73168f34c70ad962f34..176e67a691b77f40e85568b6bab9f9fbef9eb86c 100644 (file)
@@ -46,7 +46,7 @@ clean:: clean_pch
        @echo Removing binaries
        @-rm -f $(BIN_PROGS) $(SBIN_PROGS) $(BINARIES) $(TORTURE_PROGS)
        @echo Removing libraries
-       @-rm -f $(STATIC_LIBRARIES) $(SHARED_LIBRARIES)
+       @-rm -f $(STATIC_LIBS) $(SHARED_LIBS)
        @-rm -f bin/static/*.a bin/shared/*.$(SHLIBEXT) bin/mergedobj/*.o
        @echo Removing modules
        @-rm -f bin/modules/*/*.$(SHLIBEXT)
@@ -56,8 +56,6 @@ clean:: clean_pch
        @echo Removing generated files
        @-rm -f bin/*_init_module.c
        @-rm -rf librpc/gen_* 
-       @echo Removing proto headers
-       @-rm -f $(PROTO_HEADERS)
 
 distclean:: clean
        -rm -f include/config.h include/config_tmp.h include/build.h
@@ -88,53 +86,7 @@ unused_macros:
        @mkdir -p $(@D)
        @$(STLD) $(STLD_FLAGS) $@ $^
 
-###############################################################################
-# Templates
-###############################################################################
-
-# Partially link
-# Arguments: target object file, source object files
-define partial_link_template 
-$(1): $(2) ;
-       @echo Partially linking $$@
-       @mkdir -p $$(@D)
-       $$(PARTLINK) -o $$@ $$^
-endef
-
-# Link a binary
-# Arguments: target file, depends, flags
-define binary_link_template
-$(1): $(2) ;
-       @echo Linking $$@
-       @$$(BNLD) $$(BNLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
-endef
-
-# Link a host-machine binary
-# Arguments: target file, depends, flags
-define host_binary_link_template
-$(1): $(2) ;
-       @echo Linking $$@
-       @$$(HOSTLD) $$(HOSTLD_FLAGS) -L$${builddir}/bin/static -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
-endef
-
-# Create a prototype header
-# Arguments: header file, c files
-define proto_header_template
-$(1): $(2) ;
-       @echo "Creating $$@"
-       @$$(PERL) $$(srcdir)/script/mkproto.pl --srcdir=$$(srcdir) --builddir=$$(builddir) --all=$$@ $$^
-endef
-
-# Shared module
-# Arguments: Target, dependencies, objects
-define shared_module_template
-
-$(1): $(2) ;
-       @echo Linking $$@
-       @mkdir -p $$(@D)
-       @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
-
-endef
+include build/make/templates.mk
 
 ###############################################################################
 # File types
@@ -163,17 +115,15 @@ include/includes.d: include/includes.h
        @-mkdir -p `dirname $@`
        @$(COMPILE) && exit 0 ; \
                echo "The following command failed:" 1>&2;\
-               $(COMPILE) >/dev/null 2>&1
-
+               echo "$(subst ",\",$(COMPILE))" 1>&2 && exit 1
 
-#              echo "$(COMPILE)" 1>&2;\
 
 .c.ho:
        @echo "Compiling $< with host compiler"
        @-mkdir -p `dirname $@`
        @$(HCOMPILE) && exit 0;\
                echo "The following command failed:" 1>&2;\
-               echo "$(HCOMPILE)" 1>&2;\
+               echo "$(subst ",\",$(HCOMPILE))" 1>&2;\
                $(HCOMPILE) >/dev/null 2>&1
 
 .h.h.gch:
@@ -186,7 +136,7 @@ include/includes.d: include/includes.h
 
 .l.c:
        @echo "Building $< with $(LEX)"
-       @-$(make_utility_dir)/script/lex_compile.sh "$(LEX)" "$<" "$@"
+       @-$(make_utility_dir)/lex_compile.sh "$(LEX)" "$<" "$@"
 
 %.a:
        @echo Linking $@