Files
demo-epb/Makefile
T
Stefan Lohmaier c54a9c55d2
Validate / build-test (macos-latest) (push) Failing after 4s
Validate / build-test (windows-latest) (push) Failing after 15s
Validate / build-test (ubuntu-latest) (push) Failing after 15s
Validate / reports (push) Has been skipped
Release / release (push) Successful in 50s
feat: Vollstaendige Demo-Doku — Safety, Manuals, Reports, API-Doc
Neue Word-Dokumente (alle aus Markdown via pandoc):

Safety (docs/safety/):
- HARA.docx — Hazard Analysis & Risk Assessment, leitet ASIL-D ab
- Safety-Case.docx — Argumentation pro Safety Goal (GSN-Stil)
- FMEDA.docx — Pro-Komponente Failure Modes + Diagnostic Coverage
- MISRA-Compliance-Statement.docx — formaler MISRA-Nachweis
- Verification-Report.docx — V-Modell rechte Seite Zusammenfassung
- Tool-Qualification-Cppcheck.docx — Tool-Qual (TCL2/ASIL-D)

Manuals (docs/manuals/):
- User-Manual.docx — Fahrerhandbuch-Auszug
- Service-Manual.docx — Werkstatt-Doku mit UDS-DTCs

CI-Erweiterungen:
- Doxyfile + `make docs` — API-Dokumentation aus src/
- tools/generate_test_report.py + `make test-report` — Test-Summary HTML
- validate.yml: Doxygen + Test-Report als CI-Artefakte
- release.yml: alle Word-Docs + Engineering-Artefakte ins Release-Bundle

README:
- Komplette Tour durch alle Artefakte
- Repo-Struktur-Diagramm aktualisiert
2026-05-12 00:55:37 -07:00

80 lines
2.5 KiB
Makefile

# Makefile fuer demo-epb. Bewusst klein gehalten, damit der Demo
# ohne externe Build-Tools (CMake, SCons) auf jedem POSIX-System baut.
CC ?= cc
CFLAGS ?= -std=c99 -Wall -Wextra -Werror -Wpedantic \
-Wcast-align -Wcast-qual -Wconversion -Wshadow \
-Wstrict-prototypes -Wmissing-prototypes
COVFLAGS = --coverage -O0 -g
SRC_DIR = src
TEST_DIR = tests/unit
BUILD = build
SRCS = $(SRC_DIR)/switch_debouncer.c \
$(SRC_DIR)/actuator_driver.c \
$(SRC_DIR)/apply_controller.c \
$(SRC_DIR)/safety_manager.c
OBJS = $(SRCS:%.c=$(BUILD)/%.o)
TESTS = test_switch_debouncer test_actuator_driver test_apply_controller \
test_safety_manager
TEST_BINS = $(TESTS:%=$(BUILD)/%)
.PHONY: all test coverage clean misra static docs test-report
all: $(TEST_BINS)
docs:
@which doxygen >/dev/null 2>&1 || { echo "doxygen not installed (brew/apt install doxygen)"; exit 1; }
doxygen Doxyfile
@echo "Doxygen HTML: $(BUILD)/api-doc/html/index.html"
test-report: $(TEST_BINS)
@$(MAKE) -s test > $(BUILD)/test-output.txt 2>&1 || true
python3 tools/generate_test_report.py
$(BUILD)/%.o: %.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(COVFLAGS) -I$(SRC_DIR) -c $< -o $@
$(BUILD)/test_%: $(TEST_DIR)/test_%.c $(OBJS)
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(COVFLAGS) -I$(SRC_DIR) -Itests $< $(OBJS) -o $@
test: $(TEST_BINS)
@echo "==========================================="
@echo "Running unit tests"
@echo "==========================================="
@fail=0; \
for t in $(TEST_BINS); do \
echo ""; \
$$t || fail=1; \
done; \
exit $$fail
coverage: test
@which lcov >/dev/null 2>&1 || { echo "lcov not installed (brew install lcov)"; exit 1; }
lcov --capture --directory $(BUILD) --output-file $(BUILD)/coverage.info
lcov --remove $(BUILD)/coverage.info '/usr/*' 'tests/*' --output-file $(BUILD)/coverage.clean.info
genhtml $(BUILD)/coverage.clean.info --output-directory $(BUILD)/coverage-html
@echo "Coverage HTML: $(BUILD)/coverage-html/index.html"
misra:
@which cppcheck >/dev/null 2>&1 || { echo "cppcheck not installed (brew install cppcheck)"; exit 1; }
cppcheck --enable=all --inconclusive --error-exitcode=1 \
--suppress=missingIncludeSystem \
--suppress=unusedFunction \
--addon=misra \
-I$(SRC_DIR) $(SRC_DIR)
static:
@which cppcheck >/dev/null 2>&1 || { echo "cppcheck not installed"; exit 1; }
cppcheck --enable=warning,style,performance,portability \
--error-exitcode=1 \
--suppress=missingIncludeSystem \
-I$(SRC_DIR) $(SRC_DIR)
clean:
rm -rf $(BUILD)