git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv5 2/6] Gitweb: add support for minifying gitweb.css

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 14, 2010, 23:58 UTC
Message-ID
<7viq7tmvsb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201004140030.47222.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 19 quoted lines
> On Tue, 13 April 2010, Charles Bailey wrote:
>> On 01/04/2010 06:36, Mark Rada wrote:
>> > @@ -84,13 +92,14 @@ endif
>> >
>> >   all:: gitweb.cgi
>> >
>> > +FILES = gitweb.cgi
>> >   ifdef JSMIN
>> > +FILES += gitweb.min.js
>> > +endif
>> > +ifdef CSSMIN
>> > +FILES += gitweb.min.css
>> > +endif
>> > +gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)
>
> GITWEB_JS and GITWEB_CSS were originally meant to be URI to file with
> gitweb JavaScript code and default gitweb stylesheet,... but during work
> on minification of JavaScript code and CSS file it somehow got confused
> to mean source path.

I am not touching instaweb part, but this would fix the build/clean side of the things, no?

-- >8 -- gitweb: simplify gitweb.min.* generation and clean-up rules

GITWEB_CSS and GITWEB_JS are meant to be "what URI should the installed cgi script use to refer to the stylesheet and JavaScript", never "this is the name of the file we are building".

Lose incorrect assignment to them.

While we are at it, lose FILES that is used only for "clean" target in a misguided way. "make clean" should try to remove all the potential build artifacts regardless of a minor configuration change. Instead of trying to remove only the build product "make clean" would have created if it were run without "clean", explicitly list the three potential build products for removal.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 gitweb/Makefile |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/gitweb/Makefile b/gitweb/Makefile
index ffee4bd..1787633 100644
--- a/gitweb/Makefile
+++ b/gitweb/Makefile
@@ -80,16 +80,7 @@ endif
 
 all:: gitweb.cgi
 
-FILES = gitweb.cgi
-ifdef JSMIN
-FILES += gitweb.min.js
-GITWEB_JS = gitweb.min.js
-endif
-ifdef CSSMIN
-FILES += gitweb.min.css
-GITWEB_CSS = gitweb.min.css
-endif
-gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)
+gitweb.cgi: gitweb.perl
 
 gitweb.cgi:
 	$(QUIET_GEN)$(RM) $@ $@+ && \
@@ -118,16 +109,18 @@ gitweb.cgi:
 	mv $@+ $@
 
 ifdef JSMIN
+all:: gitweb.min.js
 gitweb.min.js: gitweb.js
 	$(QUIET_GEN)$(JSMIN) <$< >$@
 endif # JSMIN
 
 ifdef CSSMIN
+all:: gitweb.min.css
 gitweb.min.css: gitweb.css
 	$(QUIET_GEN)$(CSSMIN) <$ >$@
 endif
 
 clean:
-	$(RM) $(FILES)
+	$(RM) gitweb.cgi gitweb.min.css gitweb.min.js
 
 .PHONY: all clean .FORCE-GIT-VERSION-FILE
Previous: Jakub NarebskiNext: Charles Bailey
Message 9 of 15 in “[PATCHv5 2/6] Gitweb: add support for minifying gitweb.css”
  1. Mark RadaApr 1, 2010
  2. Jakub NarebskiApr 1, 2010
  3. Charles BaileyApr 13, 2010
  4. Jakub NarebskiApr 13, 2010
  5. Mark RadaApr 14, 2010
  6. Jakub NarebskiApr 14, 2010
  7. Mark RadaApr 14, 2010
  8. Jakub NarebskiApr 14, 2010
  9. Junio C HamanoApr 14, 2010
  10. Charles BaileyApr 15, 2010
  11. Jakub NarebskiApr 15, 2010
  12. Junio C HamanoApr 15, 2010
  13. Jakub NarebskiApr 15, 2010
  14. Mark RadaApr 15, 2010
  15. Junio C HamanoApr 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.