Skip to content

Commit ce45460

Browse files
committed
Makefile/mem_stats: only modules Makfiles are used
Without specifying a depth, when building per-groups statistics, only modules' Makefiles should be used, not other whatever libs are in each module. This commit is needed because the wolfssl libs has its own Makefile, with its own NAME= variables declared, resulting in redundant (and unused) declarations.
1 parent 197dd6a commit ce45460

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Makefile.defs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ endif
529529

530530
ifneq (,$(MEM_STATS_HDR))
531531
EXPECTED_MD5=$(shell [ -f $(MEM_STATS_HDR) ] && tail -n 1 $(MEM_STATS_HDR) | awk '{print $$4}')
532-
MODULES_MD5=$(shell find $(dir $(MEM_STATS_HDR))/../modules -name "[Mm]akefile" | \
533-
awk -F/ '{print $$(NF - 1)}' | sort | $(md5sum_cmd) | awk '{print $$1}')
532+
MODULES_MD5=$(shell find $(dir $(MEM_STATS_HDR))/../modules -maxdepth 2 -name "[Mm]akefile" | \
533+
awk -F/ '{print $$(NF - 1)}' | sort -u | $(md5sum_cmd) | awk '{print $$1}')
534534
ifneq ($(EXPECTED_MD5),$(MODULES_MD5))
535535
REGENERATE_MEM_STATS=remove-mem-stats
536536
endif

Makefile.modules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ else
4242
md5sum_cmd = md5sum
4343
endif
4444
EXPECTED_MD5=$(shell [ -f $(MEM_STATS_HDR) ] && tail -n 1 $(MEM_STATS_HDR) | awk '{print $$4}')
45-
MODULES_MD5=$(shell find $(dir $(MEM_STATS_HDR))/../modules -name "[Mm]akefile" | \
46-
awk -F/ '{print $$(NF - 1)}' | sort | $(md5sum_cmd) | awk '{print $$1}')
45+
MODULES_MD5=$(shell find $(dir $(MEM_STATS_HDR))/../modules -maxdepth 2 -name "[Mm]akefile" | \
46+
awk -F/ '{print $$(NF - 1)}' | sort -u | $(md5sum_cmd) | awk '{print $$1}')
4747
ifneq ($(EXPECTED_MD5),$(MODULES_MD5))
4848
REGENERATE_MEM_STATS=remove-mem-stats
4949
endif

Makefile.rules

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ Makefile.conf: Makefile.conf.template
6868

6969
# no need to generate mem/mem_stats.c from anywhere else
7070
mem/mem_stats.c: mem/mem_stats.h
71-
@find modules/ -name "[Mm]akefile" -exec grep "NAME\s*=" {} \; \
72-
| awk 'BEGIN { FS = "[=\\. ]"; \
71+
@find modules/ -maxdepth 2 -name "[Mm]akefile" -exec grep "NAME\s*=" {} \; \
72+
| sort -u | awk 'BEGIN { FS = "[=\\. ]"; \
7373
print "/* This file is auto-generated by running \"make generate-mem-stats\" */"; \
7474
print "/* You should NOT edit this file manually */"; \
7575
print "#ifdef SHM_EXTRA_STATS"; \
@@ -82,8 +82,8 @@ remove-mem-stats:
8282
-@rm -f $(MEM_STATS_HDR)
8383

8484
%mem_stats.h: $(REGENERATE_MEM_STATS)
85-
@find $(dir $@)/../modules/ -name "[Mm]akefile" -exec grep "NAME\s*=" {} \; \
86-
| awk 'BEGIN { FS = "[=\\. ]"; \
85+
@find $(dir $@)/../modules/ -maxdepth 2 -name "[Mm]akefile" -exec grep "NAME\s*=" {} \; \
86+
| sort -u | awk 'BEGIN { FS = "[=\\. ]"; \
8787
print "/* This file is auto-generated by running \"make generate-mem-stats\" */"; \
8888
print "/* You should NOT edit this file manually */"; \
8989
print "#ifdef SHM_EXTRA_STATS"; \

0 commit comments

Comments
 (0)