mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mingw-cross-env-list] Cleaning individual packages before build


From: Tony Theodore
Subject: [Mingw-cross-env-list] Cleaning individual packages before build
Date: Thu, 3 Mar 2011 16:31:03 +1100

Hi All,

>From time to time I get bitten by previous versions of a package
interfering with an updated version. The standard solution is "make
clean", but sometimes it isn't apparent that there is a problem until
later.

I've attempted some simple modifications [1] to the Makefile that
diffs the directory structure and deletes anything previously
installed by each package. It doesn't introduce much overhead, .5
seconds for the last package (zziplib) when usr/ is at it's fullest.

Is this a good approach, and does anyone see this as a problem?

Cheers,

Tony


[1] diff -r 7645b9be346c Makefile
--- a/Makefile  Wed Mar 02 15:59:39 2011 +1100
+++ b/Makefile  Thu Mar 03 15:28:14 2011 +1100
@@ -143,6 +143,7 @@

 .PHONY: build-only-$(1)
 build-only-$(1):
+       [ -d '$(PREFIX)/installed' ] || mkdir -p '$(PREFIX)/installed'
        $(if $(value $(1)_BUILD),
            rm -rf   '$(2)'
            mkdir -p '$(2)'
@@ -150,10 +151,13 @@
            cd '$(2)/$($(1)_SUBDIR)'
            $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/$(1)-*.patch)),
                (cd '$(2)/$($(1)_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH))
+           time rm -rfv `$(SED) 's/^> \(.*\)/\1/'
'$(PREFIX)/installed/$(1)-files'` 2>/dev/null
+           time find '$(PREFIX)' >'$(2)/$(1)-usr-pre'
            $$(call $(1)_BUILD,$(2)/$($(1)_SUBDIR),$(TOP_DIR)/src/$(1)-test)
+           time find '$(PREFIX)' | \
+           diff '$(2)/$(1)-usr-pre' - >'$(PREFIX)/installed/$(1)-files' || :
            rm -rfv  '$(2)'
            ,)
-       [ -d '$(PREFIX)/installed' ] || mkdir -p '$(PREFIX)/installed'
        touch '$(PREFIX)/installed/$(1)'
 endef
 $(foreach PKG,$(PKGS),$(eval $(call PKG_RULE,$(PKG),$(call TMP_DIR,$(PKG)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]