Skip to content

Commit a4f791b

Browse files
committed
Several changes for Makefile
1 parent cbd64c6 commit a4f791b

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

Makefile

+25-14
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ OUTPUT_PATH := ./target/
3030
CLASSES_PATH := ./target/classes/
3131
PACKAGE_PATH := com/mitsuki/jmatrix/
3232
MANIFEST := META-INF/MANIFEST.MF
33-
DOCS_PATH := docs/
33+
34+
MAKE_USAGE_TXT := docs/makefile-usage.txt
35+
DOCS_PATH := docs/jmatrix
3436

3537
SOURCES_LIST := target/generated-list/sourceFiles.lst
3638
CLASSES_LIST := target/generated-list/outputFiles.lst
@@ -58,7 +60,7 @@ endif
5860
ifndef VERBOSE
5961
MAKE_VERBOSE :=
6062
else
61-
ifeq ($(VERBOSE),true)
63+
ifeq "$(VERBOSE)" "true"
6264
MAKE_VERBOSE := true
6365
else
6466
MAKE_VERBOSE :=
@@ -111,10 +113,10 @@ endif
111113

112114
all:
113115
$(info [Makefile-jmatrix])
114-
$(if $(shell [ ! -f $(DOCS_PATH)makefile-usage.txt ] && echo 1),\
115-
$(error $(PREFIX) File "$(DOCS_PATH)makefile-usage.txt" is missing)\
116+
$(if $(shell [ ! -f $(MAKE_USAGE_TXT) ] && echo 1),\
117+
$(error $(PREFIX) File "$(MAKE_USAGE_TXT)" is missing)\
116118
)
117-
@cat $(DOCS_PATH)makefile-usage.txt
119+
@cat $(MAKE_USAGE_TXT)
118120

119121

120122
check-verbose:
@@ -215,7 +217,7 @@ endif
215217
@echo
216218
@echo ">> [ BUILD DOCS ] <<"
217219
@echo "$(PREFIX) Build the JMatrix docs..."
218-
@javadoc -author -version -d $(DOCS_PATH)jmatrix -Xdoclint \
220+
@javadoc -author -version -d $(DOCS_PATH) -Xdoclint \
219221
@$^ --release 11 -windowtitle "JMatrix" -doctitle "<b>JMatrix</b> v$(VERSION)" \
220222
-tag param -tag return -tag throws -tag warning:a:"Warning:" -tag author -tag license:a:"License:" -tag see \
221223
-Xdoclint/package:-com.mitsuki.jmatrix.core \
@@ -225,7 +227,7 @@ endif
225227

226228
@echo "$(PREFIX) Successfully build the JMatrix docs."
227229
@echo
228-
@echo "SAVED IN: \"$(DOCS_PATH)jmatrix/\""
230+
@echo "SAVED IN: \"$(DOCS_PATH)/\""
229231

230232
clean:
231233
@echo ""
@@ -242,9 +244,9 @@ clean:
242244
)
243245

244246
# Clean the generated HTML pages directory "docs/jmatrix/", only if exist
245-
$(if $(shell [ -d $(DOCS_PATH)jmatrix ] && echo 1),\
246-
@echo && echo "$(PREFIX) Cleaning the \"$(DOCS_PATH)jmatrix/\" directory recursively..." &&\
247-
rm -r $(DOCS_PATH)jmatrix &&\
247+
$(if $(shell [ -d $(DOCS_PATH) ] && echo 1),\
248+
@echo && echo "$(PREFIX) Cleaning the \"$(DOCS_PATH)/\" directory recursively..." &&\
249+
rm -r $(DOCS_PATH) &&\
248250
echo "$(PREFIX) Generated HTML pages cleaned up."\
249251
)
250252
@echo ""
@@ -265,13 +267,22 @@ cleanbin:
265267
)
266268

267269
cleandocs:
268-
@echo
269-
@echo ">> [ CLEAN ONLY THE GENERATED DOCS ] <<"
270+
$(info )
271+
$(info >> [ CLEAN ONLY THE GENERATED DOCS ] <<)
272+
273+
# Check whether the `docs/jmatrix` directory is exist
274+
ifeq "$(shell [ -d $(DOCS_PATH) ] && echo 1)" "1"
270275
@echo "$(PREFIX) Cleaning the generated HTML pages..."
271-
@-rm -r $(DOCS_PATH)jmatrix
276+
@-rm -r $(DOCS_PATH)
277+
else
278+
# Send warning message if the directory does not exist
279+
$(warning $(PREFIX) Directory does not exist: "$(DOCS_PATH)")
280+
endif
281+
272282
@echo
273283
@echo "$(PREFIX) All cleaned up."
274284

285+
275286
$(SOURCES_LIST): $(wildcard $(PYTHON_PATH)*.py)
276287
@echo ""
277288
@echo ">> [ GENERATE LIST ] <<"
@@ -287,7 +298,7 @@ endif
287298

288299

289300
usage:
290-
@echo "[Makefile Usage]"
301+
@echo "[Makefile Basic Usage]"
291302

292303
@echo ""
293304
@echo "Parameters:"

0 commit comments

Comments
 (0)