Skip to content

Commit 48c76f7

Browse files
committed
Fixed the options issue
For more details, see 6a39b4d.
1 parent 6a39b4d commit 48c76f7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Makefile

+12-7
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ FLAGS ?=
1616
# and the `FLAGS` variable automatically added linter flags "-Xlint"
1717
LINT ?=
1818

19-
ifeq "$(LINT)" "true"
20-
FLAGS := -Xlint -Xdoclint
21-
endif
2219

2320
ALL_RULES := all compile package clean cleanbin cleandocs
2421

@@ -40,6 +37,8 @@ CLASSES_LIST := target/generated-list/outputFiles.lst
4037
SRCFILES := $(shell find $(SOURCES_PATH) -type f -name '*.java')
4138
ifneq "$(wildcard $(CLASSES_PATH))" ""
4239
CLSFILES := $(shell find $(CLASSES_PATH) -type f -name '*.class')
40+
else
41+
CLSFILES :=
4342
endif
4443

4544
jar := $(OUTPUT_PATH)jmatrix-$(VERSION).jar
@@ -132,11 +131,15 @@ compile: $(SOURCES_LIST) $(SRCFILES)
132131
@echo ""
133132
@echo ">> [ COMPILE PROGRAM ] <<"
134133

135-
$(if $(shell [ $(LINT) = "true" ] && echo 1),\
136-
@echo "$(PREFIX) Linter is ACTIVATED."\
137-
)
134+
ifeq "$(LINT)" "true"
135+
@echo "$(PREFIX) Linter is ACTIVATED."
136+
$(eval LINT_FLAGS := -Xlint -Xdoclint)
137+
else
138+
$(eval LINT_FLAGS :=)
139+
endif
140+
138141
@echo "$(PREFIX) Compiling all source files..."
139-
@$(CC) -d $(CLASSES_PATH) @$< $(FLAGS)
142+
@$(CC) -d $(CLASSES_PATH) @$< $(LINT_FLAGS) $(FLAGS)
140143
@echo "$(PREFIX) Successfully compiled all source files."
141144

142145
$(eval HAS_COMPILED := $(wildcard $(CLASSES_PATH)))
@@ -204,13 +207,15 @@ ifndef VERBOSE
204207
else
205208
ifeq "$(VERBOSE)" "true"
206209
@echo "$(PREFIX) Verbose mode: NORMAL"
210+
$(eval VERBOSE_FLAGS :=)
207211
endif
208212
ifeq "$(VERBOSE)" "all"
209213
@echo "$(PREFIX) Verbose mode: ALL"
210214
$(eval VERBOSE_FLAGS := -verbose)
211215
endif
212216
ifneq "$(shell [ $(VERBOSE) = 'all' ] || [ $(VERBOSE) = 'true' ] && echo false)" "false"
213217
@echo "$(PREFIX) Verbose mode: NORMAL"
218+
$(eval VERBOSE_FLAGS :=)
214219
endif
215220
endif
216221

0 commit comments

Comments
 (0)