$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
这句话可能的没有看明白
测试如下:
# names := a b c d
# $(foreach n, $(names), $(shell echo $(n).o))
FFLIBS := avdevice avformat avcodec avutil swscale
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
HOSTPROGS BUILT_HEADERS
define RESET
$(1) :=
$(1)-yes :=
endef
define DOSUBDIR
$(foreach V,$(SUBDIR_VARS),$(shell echo -e "$(call RESET,$(V))***"))
SUBDIR := $(1)/
include $(1)/Makefile
endef
all :
$(foreach D,$(FFLIBS),$(shell echo -e "$(call DOSUBDIR,lib$(D))\n\n"))
测试结果:(需要调整版式)
OBJS :=
OBJS-yes :=
FFLIBS :=
FFLIBS-yes :=
CLEANFILES :=
CLEANFILES-yes :=
DIRS :=
DIRS-yes :=
TESTPROGS :=
TESTPROGS-yes :=
EXAMPLES :=
EXAMPLES-yes :=
SKIPHEADERS :=
SKIPHEADERS-yes :=
ALTIVEC-OBJS :=
ALTIVEC-OBJS-yes :=
MMX-OBJS :=
MMX-OBJS-yes :=
NEON-OBJS :=
NEON-OBJS-yes :=
X86-OBJS :=
X86-OBJS-yes :=
YASM-OBJS-FFT :=
YASM-OBJS-FFT-yes :=
YASM-OBJS :=
YASM-OBJS-yes :=
HOSTPROGS :=
HOSTPROGS-yes :=
BUILT_HEADERS :=
BUILT_HEADERS-yes :=
SUBDIR := libavdevice/
include libavdevice/Makefile
OBJS :=OBJS-yes :=
FFLIBS :=FFLIBS-yes :=
CLEANFILES :=CLEANFILES-yes :=
DIRS :=DIRS-yes :=
TESTPROGS :=TESTPROGS-yes :=
EXAMPLES :=EXAMPLES-yes :=
SKIPHEADERS :=SKIPHEADERS-yes :=
ALTIVEC-OBJS :=ALTIVEC-OBJS-yes :=
MMX-OBJS :=MMX-OBJS-yes :=
NEON-OBJS :=NEON-OBJS-yes :=
X86-OBJS :=X86-OBJS-yes :=
YASM-OBJS-FFT :=YASM-OBJS-FFT-yes :=
YASM-OBJS :=YASM-OBJS-yes :=
HOSTPROGS :=HOSTPROGS-yes :=
BUILT_HEADERS :=BUILT_HEADERS-yes :=***SUBDIR := libavformat/include libavformat/Makefile OBJS :=OBJS-yes :=
FFLIBS :=FFLIBS-yes :=
CLEANFILES :=CLEANFILES-yes :=
DIRS :=DIRS-yes :=
TESTPROGS :=TESTPROGS-yes :=
EXAMPLES :=EXAMPLES-yes :=
SKIPHEADERS :=SKIPHEADERS-yes :=
ALTIVEC-OBJS :=ALTIVEC-OBJS-yes :=
MMX-OBJS :=MMX-OBJS-yes :=
NEON-OBJS :=NEON-OBJS-yes :=
X86-OBJS :=X86-OBJS-yes :=
YASM-OBJS-FFT :=YASM-OBJS-FFT-yes :=
YASM-OBJS :=YASM-OBJS-yes :=
HOSTPROGS :=HOSTPROGS-yes :=
BUILT_HEADERS :=BUILT_HEADERS-yes :=***SUBDIR := libavcodec/include libavcodec/Makefile OBJS :=OBJS-yes :=
FFLIBS :=FFLIBS-yes :=
CLEANFILES :=CLEANFILES-yes :=
DIRS :=DIRS-yes :=
TESTPROGS :=TESTPROGS-yes :=
EXAMPLES :=EXAMPLES-yes :=
SKIPHEADERS :=SKIPHEADERS-yes :=
ALTIVEC-OBJS :=ALTIVEC-OBJS-yes :=
MMX-OBJS :=MMX-OBJS-yes :=
NEON-OBJS :=NEON-OBJS-yes :=
X86-OBJS :=X86-OBJS-yes :=
YASM-OBJS-FFT :=YASM-OBJS-FFT-yes :=
YASM-OBJS :=YASM-OBJS-yes :=
HOSTPROGS :=HOSTPROGS-yes :=
BUILT_HEADERS :=BUILT_HEADERS-yes :=***SUBDIR := libavutil/include libavutil/Makefile OBJS :=OBJS-yes :=
FFLIBS :=FFLIBS-yes :=
CLEANFILES :=CLEANFILES-yes :=
DIRS :=DIRS-yes :=
TESTPROGS :=TESTPROGS-yes :=
EXAMPLES :=EXAMPLES-yes :=
SKIPHEADERS :=SKIPHEADERS-yes :=
ALTIVEC-OBJS :=ALTIVEC-OBJS-yes :=
MMX-OBJS :=MMX-OBJS-yes :=
NEON-OBJS :=NEON-OBJS-yes :=
X86-OBJS :=X86-OBJS-yes :=
YASM-OBJS-FFT :=YASM-OBJS-FFT-yes :=
YASM-OBJS :=YASM-OBJS-yes :=
HOSTPROGS :=HOSTPROGS-yes :=
BUILT_HEADERS :=BUILT_HEADERS-yes :=***SUBDIR := libswscale/include libswscale/Makefile
最终是否是这个意思,欢迎留言讨论
阅读(3814) | 评论(0) | 转发(0) |