Hi,
abuild's scanbuild support was broken, and we didn't noticed. Following patch also cleans up some rough edges.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Index: util/abuild/abuild =================================================================== --- util/abuild/abuild (revision 5455) +++ util/abuild/abuild (working copy) @@ -430,12 +430,15 @@ stime=`perl -e 'print time();' 2>/dev/null || date +%s` create_buildenv $VENDOR $MAINBOARD $CONFIG if [ $? -eq 0 -a $configureonly -eq 0 ]; then + if [ "$scanbuild" = "true" ]; then + rm -rf $TARGET/scan-build-results-tmp + fi compile_target $VENDOR $MAINBOARD && xml " <status>ok</status>" || xml "<status>broken</status>" if [ "$scanbuild" = "true" ]; then + rm -rf $TARGET/${VENDOR}_${MAINBOARD}-scanbuild mv `dirname $TARGET/scan-build-results-tmp/*/index.html` $TARGET/${VENDOR}_${MAINBOARD}-scanbuild - MAKE=$origMAKE fi fi # Not calculated here because we still print it in compile_target Index: Makefile =================================================================== --- Makefile (revision 5455) +++ Makefile (working copy) @@ -155,6 +155,10 @@ mkdir -p $(obj)/mainboard/$(MAINBOARDDIR) $(objutil)/sconfig/sconfig $(MAINBOARDDIR) $(obj)/mainboard/$(MAINBOARDDIR)
+$(obj)/%.o: $(obj)/%.c $(obj)/config.h + printf " CC $(subst $(obj)/,,$(@))\n" + $(CC) -MMD $(CFLAGS) -c -o $@ $< + objs:=$(obj)/mainboard/$(MAINBOARDDIR)/static.o initobjs:= drivers:=
On 4/19/10 11:59 AM, Patrick Georgi wrote:
--- Makefile (revision 5455) +++ Makefile (working copy) @@ -155,6 +155,10 @@ mkdir -p $(obj)/mainboard/$(MAINBOARDDIR) $(objutil)/sconfig/sconfig $(MAINBOARDDIR) $(obj)/mainboard/$(MAINBOARDDIR)
+$(obj)/%.o: $(obj)/%.c $(obj)/config.h
printf " CC $(subst $(obj)/,,$(@))\n"
$(CC) -MMD $(CFLAGS) -c -o $@ $<
objs:=$(obj)/mainboard/$(MAINBOARDDIR)/static.o initobjs:= drivers:=
This hunk breaks compiling sconfig on my system. Changing it to the following fixes it again:
Index: Makefile =================================================================== --- Makefile (revision 5455) +++ Makefile (working copy) @@ -356,11 +356,20 @@ ifeq ($(_OS),CYGWIN_) STACK=-Wl,--stack,16384000 endif + $(objutil)/romcc/romcc: $(top)/util/romcc/romcc.c @printf " HOSTCC $(subst $(obj)/,,$(@)) (this may take a while)\n" @# Note: Adding -O2 here might cause problems. For details see: @# http://www.coreboot.org/pipermail/coreboot/2010-February/055825.html $(HOSTCC) -g $(STACK) -Wall -o $@ $<
+$(obj)/%.o: $(obj)/%.c $(obj)/config.h + printf " CC $(subst $(obj)/,,$(@))\n" + $(CC) -MMD $(CFLAGS) -c -o $@ $< + +$(obj)/util/%.o: $(obj)/util/%.c $(obj)/config.h + printf " HOSTCC $(subst $(obj)/,,$(@))\n" + $(HOSTCC) -MMD $(HOSTCFLAGS) -c -o $@ $< + .PHONY: $(PHONY) prepare clean distclean doxygen doxy coreboot .xcompile
Am 19.04.2010 15:08, schrieb Stefan Reinauer:
This hunk breaks compiling sconfig on my system. Changing it to the following fixes it again:
+$(obj)/util/%.o: $(obj)/util/%.c $(obj)/config.h
This should be +$(objutil)/%.o: $(objutil)/%.c $(obj)/config.h
- printf " HOSTCC $(subst $(obj)/,,$(@))\n"
- $(HOSTCC) -MMD $(HOSTCFLAGS) -c -o $@ $<
Other than that, you're right. I didn't notice because abuild always keeps objutil outside obj.
Patrick
Am 19.04.2010 17:56, schrieb Patrick Georgi:
Am 19.04.2010 15:08, schrieb Stefan Reinauer:
This hunk breaks compiling sconfig on my system. Changing it to the following fixes it again:
+$(obj)/util/%.o: $(obj)/util/%.c $(obj)/config.h
This should be +$(objutil)/%.o: $(objutil)/%.c $(obj)/config.h
- printf " HOSTCC $(subst $(obj)/,,$(@))\n"
- $(HOSTCC) -MMD $(HOSTCFLAGS) -c -o $@ $<
Other than that, you're right. I didn't notice because abuild always keeps objutil outside obj.
New version. Tested with abuild and without (ie. with $(objutil) inside $(obj)) Index: util/abuild/abuild =================================================================== --- util/abuild/abuild (revision 5455) +++ util/abuild/abuild (working copy) @@ -430,12 +430,15 @@ stime=`perl -e 'print time();' 2>/dev/null || date +%s` create_buildenv $VENDOR $MAINBOARD $CONFIG if [ $? -eq 0 -a $configureonly -eq 0 ]; then + if [ "$scanbuild" = "true" ]; then + rm -rf $TARGET/scan-build-results-tmp + fi compile_target $VENDOR $MAINBOARD && xml " <status>ok</status>" || xml "<status>broken</status>" if [ "$scanbuild" = "true" ]; then + rm -rf $TARGET/${VENDOR}_${MAINBOARD}-scanbuild mv `dirname $TARGET/scan-build-results-tmp/*/index.html` $TARGET/${VENDOR}_${MAINBOARD}-scanbuild - MAKE=$origMAKE fi fi # Not calculated here because we still print it in compile_target Index: Makefile =================================================================== --- Makefile (revision 5455) +++ Makefile (working copy) @@ -151,10 +151,18 @@ # needed objects that every mainboard uses # Creation of these is architecture and mainboard independent $(obj)/mainboard/$(MAINBOARDDIR)/static.c: $(src)/mainboard/$(MAINBOARDDIR)/devicetree.cb $(objutil)/sconfig/sconfig - @printf " SCONFIG $(subst $(src)/,,$(<))\n" + printf " SCONFIG $(subst $(src)/,,$(<))\n" mkdir -p $(obj)/mainboard/$(MAINBOARDDIR) $(objutil)/sconfig/sconfig $(MAINBOARDDIR) $(obj)/mainboard/$(MAINBOARDDIR)
+$(objutil)/%.o: $(objutil)/%.c $(obj)/config.h + printf " HOSTCC $(subst $(objutil)/,,$(@))\n" + $(HOSTCC) -MMD $(HOSTCFLAGS) -c -o $@ $< + +$(obj)/%.o: $(obj)/%.c $(obj)/config.h + printf " CC $(subst $(obj)/,,$(@))\n" + $(CC) -MMD $(CFLAGS) -c -o $@ $< + objs:=$(obj)/mainboard/$(MAINBOARDDIR)/static.o initobjs:= drivers:=
On 4/19/10 10:17 PM, Patrick Georgi wrote:
Am 19.04.2010 17:56, schrieb Patrick Georgi:
Am 19.04.2010 15:08, schrieb Stefan Reinauer:
This hunk breaks compiling sconfig on my system. Changing it to the following fixes it again:
+$(obj)/util/%.o: $(obj)/util/%.c $(obj)/config.h
This should be +$(objutil)/%.o: $(objutil)/%.c $(obj)/config.h
- printf " HOSTCC $(subst $(obj)/,,$(@))\n"
- $(HOSTCC) -MMD $(HOSTCFLAGS) -c -o $@ $<
Other than that, you're right. I didn't notice because abuild always keeps objutil outside obj.
New version. Tested with abuild and without (ie. with $(objutil) inside $(obj))
Acked-by: Stefan Reinauer stepan@coresystems.de