With the attached patch it is no longer necessary to have an extra dependency step.
Hi Stefan,
thanks for your patch. Review follows.
On 24.03.2010 15:39, Stefan Reinauer wrote:
With the attached patch it is no longer necessary to have an extra dependency step. Create dependencies on the fly rather than in a separate step.
Signed-off-by: Stefan Reinauer stepan@coresystems.de
--- Makefile (revision 972) +++ Makefile (working copy) @@ -244,17 +244,14 @@ TAROPTIONS = $(shell LC_ALL=C tar --version|grep -q GNU && echo "--owner=root --group=root")
%.o: %.c .features
- $(CC) $(CFLAGS) $(CPPFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $<
- $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $<
clean:
- rm -f $(PROGRAM) *.o
- rm -f $(PROGRAM) $(OBJS) $(OBJS:.o=.d)
Unfortunately, this breaks make clean (and therefore make distclean) for non-default configurations because OBJS will only contain the currently selected modules. You can reproduce this easily with
# make CONFIG_BITBANG_SPI=yes CONFIG_GFXNVIDIA=yes CONFIG_ATAHPT=yes CONFIG_DEDIPROG=yes # make clean # ls *.o *.d atahpt.d atahpt.o bitbang_spi.d bitbang_spi.o dediprog.d dediprog.o gfxnvidia.d gfxnvidia.o
Regards, Carl-Daniel
On 3/30/10 5:12 AM, Carl-Daniel Hailfinger wrote:
Unfortunately, this breaks make clean (and therefore make distclean) for non-default configurations because OBJS will only contain the currently selected modules. You can reproduce this easily with
# make CONFIG_BITBANG_SPI=yes CONFIG_GFXNVIDIA=yes CONFIG_ATAHPT=yes CONFIG_DEDIPROG=yes # make clean
Yes, it assumes, that you specify the same build flags on make clean, too. If that's not what you want, just change the $(OBJS) stuff to *.o *.d. I initially decided against this as some people are allergic when make clean does not only clean the stuff make created but operates with wild cards.
Stefan
On 30.03.2010 09:48, Stefan Reinauer wrote:
On 3/30/10 5:12 AM, Carl-Daniel Hailfinger wrote:
Unfortunately, this breaks make clean (and therefore make distclean) for non-default configurations because OBJS will only contain the currently selected modules. You can reproduce this easily with
# make CONFIG_BITBANG_SPI=yes CONFIG_GFXNVIDIA=yes CONFIG_ATAHPT=yes CONFIG_DEDIPROG=yes # make clean
Yes, it assumes, that you specify the same build flags on make clean, too. If that's not what you want, just change the $(OBJS) stuff to *.o *.d. I initially decided against this as some people are allergic when make clean does not only clean the stuff make created but operates with wild cards.
Hm yes. The alternative would be to operate with two object lists: One for files that are compiled in, and one for files that are not compiled in.
I've followed your suggestion about replacing $(OBJS) with *.o *.d and updated the patch to apply against svn trunk. Since the changes are minimal, I kept your signoff. If you're unhappy with that, please tell me and I'll remove it. Tested with gcc and clang, works for me and seems to reduce compile time by ~5%.
This patch needs matching svn:ignore on commit.
Create dependencies on the fly rather than in a separate step.
Signed-off-by: Stefan Reinauer stepan@coresystems.de
Index: flashrom-stefan_dependencies_onestep/Makefile =================================================================== --- flashrom-stefan_dependencies_onestep/Makefile (Revision 1026) +++ flashrom-stefan_dependencies_onestep/Makefile (Arbeitskopie) @@ -65,7 +65,7 @@
PROGRAMMER_OBJS = udelay.o programmer.o
-all: pciutils features dep $(PROGRAM) +all: pciutils features $(PROGRAM)
# Set the flashrom version string from the highest revision number # of the checked out flashrom files. @@ -253,19 +253,16 @@ TAROPTIONS = $(shell LC_ALL=C tar --version|grep -q GNU && echo "--owner=root --group=root")
%.o: %.c .features - $(CC) $(CFLAGS) $(CPPFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $< + $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FEATURE_CFLAGS) $(SVNDEF) -o $@ -c $<
# Make sure to add all names of generated binaries here. # This includes all frontends and libflashrom. clean: - rm -f $(PROGRAM) $(PROGRAM).exe *.o + rm -f $(PROGRAM) $(PROGRAM).exe *.o *.d
distclean: clean - rm -f .dependencies .features .libdeps + rm -f .features .libdeps
-dep: - @$(CC) $(CPPFLAGS) $(SVNDEF) -MM $(OBJS:.o=.c) > .dependencies - strip: $(PROGRAM) $(STRIP) $(STRIP_ARGS) $(PROGRAM)
@@ -365,6 +362,6 @@ djgpp-dos: clean make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip WARNERROR=no OS_ARCH=DOS
-.PHONY: all clean distclean dep compiler pciutils features export tarball dos +.PHONY: all clean distclean compiler pciutils features export tarball dos
--include .dependencies +-include $(OBJS:.o=.d)
On 6/3/10 3:33 PM, Carl-Daniel Hailfinger wrote:
On 30.03.2010 09:48, Stefan Reinauer wrote:
On 3/30/10 5:12 AM, Carl-Daniel Hailfinger wrote:
Unfortunately, this breaks make clean (and therefore make distclean) for non-default configurations because OBJS will only contain the currently selected modules. You can reproduce this easily with
# make CONFIG_BITBANG_SPI=yes CONFIG_GFXNVIDIA=yes CONFIG_ATAHPT=yes CONFIG_DEDIPROG=yes # make clean
Yes, it assumes, that you specify the same build flags on make clean, too. If that's not what you want, just change the $(OBJS) stuff to *.o *.d. I initially decided against this as some people are allergic when make clean does not only clean the stuff make created but operates with wild cards.
Hm yes. The alternative would be to operate with two object lists: One for files that are compiled in, and one for files that are not compiled in.
I've followed your suggestion about replacing $(OBJS) with *.o *.d and updated the patch to apply against svn trunk. Since the changes are minimal, I kept your signoff. If you're unhappy with that, please tell me and I'll remove it.
No, go ahead... Thanks for doing this work
Stefan
On 03.06.2010 15:38, Stefan Reinauer wrote:
On 6/3/10 3:33 PM, Carl-Daniel Hailfinger wrote:
On 30.03.2010 09:48, Stefan Reinauer wrote:
On 3/30/10 5:12 AM, Carl-Daniel Hailfinger wrote:
Unfortunately, this breaks make clean (and therefore make distclean) for non-default configurations because OBJS will only contain the currently selected modules. You can reproduce this easily with
# make CONFIG_BITBANG_SPI=yes CONFIG_GFXNVIDIA=yes CONFIG_ATAHPT=yes CONFIG_DEDIPROG=yes # make clean
Yes, it assumes, that you specify the same build flags on make clean, too. If that's not what you want, just change the $(OBJS) stuff to *.o *.d. I initially decided against this as some people are allergic when make clean does not only clean the stuff make created but operates with wild cards.
Hm yes. The alternative would be to operate with two object lists: One for files that are compiled in, and one for files that are not compiled in.
I've followed your suggestion about replacing $(OBJS) with *.o *.d and updated the patch to apply against svn trunk. Since the changes are minimal, I kept your signoff. If you're unhappy with that, please tell me and I'll remove it.
No, go ahead... Thanks for doing this work
Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Thanks, committed in r1034.
Regards, Carl-Daniel