2025-05-10 21:58:58 +08:00

57 lines
987 B
Makefile
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# Reference http://www.gnu.org/software/make/manual/make.html
#
CONFIG_USE_LOGCAT = true
MAKE = make -j32
exclude_dirs := include bin
ifneq ($(CONFIG_USE_LOGCAT), true)
exclude_dirs += ./liblog% ./logcat%
else
DEFINES += -DUSE_LOGCAT
LOGCAT = logcat
endif
dirs := $(shell find . -maxdepth 1 -type d)
dirs := $(basename $(patsubst ./%,%,$(dirs)))
dirs := $(filter-out $(exclude_dirs),$(dirs))
SUBDIRS := $(dirs)
all:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir ;\
if [ "$$?" != "0" ]; then\
echo "compile $$dir fail"; \
exit 1 ; \
fi;\
done
.PHONY: clean distclean cleanall
$(SUBDIRS):ECHO
+$(MAKE) -C $@
ECHO:
@echo begin compile $(SUBDIRS)
clean: $(clean_dirs)
for dir in $(SUBDIRS);\
do $(MAKE) -C $$dir clean;\
done
rm -rf bin
install:
for dir in $(SUBDIRS);\
do $(MAKE) -C $$dir install;\
done
distclean:
for dir in $(SUBDIRS);\
do $(MAKE) -C $$dir distclean;\
done
cleanall:
for dir in $(SUBDIRS);\
do $(MAKE) -C $$dir cleanall;\
done