cpp_prac/Makefile
2025-01-11 17:54:08 +01:00

24 lines
533 B
Makefile

# SUBDIRS = dir1 dir2 dir3
SUBDIRS := $(shell find . -mindepth 1 -maxdepth 1 -type d -exec test -e "{}/Makefile" \; -print)
build: $(SUBDIRS)
@for dir in $(SUBDIRS); do \
$(MAKE) -j$(nproc) -C $$dir; \
done
test: $(SUBDIRS) build
@for dir in $(SUBDIRS); do \
$(MAKE) -j$(nproc) test -C $$dir; \
done
clean:
@for dir in $(SUBDIRS); do \
make -C $$dir clean; \
done
format:
find . -type f \( -name "*.cc" -o -name "*.cpp" -o -name "*.h" -o -name "*.c" \) -exec clang-format -i {} \;
.PHONY: build clean test format