[FFmpeg-devel] [PATCH] Beautify build output making it easier to see compiler warnings
Georgi Chorbadzhiyski
gf
Wed Mar 3 17:57:36 CET 2010
With this patch the build output will look similar to Linux Kernel kbuild and git.
Something like this:
CC libavdevice/alldevices.c
libavdevice/alldevices.c:32: warning: no previous prototype for 'avdevice_register_all'
CC libavdevice/avdevice.c
CC libavdevice/alsa-audio-common.c
CC libavdevice/alsa-audio-dec.c
CC libavdevice/alsa-audio-enc.c
CC libavdevice/dv1394.c
CC libavdevice/oss_audio.c
CC libavdevice/v4l2.c
CC libavdevice/v4l.c
RANLIB libavdevice/libavdevice.a
CC libavformat/allformats.c
CC libavformat/cutils.c
CC libavformat/metadata.c
libavformat/metadata.c: In function 'av_metadata_set2':
libavformat/metadata.c:70: warning: assignment discards qualifiers from pointer target type
libavformat/metadata.c:74: warning: assignment discards qualifiers from pointer target type
CC libavformat/metadata_compat.c
libavformat/metadata_compat.c: In function 'ff_metadata_mux_compat':
libavformat/metadata_compat.c:132: warning: the address of 'number' will always evaluate as 'true'
libavformat/metadata_compat.c:133: warning: the address of 'number' will always evaluate as 'true'
CC libavformat/options.c
CC libavformat/os_support.c
This makes it very easy to see compiler warnings for example. If you want
to see the whole command that make executes you may use
make Q=
--
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
-------------- next part --------------
diff --git a/Makefile b/Makefile
index 5ba08fd..5506ede 100644
--- a/Makefile
+++ b/Makefile
@@ -49,8 +49,9 @@ INSTALL_PROGS_TARGETS-$(CONFIG_SHARED) = install-libs
all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
$(PROGS): %$(EXESUF): %_g$(EXESUF)
- cp -p $< $@
- $(STRIP) $@
+ @echo " STRIP $@"
+ $(Q)cp -p $< $@
+ $(Q)$(STRIP) $@
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
ALTIVEC-OBJS MMX-OBJS NEON-OBJS X86-OBJS YASM-OBJS-FFT YASM-OBJS \
@@ -73,13 +74,16 @@ ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
- $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
+ @echo " LD $<"
+ $(Q)$(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
tools/%$(EXESUF): tools/%.o
- $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
+ @echo " LD $<"
+ $(Q)$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
tools/%.o: tools/%.c
- $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
+ @echo " CC $<"
+ $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_O) $<
ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
@@ -92,14 +96,17 @@ documentation: $(addprefix doc/, developer.html faq.html ffmpeg-doc.html \
general.html libavfilter.html $(ALLMANPAGES))
doc/%.html: doc/%.texi
- texi2html -monolithic -number $<
- mv $(@F) $@
+ @echo " TEXI2HTML $<"
+ $(Q)texi2html -monolithic -number $<
+ $(Q)mv $(@F) $@
doc/%.pod: doc/%-doc.texi
- doc/texi2pod.pl $< $@
+ @echo " TEXI2POD $<"
+ $(Q)doc/texi2pod.pl $< $@
doc/%.1: doc/%.pod
- pod2man --section=1 --center=" " --release=" " $< > $@
+ @echo " POD2MAN $<"
+ $(Q)pod2man --section=1 --center=" " --release=" " $< > $@
install: $(INSTALL_TARGETS-yes)
@@ -300,19 +307,23 @@ ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
$(SRC_PATH)/tests/ffserver-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/ffserver.conf
tests/vsynth1/00.pgm: tests/videogen$(HOSTEXESUF)
- mkdir -p tests/vsynth1
- $(BUILD_ROOT)/$< 'tests/vsynth1/'
+ @echo " RUN $<"
+ $(Q)mkdir -p tests/vsynth1
+ $(Q)$(BUILD_ROOT)/$< 'tests/vsynth1/'
tests/vsynth2/00.pgm: tests/rotozoom$(HOSTEXESUF)
- mkdir -p tests/vsynth2
- $(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
+ @echo " RUN $<"
+ $(Q)mkdir -p tests/vsynth2
+ $(Q)$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
- mkdir -p tests/data
- $(BUILD_ROOT)/$< $@
+ @echo " RUN $<"
+ $(Q)mkdir -p tests/data
+ $(Q)$(BUILD_ROOT)/$< $@
tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
- $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
+ @echo " LD $<"
+ $(Q)$(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
.PHONY: documentation *test regtest-* zlib-error alltools check config
diff --git a/common.mak b/common.mak
index 5420c7d..6c02585 100644
--- a/common.mak
+++ b/common.mak
@@ -17,21 +17,25 @@ else
BUILD_ROOT_REL = ..
endif
+Q = @
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
CFLAGS += $(ECFLAGS)
%.o: %.c
+ @echo " CC $<"
$(CCDEP)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
+ $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
%.o: %.S
+ @echo " AS $<"
$(ASDEP)
- $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
+ $(Q)$(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
%.ho: %.h
- $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
+ @echo " CC $<"
+ $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
%$(EXESUF): %.c
@@ -83,10 +87,12 @@ SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-))
checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho))
$(HOSTOBJS): %.o: %.c
- $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
+ @echo " HOSTCC $<"
+ $(Q)$(HOSTCC) $(HOSTCFLAGS) -c -o $@ $<
$(HOSTPROGS): %$(HOSTEXESUF): %.o
- $(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
+ @echo " HOSTCC $<"
+ $(Q)$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
DEPS := $(OBJS:.o=.d)
depend dep: $(DEPS)
diff --git a/subdir.mak b/subdir.mak
index 2448950..fd0a018 100644
--- a/subdir.mak
+++ b/subdir.mak
@@ -11,9 +11,10 @@ all: $(SUBDIR)$(LIBNAME)
install-libs: install-lib$(NAME)-static
$(SUBDIR)$(LIBNAME): $(OBJS)
- rm -f $@
- $(AR) rc $@ $^ $(EXTRAOBJS)
- $(RANLIB) $@
+ @echo " RANLIB $@"
+ $(Q)rm -f $@
+ $(Q)$(AR) rc $@ $^ $(EXTRAOBJS)
+ $(Q)$(RANLIB) $@
endif
INCINSTDIR := $(INCDIR)/lib$(NAME)
@@ -22,7 +23,8 @@ THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
define RULES
$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
- $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
+ @echo " LD $$@"
+ $(Q)$(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
$(SUBDIR)%-test.o: $(SUBDIR)%.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c $$(CC_O) $$^
@@ -31,8 +33,9 @@ $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
$(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c $$(CC_O) $$^
$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
- $(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$@ $$< > $$(@:.o=.d)
- $(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
+ @echo " YASM $$<"
+ $(Q)$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$@ $$< > $$(@:.o=.d)
+ $(Q)$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
clean::
rm -f $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
More information about the ffmpeg-devel
mailing list