Documentation/Makefile: fix interrupted builds of user-manual.xml
[git/git-svn.git] / gitweb / Makefile
blobc9eb1ee6678aa180d74e3da3a74537766f0b1fe4
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.
10 prefix ?= $(HOME)
11 bindir ?= $(prefix)/bin
12 RM ?= rm -f
14 # JavaScript minifier invocation that can function as filter
15 JSMIN ?=
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 ifdef JSMIN
33 GITWEB_JS = gitweb.min.js
34 else
35 GITWEB_JS = gitweb.js
36 endif
37 GITWEB_SITE_HEADER =
38 GITWEB_SITE_FOOTER =
40 # include user config
41 -include ../config.mak.autogen
42 -include ../config.mak
44 # determine version
45 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
46 $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
48 -include ../GIT-VERSION-FILE
50 ### Build rules
52 SHELL_PATH ?= $(SHELL)
53 PERL_PATH ?= /usr/bin/perl
55 # Shell quote;
56 bindir_SQ = $(subst ','\'',$(bindir)) #'
57 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) #'
58 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) #'
60 # Quiet generation (unless V=1)
61 QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
62 QUIET_SUBDIR1 =
64 ifneq ($(findstring $(MAKEFLAGS),w),w)
65 PRINT_DIR = --no-print-directory
66 else # "make -w"
67 NO_SUBDIR = :
68 endif
70 ifneq ($(findstring $(MAKEFLAGS),s),s)
71 ifndef V
72 QUIET = @
73 QUIET_GEN = $(QUIET)echo ' ' GEN $@;
74 QUIET_SUBDIR0 = +@subdir=
75 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
76 $(MAKE) $(PRINT_DIR) -C $$subdir
77 export V
78 export QUIET
79 export QUIET_GEN
80 export QUIET_SUBDIR0
81 export QUIET_SUBDIR1
82 endif
83 endif
85 all:: gitweb.cgi
87 ifdef JSMIN
88 FILES=gitweb.cgi gitweb.min.js
89 gitweb.cgi: gitweb.perl gitweb.min.js
90 else # !JSMIN
91 FILES=gitweb.cgi
92 gitweb.cgi: gitweb.perl
93 endif # JSMIN
95 gitweb.cgi:
96 $(QUIET_GEN)$(RM) $@ $@+ && \
97 sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
98 -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
99 -e 's|++GIT_BINDIR++|$(bindir)|g' \
100 -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
101 -e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \
102 -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
103 -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
104 -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
105 -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
106 -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
107 -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
108 -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
109 -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
110 -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
111 -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
112 -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
113 -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
114 -e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
115 -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
116 -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
117 $< >$@+ && \
118 chmod +x $@+ && \
119 mv $@+ $@
121 ifdef JSMIN
122 gitweb.min.js: gitweb.js
123 $(QUIET_GEN)$(JSMIN) <$< >$@
124 endif # JSMIN
126 clean:
127 $(RM) $(FILES)
129 .PHONY: all clean .FORCE-GIT-VERSION-FILE