Skip to content

Commit 9b42ff6

Browse files
committed
Fix bugs in modules-readm target.
(cherry picked from commit 0042b94)
1 parent 58ba97b commit 9b42ff6

File tree

2 files changed

+21
-35
lines changed

2 files changed

+21
-35
lines changed

Makefile

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ modules_names=$(patsubst modules/%, %.so, $(modules))
121121
modules_basenames=$(patsubst modules/%, %, $(modules))
122122
modules_full_path=$(join $(modules), $(addprefix /, $(modules_names)))
123123

124-
doc_modules_basenames=$(patsubst modules/%, %, $(patsubst net/%, %, $(doc_modules)))
125-
126124
ALLDEP=Makefile Makefile.sources Makefile.defs Makefile.rules Makefile.conf
127125

128126

@@ -239,18 +237,14 @@ tool-xsltproc:
239237
.PHONY: modules-readme
240238
modules-readme: tool-lynx tool-xsltproc
241239
@set -e; \
242-
for r in $(doc_modules_basenames) ""; do \
243-
if [ ! -d "modules/$$r/doc" -a ! -d "net/$$r/doc" ]; then \
240+
for mod in $(doc_modules); do \
241+
r=`basename $$mod`;\
242+
echo "Reading directory $$mod for module $$r";\
243+
if [ ! -d "$$mod/doc" ]; then \
244244
continue; \
245245
fi; \
246-
if [ -d "modules/$$r/doc" ]; then \
247-
cd "modules/$$r/doc"; \
248-
elif [ -d "net/$$r/doc" ]; then \
249-
cd "net/$$r/doc"; \
250-
fi; \
251-
\
246+
cd "$$mod/doc"; \
252247
if [ -f "$$r".xml ]; then \
253-
echo ""; \
254248
echo "docbook xml to html: $$r.xml"; \
255249
$(DBXML2HTML) -o $$r.html $(DBXML2HTMLPARAMS) $(DBHTMLXSL) \
256250
$$r.xml; \
@@ -267,16 +261,13 @@ modules-readme: tool-lynx tool-xsltproc
267261
.PHONY: modules-docbook-txt
268262
modules-docbook-txt: tool-lynx tool-xsltproc
269263
@set -e; \
270-
for r in $(doc_modules_basenames) ""; do \
271-
if [ ! -d "modules/$$r/doc" -a ! -d "net/$$r/doc" ]; then \
264+
for mod in $(doc_modules); do \
265+
r=`basename $$mod`;\
266+
echo "Reading directory $$mod for module $$r";\
267+
if [ ! -d "$$mod/doc" ]; then \
272268
continue; \
273269
fi; \
274-
if [ -d "modules/$$r/doc" ]; then \
275-
cd "modules/$$r/doc"; \
276-
elif [ -d "net/$$r/doc" ]; then \
277-
cd "net/$$r/doc"; \
278-
fi; \
279-
\
270+
cd "$$mod/doc"; \
280271
if [ -f "$$r".xml ]; then \
281272
echo ""; \
282273
echo "docbook xml to html: $$r.xml"; \
@@ -293,16 +284,13 @@ modules-docbook-txt: tool-lynx tool-xsltproc
293284
.PHONY: modules-docbook-html
294285
modules-docbook-html: tool-xsltproc
295286
@set -e; \
296-
for r in $(doc_modules_basenames) ""; do \
297-
if [ ! -d "modules/$$r/doc" -a ! -d "net/$$r/doc" ]; then \
287+
for mod in $(doc_modules); do \
288+
r=`basename $$mod`;\
289+
echo "Reading directory $$mod for module $$r";\
290+
if [ ! -d "$$mod/doc" ]; then \
298291
continue; \
299292
fi; \
300-
if [ -d "modules/$$r/doc" ]; then \
301-
cd "modules/$$r/doc"; \
302-
elif [ -d "net/$$r/doc" ]; then \
303-
cd "net/$$r/doc"; \
304-
fi; \
305-
\
293+
cd "$$mod/doc"; \
306294
if [ -f "$$r".xml ]; then \
307295
echo ""; \
308296
echo "docbook xml to html: $$r.xml"; \
@@ -316,15 +304,13 @@ modules-docbook-html: tool-xsltproc
316304
.PHONY: modules-docbook-pdf
317305
modules-docbook-pdf: tool-docbook2pdf
318306
@set -e; \
319-
for r in $(doc_modules_basenames) ""; do \
320-
if [ ! -d "modules/$$r/doc" -a ! -d "net/$$r/doc" ]; then \
307+
for mod in $(doc_modules); do \
308+
r=`basename $$mod`;\
309+
echo "Reading directory $$mod for module $$r";\
310+
if [ ! -d "$$mod/doc" ]; then \
321311
continue; \
322312
fi; \
323-
if [ -d "modules/$$r/doc" ]; then \
324-
cd "modules/$$r/doc"; \
325-
elif [ -d "net/$$r/doc" ]; then \
326-
cd "net/$$r/doc"; \
327-
fi; \
313+
cd "$$mod/doc"; \
328314
if [ -f "$$r".xml ]; then \
329315
echo ""; \
330316
echo "docbook xml to pdf: $$r.xml"; \

Makefile.rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ builtin_modules=$(shell [ -d net ] && ls net | grep ^proto_ )
1616
all_nostatic_modules=$(filter-out $(addprefix modules/, $(static_modules)), \
1717
$(wildcard modules/*))
1818
all_modules:=$(addprefix modules/, $(all_modules))
19-
all_modules:="$(addprefix net/, $(builtin_modules)) $all_modules"
19+
all_modules:=$(addprefix net/, $(builtin_modules)) $(all_modules)
2020
all_utils:=$(addprefix utils/, $(all_utils))
2121

2222
#implicit rules

0 commit comments

Comments
 (0)