-.pkginfo: FORCE
-ifneq ($(shell ./scripts/timestamp.pl -p .pkginfo package Makefile),.pkginfo)
- @echo Collecting package info...
- @-for dir in package/*/; do \
- echo Source-Makefile: $${dir}Makefile; \
- $(MAKE) --no-print-dir DUMP=1 -C $$dir 2>&- || true; \
- done > $@
-endif
+define stamp
+tmp/info/.stamp-$(1)-$(shell ls $(2)/*/Makefile $(5) | (md5sum || md5) 2>/dev/null | cut -d' ' -f1)
+endef
+
+STAMP=$(call stamp,packageinfo,package)
+
+$(STAMP):
+ @mkdir -p tmp/info
+ @rm -f tmp/info/.stamp-packageinfo*
+ @touch $@
+
+define filedep
+$(foreach FILE,$(shell ls package/*/Makefile),
+tmp/.packageinfo: $(FILE)
+$(FILE):
+ @true
+)
+endef
+
+$(eval $(filedep))