1
- # The default target of this Makefile is...
2
- all ::
3
- .PHONY : all
4
-
5
- MAK_DIR_GITWEB =
1
+ ifndef MAK_DIR_GITWEB
2
+ $(error do not run gitweb/Makefile stand-alone anymore. The "gitweb" and \
3
+ "install-gitweb" targets now live in the top-level Makefile)
4
+ endif
6
5
7
- # Define V=1 to have a more verbose compile.
8
- #
9
6
# Define JSMIN to point to JavaScript minifier that functions as
10
7
# a filter to have static/gitweb.js minified.
11
8
#
12
9
# Define CSSMIN to point to a CSS minifier in order to generate a minified
13
10
# version of static/gitweb.css
14
11
#
15
12
16
- prefix ?= $(HOME )
17
- bindir ?= $(prefix ) /bin
18
- gitwebdir ?= /var/www/cgi-bin
19
-
20
- RM ?= rm -f
21
- INSTALL ?= install
22
-
23
13
# default configuration for gitweb
24
14
GITWEB_CONFIG = gitweb_config.perl
25
15
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
@@ -44,71 +34,19 @@ GITWEB_SITE_HEADER =
44
34
GITWEB_SITE_FOOTER =
45
35
HIGHLIGHT_BIN = highlight
46
36
47
- # include user config
48
- -include ../config.mak.autogen
49
- -include ../config.mak
50
- -include config.mak
51
-
52
- # determine version
53
- .PHONY : .FORCE-GIT-VERSION-FILE
54
- ../GIT-VERSION-FILE : .FORCE-GIT-VERSION-FILE
55
- $(QUIET_SUBDIR0 ) ../ $(QUIET_SUBDIR1 ) GIT-VERSION-FILE
56
-
57
- ifneq ($(MAKECMDGOALS ) ,clean)
58
- -include ../GIT-VERSION-FILE
59
- endif
60
-
61
37
# What targets we'll add to 'all' for "make gitweb"
62
38
GITWEB_ALL =
63
39
GITWEB_ALL += gitweb.cgi
64
40
GITWEB_ALL += $(GITWEB_JS )
65
41
66
- # ## Build rules
67
-
68
- SHELL_PATH ?= $(SHELL )
69
- PERL_PATH ?= /usr/bin/perl
70
-
71
- # Shell quote;
72
- bindir_SQ = $(subst ','\'',$(bindir ) ) # '
73
- gitwebdir_SQ = $(subst ','\'',$(gitwebdir ) ) # '
74
- gitwebstaticdir_SQ = $(subst ','\'',$(gitwebdir ) /static) # '
75
- SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH ) ) # '
76
- PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH ) ) # '
77
- DESTDIR_SQ = $(subst ','\'',$(DESTDIR ) ) # '
78
-
79
- # Quiet generation (unless V=1)
80
- QUIET_SUBDIR0 = +$(MAKE ) -C # space to separate -C and subdir
81
- QUIET_SUBDIR1 =
82
-
83
- ifneq ($(findstring $(MAKEFLAGS ) ,w) ,w)
84
- PRINT_DIR = --no-print-directory
85
- else # "make -w"
86
- NO_SUBDIR = :
87
- endif
88
-
89
- ifneq ($(findstring $(MAKEFLAGS ) ,s) ,s)
90
- ifndef V
91
- QUIET = @
92
- QUIET_GEN = $(QUIET)echo ' ' GEN $@;
93
- QUIET_SUBDIR0 = +@subdir=
94
- QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
95
- $(MAKE) $(PRINT_DIR) -C $$subdir
96
- export V
97
- export QUIET
98
- export QUIET_GEN
99
- export QUIET_SUBDIR0
100
- export QUIET_SUBDIR1
101
- endif
102
- endif
103
-
104
- all :: $(GITWEB_ALL )
42
+ MAK_DIR_GITWEB_ALL = $(addprefix $(MAK_DIR_GITWEB ) ,$(GITWEB_ALL ) )
105
43
106
44
GITWEB_PROGRAMS = gitweb.cgi
107
45
108
46
GITWEB_JS_MIN = static/gitweb.min.js
109
47
ifdef JSMIN
110
48
GITWEB_JS = $(GITWEB_JS_MIN )
111
- all :: $(MAK_DIR_GITWEB )$(GITWEB_JS_MIN )
49
+ GITWEB_ALL += $(MAK_DIR_GITWEB )$(GITWEB_JS_MIN )
112
50
$(MAK_DIR_GITWEB )$(GITWEB_JS_MIN ) : $(MAK_DIR_GITWEB ) GITWEB-BUILD-OPTIONS
113
51
$(MAK_DIR_GITWEB )$(GITWEB_JS_MIN ) : $(MAK_DIR_GITWEB )$(GITWEB_JS_IN )
114
52
$(QUIET_GEN )$(JSMIN ) < $< > $@
@@ -118,7 +56,7 @@ GITWEB_FILES += $(GITWEB_JS)
118
56
GITWEB_CSS_MIN = static/gitweb.min.css
119
57
ifdef CSSMIN
120
58
GITWEB_CSS = $(GITWEB_CSS_MIN )
121
- all :: $(MAK_DIR_GITWEB )$(GITWEB_CSS_MIN )
59
+ GITWEB_ALL += $(MAK_DIR_GITWEB )$(GITWEB_CSS_MIN )
122
60
$(MAK_DIR_GITWEB )$(GITWEB_CSS_MIN ) : $(MAK_DIR_GITWEB ) GITWEB-BUILD-OPTIONS
123
61
$(MAK_DIR_GITWEB )$(GITWEB_CSS_MIN ) : $(MAK_DIR_GITWEB )$(GITWEB_CSS_IN )
124
62
$(QUIET_GEN )$(CSSMIN ) < $< > $@
@@ -185,19 +123,22 @@ $(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_
185
123
186
124
# ## Installation rules
187
125
188
- .PHONY : install
189
- install : all
126
+ .PHONY : install-gitweb
127
+ install-gitweb : $( MAK_DIR_GITWEB_ALL )
190
128
$(INSTALL ) -d -m 755 ' $(DESTDIR_SQ)$(gitwebdir_SQ)'
191
- $(INSTALL ) -m 755 $(addprefix $(MAK_DIR_GITWEB ) ,$(GITWEB_PROGRAMS ) ) \
192
- ' $(DESTDIR_SQ)$(gitwebdir_SQ)'
129
+ $(INSTALL ) -m 755 $(addprefix $(MAK_DIR_GITWEB ) ,$(GITWEB_PROGRAMS ) ) ' $(DESTDIR_SQ)$(gitwebdir_SQ)'
193
130
$(INSTALL ) -d -m 755 ' $(DESTDIR_SQ)$(gitwebstaticdir_SQ)'
194
131
$(INSTALL ) -m 644 $(addprefix $(MAK_DIR_GITWEB ) ,$(GITWEB_FILES ) ) \
195
132
' $(DESTDIR_SQ)$(gitwebstaticdir_SQ)'
133
+ ifndef NO_PERL
134
+ install : install-gitweb
135
+ endif
196
136
197
137
# ## Cleaning rules
198
138
199
- .PHONY : clean
200
- clean :
139
+ .PHONY : gitweb- clean
140
+ gitweb- clean :
201
141
$(RM ) $(addprefix $(MAK_DIR_GITWEB ) ,gitweb.cgi $(GITWEB_JS_IN ) \
202
142
$(GITWEB_JS_MIN ) $(GITWEB_CSS_MIN ) \
203
143
GITWEB-BUILD-OPTIONS)
144
+ clean : gitweb-clean
0 commit comments