mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
minor tidy up
This commit is contained in:
38
Makefile
38
Makefile
@@ -3,8 +3,25 @@
|
|||||||
# This is mainly used to generate the .o files for SonarQube analysis
|
# This is mainly used to generate the .o files for SonarQube analysis
|
||||||
#
|
#
|
||||||
|
|
||||||
NUMJOBS=${NUMJOBS:-" -j10 "}
|
_mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||||
MAKEFLAGS+="j "
|
I := $(patsubst %/,%,$(dir $(_mkfile_path)))
|
||||||
|
|
||||||
|
ifneq ($(words $(MAKECMDGOALS)),1)
|
||||||
|
.DEFAULT_GOAL = all
|
||||||
|
%:
|
||||||
|
@$(MAKE) $@ --no-print-directory -rRf $(firstword $(MAKEFILE_LIST))
|
||||||
|
else
|
||||||
|
ifndef ECHO
|
||||||
|
T := $(shell $(MAKE) $(MAKECMDGOALS) --no-print-directory \
|
||||||
|
-nrRf $(firstword $(MAKEFILE_LIST)) \
|
||||||
|
ECHO="COUNTTHIS" | grep -c "COUNTTHIS")
|
||||||
|
N := x
|
||||||
|
C = $(words $N)$(eval N := x $N)
|
||||||
|
ECHO = python $(I)/echo_progress.py --stepno=$C --nsteps=$T
|
||||||
|
endif
|
||||||
|
|
||||||
|
JOBS ?= $(shell nproc)
|
||||||
|
MAKEFLAGS += -j $(JOBS) -l $(JOBS)
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# Project Structure
|
# Project Structure
|
||||||
@@ -125,23 +142,27 @@ COMPILE.cpp = $(CXX) $(CXX_STANDARD) $(CXXFLAGS) $(DEPFLAGS) -c $< -o $@
|
|||||||
.SILENT: $(OUTPUT)
|
.SILENT: $(OUTPUT)
|
||||||
|
|
||||||
all: $(OUTPUT)
|
all: $(OUTPUT)
|
||||||
|
@$(ECHO) All done
|
||||||
|
|
||||||
$(OUTPUT): $(OBJS)
|
$(OUTPUT): $(OBJS)
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
|
@$(ECHO) Linking $@
|
||||||
$(LINK.o)
|
$(LINK.o)
|
||||||
$(SYMBOLS.out)
|
$(SYMBOLS.out)
|
||||||
|
|
||||||
$(BUILD)/%.o: %.c
|
$(BUILD)/%.o: %.c
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(COMPILE.c)
|
@$(ECHO) Compiling $@
|
||||||
|
@$(COMPILE.c)
|
||||||
|
|
||||||
$(BUILD)/%.o: %.cpp
|
$(BUILD)/%.o: %.cpp
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(COMPILE.cpp)
|
@$(ECHO) Compiling $@
|
||||||
|
@$(COMPILE.cpp)
|
||||||
|
|
||||||
$(BUILD)/%.o: %.s
|
$(BUILD)/%.o: %.s
|
||||||
@mkdir -p $(@D)
|
@mkdir -p $(@D)
|
||||||
$(COMPILE.s)
|
@$(COMPILE.s)
|
||||||
|
|
||||||
cppcheck: $(SOURCES)
|
cppcheck: $(SOURCES)
|
||||||
$(CPPCHECK) $(CHECKFLAGS) $^
|
$(CPPCHECK) $(CHECKFLAGS) $^
|
||||||
@@ -150,6 +171,7 @@ run: $(OUTPUT)
|
|||||||
@$<
|
@$<
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@$(RM) -rf $(BUILD) $(OUTPUT)
|
@$(RM) -rf $(BUILD) $(OUTPUT)
|
||||||
|
|
||||||
@@ -157,4 +179,6 @@ help:
|
|||||||
@echo available targets: all run clean
|
@echo available targets: all run clean
|
||||||
@echo $(OUTPUT)
|
@echo $(OUTPUT)
|
||||||
|
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
22
cspell.json
22
cspell.json
@@ -9,5 +9,25 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dictionaries": ["project-words"],
|
"dictionaries": ["project-words"],
|
||||||
"ignorePaths": ["node_modules", "compile_commands.json", "WWWData.h", "**/venv/**", "lib/eModbus", "lib/ESPAsyncWebServer", "lib/espMqttClient", "analyse.html", "dist", "**/*.csv", "**/*.md", "**/*.py", "locale_translations.h", "TZ.tsx", "**/*.txt","build/**", "**/i18n/**", "/project-words.txt"]
|
"ignorePaths": [
|
||||||
|
"node_modules",
|
||||||
|
"compile_commands.json",
|
||||||
|
"WWWData.h", "**/venv/**",
|
||||||
|
"lib/eModbus",
|
||||||
|
"lib/ESPAsyncWebServer",
|
||||||
|
"lib/espMqttClient",
|
||||||
|
"analyse.html",
|
||||||
|
"dist",
|
||||||
|
"**/*.csv",
|
||||||
|
"**/*.md",
|
||||||
|
"**/*.py",
|
||||||
|
"locale_translations.h",
|
||||||
|
"TZ.tsx",
|
||||||
|
"**/*.txt",
|
||||||
|
"build/**",
|
||||||
|
"**/i18n/**",
|
||||||
|
"/project-words.txt",
|
||||||
|
"Makefile",
|
||||||
|
"src/modbus_entity_parameters.hpp"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
27
echo_progress.py
Normal file
27
echo_progress.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
"""
|
||||||
|
Print makefile progress
|
||||||
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import math
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
parser.add_argument("--stepno", type=int, required=True)
|
||||||
|
parser.add_argument("--nsteps", type=int, required=True)
|
||||||
|
parser.add_argument("remainder", nargs=argparse.REMAINDER)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
nchars = int(math.log(args.nsteps, 10)) + 1
|
||||||
|
fmt_str = "[{:Xd}/{:Xd}]({:6.2f}%)".replace("X", str(nchars))
|
||||||
|
progress = 100 * args.stepno / args.nsteps
|
||||||
|
sys.stdout.write(fmt_str.format(args.stepno, args.nsteps, progress))
|
||||||
|
for item in args.remainder:
|
||||||
|
sys.stdout.write(" ")
|
||||||
|
sys.stdout.write(item)
|
||||||
|
sys.stdout.write("\n")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ EOL
|
|||||||
|
|
||||||
# build emsesp for standalone
|
# build emsesp for standalone
|
||||||
make clean
|
make clean
|
||||||
make ARGS=-DEMSESP_STANDALONE
|
make -s ARGS=-DEMSESP_STANDALONE
|
||||||
|
|
||||||
# Generate Modbus entity parameters
|
# Generate Modbus entity parameters
|
||||||
# One to build the modbus_entity_parameters.hpp header file
|
# One to build the modbus_entity_parameters.hpp header file
|
||||||
@@ -43,7 +43,7 @@ echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py | python3 ./
|
|||||||
ls -al ./src/modbus_entity_parameters.hpp
|
ls -al ./src/modbus_entity_parameters.hpp
|
||||||
|
|
||||||
# dump_entities.csv
|
# dump_entities.csv
|
||||||
make ARGS=-DEMSESP_STANDALONE
|
make -s ARGS=-DEMSESP_STANDALONE
|
||||||
rm -f ./docs/dump_entities.csv
|
rm -f ./docs/dump_entities.csv
|
||||||
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py >./docs/dump_entities.csv
|
echo "test entity_dump" | ./emsesp | python3 ./scripts/strip_csv.py >./docs/dump_entities.csv
|
||||||
ls -al ./docs/dump_entities.csv
|
ls -al ./docs/dump_entities.csv
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# run from root
|
# run from root
|
||||||
# make sure ncu is installed globally (https://github.com/raineorshine/npm-check-updates)
|
# make sure ncu is installed globally (https://github.com/raineorshine/npm-check-updates)
|
||||||
|
# as well as GNUMake (make) and python3
|
||||||
|
|
||||||
cd interface
|
cd interface
|
||||||
ncu -u
|
ncu -u
|
||||||
@@ -16,4 +17,7 @@ yarn set version stable
|
|||||||
yarn
|
yarn
|
||||||
yarn format
|
yarn format
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
npx cspell "**"
|
||||||
|
|
||||||
|
sh ./scripts/generate_csv_and_headers.sh
|
||||||
Reference in New Issue
Block a user