gitk: Second try to work around the command line limit on Windows
[git/dscho.git] / gitweb / Makefile
blobffee4bd1e30839b68591805b99d170e1ba6ef333
1 # The default target of this Makefile is...
2 all::
4 # Define V=1 to have a more verbose compile.
6 # Define JSMIN to point to JavaScript minifier that functions as
7 # a filter to have gitweb.js minified.
9 # Define CSSMIN to point to a CSS minifier in order to generate a minified
10 # version of gitweb.css
13 prefix ?= $(HOME)
14 bindir ?= $(prefix)/bin
15 RM ?= rm -f
17 # default configuration for gitweb
18 GITWEB_CONFIG = gitweb_config.perl
19 GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
20 GITWEB_HOME_LINK_STR = projects
21 GITWEB_SITENAME =
22 GITWEB_PROJECTROOT = /pub/git
23 GITWEB_PROJECT_MAXDEPTH = 2007
24 GITWEB_EXPORT_OK =
25 GITWEB_STRICT_EXPORT =
26 GITWEB_BASE_URL =
27 GITWEB_LIST =
28 GITWEB_HOMETEXT = indextext.html
29 GITWEB_CSS = gitweb.css
30 GITWEB_LOGO = git-logo.png
31 GITWEB_FAVICON = git-favicon.png
32 GITWEB_JS = gitweb.js
33 GITWEB_SITE_HEADER =
34 GITWEB_SITE_FOOTER =
36 # include user config
37 -include ../config.mak.autogen
38 -include ../config.mak
40 # determine version
41 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
42 $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
44 -include ../GIT-VERSION-FILE
46 ### Build rules
48 SHELL_PATH ?= $(SHELL)
49 PERL_PATH ?= /usr/bin/perl
51 # Shell quote;
52 bindir_SQ = $(subst ','\'',$(bindir)) #'
53 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) #'
54 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) #'
56 # Quiet generation (unless V=1)
57 QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
58 QUIET_SUBDIR1 =
60 ifneq ($(findstring $(MAKEFLAGS),w),w)
61 PRINT_DIR = --no-print-directory
62 else # "make -w"
63 NO_SUBDIR = :
64 endif
66 ifneq ($(findstring $(MAKEFLAGS),s),s)
67 ifndef V
68 QUIET = @
69 QUIET_GEN = $(QUIET)echo ' ' GEN $@;
70 QUIET_SUBDIR0 = +@subdir=
71 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
72 $(MAKE) $(PRINT_DIR) -C $$subdir
73 export V
74 export QUIET
75 export QUIET_GEN
76 export QUIET_SUBDIR0
77 export QUIET_SUBDIR1
78 endif
79 endif
81 all:: gitweb.cgi
83 FILES = gitweb.cgi
84 ifdef JSMIN
85 FILES += gitweb.min.js
86 GITWEB_JS = gitweb.min.js
87 endif
88 ifdef CSSMIN
89 FILES += gitweb.min.css
90 GITWEB_CSS = gitweb.min.css
91 endif
92 gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)
94 gitweb.cgi:
95 $(QUIET_GEN)$(RM) $@ $@+ && \
96 sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
97 -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
98 -e 's|++GIT_BINDIR++|$(bindir)|g' \
99 -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
100 -e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \
101 -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
102 -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
103 -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
104 -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
105 -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
106 -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
107 -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
108 -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
109 -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
110 -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
111 -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
112 -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
113 -e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
114 -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
115 -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
116 $< >$@+ && \
117 chmod +x $@+ && \
118 mv $@+ $@
120 ifdef JSMIN
121 gitweb.min.js: gitweb.js
122 $(QUIET_GEN)$(JSMIN) <$< >$@
123 endif # JSMIN
125 ifdef CSSMIN
126 gitweb.min.css: gitweb.css
127 $(QUIET_GEN)$(CSSMIN) <$ >$@
128 endif
130 clean:
131 $(RM) $(FILES)
133 .PHONY: all clean .FORCE-GIT-VERSION-FILE