debian/rules: remove config.{sub,guess} in clean target and copy them
[debian/cdck.git] / debian / rules
index 834496487156bafb681e6ca2a89dada6092b3245..987648e441974bbbc9f78013ef8231b70cfed2cf 100755 (executable)
@@ -27,7 +27,15 @@ endif
 
 config.status: configure
        dh_testdir
-       CFLAGS="$(CFLAGS) -Wl,-z,defs" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
+
+ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+       cp -f /usr/share/misc/config.sub config.sub
+endif
+ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+       cp -f /usr/share/misc/config.guess config.guess
+endif
+
+       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS=" -Wl,-z,defs"
 
 
 build: build-stamp
@@ -39,16 +47,9 @@ build-stamp: config.status $(QUILT_STAMPFN)
 clean: unpatch
        dh_testdir
        dh_testroot
+       rm -f config.sub config.guess
        rm -f build-stamp install-stamp
-
        [ ! -f Makefile ] || $(MAKE) distclean
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-       cp -f /usr/share/misc/config.sub config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-       cp -f /usr/share/misc/config.guess config.guess
-endif
-
        dh_clean
 
 install: install-stamp
@@ -81,4 +82,4 @@ binary-arch: build install
        dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 
+.PHONY: build clean binary-indep binary-arch binary install