Split rules.mk out of Makefile.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 11 Feb 2008 21:05:52 +0000 (22:05 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 13 Feb 2008 00:40:11 +0000 (01:40 +0100)
(cherry picked from commit 75ffc2c50d70e6f4108c3e6843c8d2bb212f6d9e)

source/lib/talloc/Makefile.in
source/lib/talloc/rules.mk [new file with mode: 0644]

index 9ba557dd8eb778f2c88dbb3a2fe9736f962dead9..5b0506d17fa936aa734e00f54428333800e26631 100644 (file)
@@ -19,24 +19,16 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 SHLIBEXT = @SHLIBEXT@
 SHLD_FLAGS = @SHLD_FLAGS@
 
-.SUFFIXES: .c .o .3 .3.xml .xml .html
-
 LIBOBJ = @TALLOC_OBJ@ @LIBREPLACEOBJ@
 
 SOLIB = libtalloc.$(SHLIBEXT).$(PACKAGE_VERSION)
 SONAME = libtalloc.$(SHLIBEXT).1
 
-.c.o:
-       $(CC) $(PICFLAG) -o $@ -c $< $(CFLAGS)
-
-all: showflags libtalloc.a $(SOLIB) testsuite $(EXTRA_TARGETS)
+all:: showflags libtalloc.a $(SOLIB) testsuite $(EXTRA_TARGETS)
 
-showflags:
-       @echo 'talloc will be compiled with flags:'
-       @echo '  CFLAGS = $(CFLAGS)'
-       @echo '  LIBS = $(LIBS)'
+include rules.mk
 
-testsuite: $(LIBOBJ) testsuite.o
+testsuite:: $(LIBOBJ) testsuite.o
        $(CC) $(CFLAGS) -o testsuite testsuite.o $(LIBOBJ) $(LIBS)
 
 libtalloc.a: $(LIBOBJ)
@@ -46,7 +38,7 @@ libtalloc.a: $(LIBOBJ)
 $(SOLIB): $(LIBOBJ)
        $(CC) $(SHLD_FLAGS) -o $@ $(LIBOBJ) @SONAMEFLAG@$(SONAME)
 
-install: all 
+install:: all 
        ${INSTALLCMD} -d $(DESTDIR)$(libdir)
        ${INSTALLCMD} -d $(DESTDIR)$(libdir)/pkgconfig
        ${INSTALLCMD} -m 755 libtalloc.a $(DESTDIR)$(libdir)
@@ -59,30 +51,24 @@ install: all
        which swig >/dev/null 2>&1 && ${INSTALLCMD} -d $(DESTDIR)`swig -swiglib` || true
        which swig >/dev/null 2>&1 && ${INSTALLCMD} -m 644 talloc.i $(DESTDIR)`swig -swiglib` || true
 
-doc: talloc.3 talloc.3.html
-
-.3.xml.3:
-       -test -z "$(XSLTPROC)" || $(XSLTPROC) --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+doc:: talloc.3 talloc.3.html
 
-.xml.html:
-       -test -z "$(XSLTPROC)" || $(XSLTPROC) --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
-
-clean:
+clean::
        rm -f *~ $(LIBOBJ) $(SOLIB) libtalloc.a testsuite testsuite.o *.gc?? talloc.3 talloc.3.html
 
-test: testsuite
+check: test
+
+test:: testsuite
        ./testsuite
 
-gcov:
+gcov::
        gcov talloc.c
 
-installcheck: 
-       $(MAKE) test
+installcheck:: test
 
-distclean: clean
-       rm -f *~ */*~
+distclean:: clean
        rm -f Makefile
        rm -f config.log config.status config.h config.cache
 
-realdistclean: distclean
+realdistclean:: distclean
        rm -f configure config.h.in
diff --git a/source/lib/talloc/rules.mk b/source/lib/talloc/rules.mk
new file mode 100644 (file)
index 0000000..6cee126
--- /dev/null
@@ -0,0 +1,18 @@
+.SUFFIXES: .c .o .3 .3.xml .xml .html
+
+showflags::
+       @echo 'talloc will be compiled with flags:'
+       @echo '  CFLAGS = $(CFLAGS)'
+       @echo '  LIBS = $(LIBS)'
+
+.c.o:
+       $(CC) $(PICFLAG) -o $@ -c $< $(CFLAGS)
+
+.3.xml.3:
+       -test -z "$(XSLTPROC)" || $(XSLTPROC) --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+
+.xml.html:
+       -test -z "$(XSLTPROC)" || $(XSLTPROC) --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
+
+distclean::
+       rm -f *~ */*~