chiark / gitweb /
noip.c: Add debugging to most of the syscall wrappers.
[preload-hacks] / Makefile
index b3360da536bf2fcaabb2ae98bd3e5de2a5bc3bba..5cd11441aca588f13e75fd1a0984e83eebe970a4 100644 (file)
--- a/Makefile
+++ b/Makefile
 ### the Free Software Foundation; either version 2 of the License, or (at
 ### your option) any later version.
 ###
-### Preload-hacks distributed in the hope that it will be useful, but WITHOUT
-### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-### FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-### more details.
+### Preload-hacks are distributed in the hope that it will be useful, but
+### WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+### Public License for more details.
 ###
 ### You should have received a copy of the GNU General Public License along
-### with mLib; if not, write to the Free Software Foundation, Inc., 59 Temple
-### Place - Suite 330, Boston, MA 02111-1307, USA.
+### with preload-hacks; if not, write to the Free Software Foundation, Inc.,
+### 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 PACKAGE                         = preload-hacks
 VERSION                        := $(shell ./auto-version)
@@ -41,6 +41,24 @@ man1dir                       = ${mandir}/man1
 ## Private installation tree for packagers.
 DESTDIR                         =
 
+###--------------------------------------------------------------------------
+### Quiet building.
+
+## Verbosity.
+V                       = 0
+
+## Compilation.
+V_CC                    = $(V_CC_$(V))$(CC)
+V_CC_0                  = @echo "  CC     $@";
+
+## Linking.
+V_LD                    = $(V_LD_$(V))$(LD)
+V_LD_0                  = @echo "  LD     $@";
+
+## Generation.
+V_GEN                   = $(V_GEN_$(V))
+V_GEN_0                         = @echo "  GEN    $@";
+
 ###--------------------------------------------------------------------------
 ### Build parameters.
 
@@ -107,7 +125,8 @@ DISTFILES           += COPYING
 ## Debian.
 debpkg                  = noip uopen
 DISTFILES              += debian/changelog debian/copyright
-DISTFILES              += debian/control debian/rules
+DISTFILES              += debian/control debian/rules debian/compat
+DISTFILES              += debian/source/format
 DISTFILES              += $(patsubst %, debian/%.install, $(debpkg))
 DISTFILES              += $(patsubst %, debian/%.lintian-overrides, \
                                $(debpkg))
@@ -124,21 +143,18 @@ clean:
 
 ## Building sources.
 %.o: %.c
-       $(CC) -c $(REAL_CFLAGS) $< -o $@
+       $(V_CC) -c $(REAL_CFLAGS) $< -o $@
 
 ## Constructing preload hacks.
 noip.so: $(patsubst %.c, %.o, $(NOIP_SOURCES))
-       $(LD) $(REAL_LDFLAGS) $< $(LDLIBS) -o $@
+       $(V_LD) $(REAL_LDFLAGS) $< $(LDLIBS) -o $@
 uopen.so: $(patsubst %.c, %.o, $(UOPEN_SOURCES))
-       $(LD) $(REAL_LDFLAGS) $< $(LDLIBS) -o $@
+       $(V_LD) $(REAL_LDFLAGS) $< $(LDLIBS) -o $@
 
 ## Constructing the scripts.
-$(SCRIPTS): withlib.in
-       for i in $(SCRIPTS); do \
-         sed "s/@lib@/$$i/" withlib.in >$$i.new || exit 1; \
-         chmod +x $$i.new || exit 1; \
-         mv $$i.new $$i || exit 1; \
-       done
+$(SCRIPTS): %: withlib.in
+       $(V_GEN)sed "s/@lib@/$@/" withlib.in >$@.new && \
+               chmod +x $@.new && mv $@.new $@
 
 ###--------------------------------------------------------------------------
 ### Installation.