All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Change clean rules to properly remove files
@ 2009-09-02 16:48 Yves Blusseau
  2009-09-06 12:19 ` Yves Blusseau
  0 siblings, 1 reply; 6+ messages in thread
From: Yves Blusseau @ 2009-09-02 16:48 UTC (permalink / raw)
  To: The development of GRUB 2


[-- Attachment #1.1: Type: text/plain, Size: 380 bytes --]

ChangeLog:

2009-09-02  Yves Blusseau  <blusseau@zetam.org>

    Change clean rules to properly remove files

    * genmk.rb: add new clean rules
    * Makefile.in (clean): add the new targets
    (mostlyclean): likewise
---
 Makefile.in |    4 ++--
 genmk.rb    |   55 +++++++++++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 49 insertions(+), 10 deletions(-)



[-- Attachment #1.2: new-clean-rules.patch --]
[-- Type: text/plain, Size: 4705 bytes --]

diff --git a/Makefile.in b/Makefile.in
index 8e2cdc6..3af1266 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -325,10 +325,10 @@ uninstall:
 	  rm -f $(DESTDIR)$(libdir)/grub/$$dest; \
 	done
 
-clean:
+clean: $(CLEAN_IMAGE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_UTILITY_TARGETS)
 	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
-mostlyclean: clean
+mostlyclean: clean $(MOSTLYCLEAN_IMAGE_TARGETS) $(MOSTLYCLEAN_MODULE_TARGETS) $(MOSTLYCLEAN_UTILITY_TARGETS)
 	-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
 distclean: mostlyclean
diff --git a/genmk.rb b/genmk.rb
index 4aedb25..50bf88f 100644
--- a/genmk.rb
+++ b/genmk.rb
@@ -39,11 +39,13 @@ class Image
   def initialize(dir, name)
     @dir = dir
     @name = name
+    @rule_count = 0
   end
   attr_reader :dir, :name
 
   def rule(sources)
     prefix = @name.to_var
+    @rule_count += 1
     exe = @name.suffix('exec')
     objs = sources.collect do |src|
       raise "unknown source file `#{src}'" if /\.[cS]$/ !~ src
@@ -53,8 +55,16 @@ class Image
     deps = objs.collect {|obj| obj.suffix('d')}
     deps_str = deps.join(' ')
 
-    "CLEANFILES += #{@name} #{exe} #{objs_str}
-MOSTLYCLEANFILES += #{deps_str}
+"
+clean-image-#{@name}.#{@rule_count}:
+	rm -f #{@name} #{exe} #{objs_str}
+
+CLEAN_IMAGE_TARGETS += clean-image-#{@name}.#{@rule_count}
+
+mostlyclean-image-#{@name}.#{@rule_count}:
+	rm -f #{deps_str}
+
+MOSTLYCLEAN_IMAGE_TARGETS += mostlyclean-image-#{@name}.#{@rule_count}
 
 ifneq ($(TARGET_APPLE_CC),1)
 #{@name}: #{exe}
@@ -94,11 +104,13 @@ class PModule
   def initialize(dir, name)
     @dir = dir
     @name = name
+    @rule_count = 0
   end
   attr_reader :dir, :name
 
   def rule(sources)
     prefix = @name.to_var
+    @rule_count += 1
     objs = sources.collect do |src|
       raise "unknown source file `#{src}'" if /\.[cS]$/ !~ src
       prefix + '-' + src.to_obj
@@ -114,12 +126,23 @@ class PModule
     mod_name = File.basename(@name, '.mod')
     symbolic_name = mod_name.sub(/\.[^\.]*$/, '')
 
-    "CLEANFILES += #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym}
+"
+clean-module-#{@name}.#{@rule_count}:
+	rm -f #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym}
+
+CLEAN_MODULE_TARGETS += clean-module-#{@name}.#{@rule_count}
+
 ifneq ($(#{prefix}_EXPORTS),no)
-CLEANFILES += #{defsym}
+clean-module-#{@name}-symbol.#{@rule_count}:
+	rm -f #{defsym}
+
+CLEAN_MODULE_TARGETS += clean-module-#{@name}-symbol.#{@rule_count}
 DEFSYMFILES += #{defsym}
 endif
-MOSTLYCLEANFILES += #{deps_str}
+mostlyclean-module-#{@name}.#{@rule_count}:
+	rm -f #{deps_str}
+
+MOSTLYCLEAN_MODULE_TARGETS += mostlyclean-module-#{@name}.#{@rule_count}
 UNDSYMFILES += #{undsym}
 
 ifneq ($(TARGET_APPLE_CC),1)
@@ -164,6 +187,7 @@ endif
 " + objs.collect_with_index do |obj, i|
       src = sources[i]
       fake_obj = File.basename(src).suffix('o')
+      extra_target = obj.sub(/\.[^\.]*$/, '') + '-extra'
       command = 'cmd-' + obj.suffix('lst')
       fs = 'fs-' + obj.suffix('lst')
       partmap = 'partmap-' + obj.suffix('lst')
@@ -178,7 +202,11 @@ endif
 	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $<
 -include #{dep}
 
-CLEANFILES += #{command} #{fs} #{partmap} #{handler} #{parttool}
+clean-module-#{extra_target}.#{@rule_count}:
+	rm -f #{command} #{fs} #{partmap} #{handler} #{parttool}
+
+CLEAN_MODULE_TARGETS += clean-module-#{extra_target}.#{@rule_count}
+
 COMMANDFILES += #{command}
 FSFILES += #{fs}
 PARTTOOLFILES += #{parttool}
@@ -219,6 +247,7 @@ class Utility
   def initialize(dir, name)
     @dir = dir
     @name = name
+    @rule_count = 0
   end
   def print_tail()
     prefix = @name.to_var
@@ -231,6 +260,7 @@ class Utility
 
   def rule(sources)
     prefix = @name.to_var
+    @rule_count += 1
     objs = sources.collect do |src|
       raise "unknown source file `#{src}'" if /\.[cS]$/ !~ src
       prefix + '-' + src.to_obj
@@ -239,8 +269,17 @@ class Utility
     deps = objs.collect {|obj| obj.suffix('d')}
     deps_str = deps.join(' ');
 
-    "CLEANFILES += #{@name}$(EXEEXT) #{objs_str}
-MOSTLYCLEANFILES += #{deps_str}
+    "
+clean-utility-#{@name}.#{@rule_count}:
+	rm -f #{@name}$(EXEEXT) #{objs_str}
+
+CLEAN_UTILITY_TARGETS += clean-utility-#{@name}.#{@rule_count}
+
+mostlyclean-utility-#{@name}.#{@rule_count}:
+	rm -f #{deps_str}
+
+MOSTLYCLEAN_UTILITY_TARGETS += mostlyclean-utility-#{@name}.#{@rule_count}
+
 #{prefix}_OBJECTS += #{objs_str}
 
 " + objs.collect_with_index do |obj, i|


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3326 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Change clean rules to properly remove files
  2009-09-02 16:48 [PATCH] Change clean rules to properly remove files Yves Blusseau
@ 2009-09-06 12:19 ` Yves Blusseau
  2009-09-06 14:57   ` Robert Millan
  0 siblings, 1 reply; 6+ messages in thread
From: Yves Blusseau @ 2009-09-06 12:19 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 511 bytes --]


Le 2 sept. 09 à 18:48, Yves Blusseau a écrit :

> ChangeLog:
>
> 2009-09-02  Yves Blusseau  <blusseau@zetam.org>
>
>   Change clean rules to properly remove files
>
>   * genmk.rb: add new clean rules
>   * Makefile.in (clean): add the new targets
>   (mostlyclean): likewise
> ---
> Makefile.in |    4 ++--
> genmk.rb    |   55 ++++++++++++++++++++++++++++++++++++++++++++++ 
> +--------
> 2 files changed, 49 insertions(+), 10 deletions(-)


Is it ok to commit ?

Regards,
Yves Blusseau

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2455 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Change clean rules to properly remove files
  2009-09-06 12:19 ` Yves Blusseau
@ 2009-09-06 14:57   ` Robert Millan
  2009-09-06 15:18     ` Duboucher Thomas
  2009-09-12  7:41     ` Yves Blusseau
  0 siblings, 2 replies; 6+ messages in thread
From: Robert Millan @ 2009-09-06 14:57 UTC (permalink / raw)
  To: The development of GRUB 2

On Sun, Sep 06, 2009 at 02:19:54PM +0200, Yves Blusseau wrote:
>
> Is it ok to commit ?

Please wait a few more days.  It's doubtful that anyone would be interested
(and capable) of reviewing ruby code, but it's still worth a try.

If noone objects, you can commit this.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Change clean rules to properly remove files
  2009-09-06 14:57   ` Robert Millan
@ 2009-09-06 15:18     ` Duboucher Thomas
  2009-09-06 17:42       ` Yves Blusseau
  2009-09-12  7:41     ` Yves Blusseau
  1 sibling, 1 reply; 6+ messages in thread
From: Duboucher Thomas @ 2009-09-06 15:18 UTC (permalink / raw)
  To: The development of GRUB 2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Millan a écrit :
> On Sun, Sep 06, 2009 at 02:19:54PM +0200, Yves Blusseau wrote:
>> Is it ok to commit ?
> 
> Please wait a few more days.  It's doubtful that anyone would be interested
> (and capable) of reviewing ruby code, but it's still worth a try.
> 
> If noone objects, you can commit this.
> 

	I don't know if someone encountered the same issue yet, but, when doing
a 'make clean', 'rm' returned the error that it can't handle too much
files at a time.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqj0sYACgkQBV7eXqefhqg0swCghrwbEK6GDqFsTGnfIZCPYr7m
IREAnR+jYg0mQDJ/wtJkBlnCOU1gVBTI
=Ibj+
-----END PGP SIGNATURE-----





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Change clean rules to properly remove files
  2009-09-06 15:18     ` Duboucher Thomas
@ 2009-09-06 17:42       ` Yves Blusseau
  0 siblings, 0 replies; 6+ messages in thread
From: Yves Blusseau @ 2009-09-06 17:42 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 674 bytes --]


Le 6 sept. 09 à 17:18, Duboucher Thomas a écrit :

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robert Millan a écrit :
>> On Sun, Sep 06, 2009 at 02:19:54PM +0200, Yves Blusseau wrote:
>>> Is it ok to commit ?
>>
>> Please wait a few more days.  It's doubtful that anyone would be  
>> interested
>> (and capable) of reviewing ruby code, but it's still worth a try.
>>
>> If noone objects, you can commit this.
>>
>
> 	I don't know if someone encountered the same issue yet, but, when  
> doing
> a 'make clean', 'rm' returned the error that it can't handle too much
> files at a time.

This it what the patch fix.

Regards,
Yves Blusseau

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2455 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Change clean rules to properly remove files
  2009-09-06 14:57   ` Robert Millan
  2009-09-06 15:18     ` Duboucher Thomas
@ 2009-09-12  7:41     ` Yves Blusseau
  1 sibling, 0 replies; 6+ messages in thread
From: Yves Blusseau @ 2009-09-12  7:41 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]


Le 6 sept. 09 à 16:57, Robert Millan a écrit :

> On Sun, Sep 06, 2009 at 02:19:54PM +0200, Yves Blusseau wrote:
>>
>> Is it ok to commit ?
>
> Please wait a few more days.  It's doubtful that anyone would be  
> interested
> (and capable) of reviewing ruby code, but it's still worth a try.
>
> If noone objects, you can commit this.

Commited.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2455 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-09-12 15:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-02 16:48 [PATCH] Change clean rules to properly remove files Yves Blusseau
2009-09-06 12:19 ` Yves Blusseau
2009-09-06 14:57   ` Robert Millan
2009-09-06 15:18     ` Duboucher Thomas
2009-09-06 17:42       ` Yves Blusseau
2009-09-12  7:41     ` Yves Blusseau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.