Where I work, we have an application that has been merrily running away (and being built) on FC1 (yes, you read that right). One of my assignments is to bring this up to CentOS, but on my first effort, I ran into this interesting "feature." The original build process (FC1) uses mkdep to generate the dependency files that are subsequently used by the makes to build the app. mkdep does not exist in CentOS 5.2. There is a makedepend command that operates slightly differently. Can someone enlighten me on this, particularly w.r.t. 1) how do I use makedepend to generate the same files mkdep did and is this a good idea (my impression is that it's not really that hard but also not necessarily a good idea or 2) convert all the makefiles to be makedepend friendly (seems relatively easy, though fairly extensive, but probably a better idea and also harmless should I wish/need to continue to build on the FC1 system? Probably a really basic question or two, but neither google nor the archives have a good article on this that I could find. Thanks. mhr
MHR wrote:> Where I work, we have an application that has been merrily running > away (and being built) on FC1 (yes, you read that right). > > One of my assignments is to bring this up to CentOS, but on my first > effort, I ran into this interesting "feature." The original build > process (FC1) uses mkdep to generate the dependency files that are > subsequently used by the makes to build the app. mkdep does not exist > in CentOS 5.2. There is a makedepend command that operates slightly > differently. > > Can someone enlighten me on this, particularly w.r.t. 1) how do I use > makedepend to generate the same files mkdep did and is this a good > idea (my impression is that it's not really that hard but also not > necessarily a good idea or 2) convert all the makefiles to be > makedepend friendly (seems relatively easy, though fairly extensive, > but probably a better idea and also harmless should I wish/need to > continue to build on the FC1 system? > > Probably a really basic question or two, but neither google nor the > archives have a good article on this that I could find.That will probably build as is on CentOS-3 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 251 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos/attachments/20080704/69454187/attachment-0002.sig>
On Fri, Jul 4, 2008 at 3:08 PM, Johnny Hughes <johnny at centos.org> wrote:> > That will probably build as is on CentOS-3 >Our aim is to bring it up to 5.2 (the latest) if possible. Thanks. mhr
On Jul 4, 2008, at 17:50, MHR wrote:> One of my assignments is to bring this up to CentOS, but on my first > effort, I ran into this interesting "feature." The original build > process (FC1) uses mkdep to generate the dependency files that are > subsequently used by the makes to build the app. mkdep does not exist > in CentOS 5.2. There is a makedepend command that operates slightly > differently.I'm not 100% positive on this, but I believe that mkdep/makedepend are optional and only needed for build avoidance. If you do a "make clean" followed by a "make all" (or simply "make clean all"), it should rebuild your application from scratch (assuming that the "all" target is defined to do so) and no dependency rules are needed. It will take longer to rebuild since it has to recompile everything, but it doesn't sound like you run this build every day. Alfred
> One of my assignments is to bring this up to CentOS, but on my first > effort, I ran into this interesting "feature." The original build > process (FC1) uses mkdep to generate the dependency files that areMy FC2 system doesn't have a mkdep command.> Can someone enlighten me on this, particularly w.r.t. 1) how do I use > makedepend to generate the same files mkdep did and is this a good > idea (my impression is that it's not really that hard but also notIf you require a non-standard tool (I've really wouldn't depend on this! Even makedepend is in the X package on FC2) then you should bundle it as part of your build process. -- rgds Stephen
MHR wrote:> Where I work, we have an application that has been merrily running > away (and being built) on FC1 (yes, you read that right). > > One of my assignments is to bring this up to CentOS, but on my first > effort, I ran into this interesting "feature." The original build > process (FC1) uses mkdep to generate the dependency files that are > subsequently used by the makes to build the app. mkdep does not exist > in CentOS 5.2. There is a makedepend command that operates slightly > differently. > > Can someone enlighten me on this, particularly w.r.t. 1) how do I use > makedepend to generate the same files mkdep did and is this a good > idea (my impression is that it's not really that hard but also not > necessarily a good idea or 2) convert all the makefiles to be > makedepend friendly (seems relatively easy, though fairly extensive, > but probably a better idea and also harmless should I wish/need to > continue to build on the FC1 system? >At some point a long time ago I was using makedep/makedepend, but I replaced that with gcc -MM to generate the Makefile dependancies automatically. man gcc, search for -MM will tell you more. Here's an excerpt from one of my project's Makefile, in case it helps. ################################################################# # making the dependancy files ################################################################# # each .c file has a corresponding .d file in the deps/ subdir. # This .d file holds the dependancies for the .o. # The .d is rebuilt automatically whenever the deps may have changed. # the dependency files # following only seems to work with gnu make, patsubst should be more standard #DEPS := $(SRCS:%.c=deps/%.d) DEPS := $(patsubst %.c,deps/%.d,$(SRCS)) # rule to build the .d files # the output of gcc -MM is something like: # $ gcc -MM pools.c # pools.o: pools.c config.h types.h pools.h fonc.h # the perl line then changes this into: # pools.o deps/pools.d: pools.c config.h types.h pools.h fonc.h # Therefore each .d depends on all the files that the corresponding # .o depends on, and will be rebuilt when necessary. # I think this can be useful for conditional includes, for example # if pools.c has a block: # #ifdef GMP # #include "gmp.h" # #endif # and GMP is defined in config.h... deps/%.d: %.c @echo rebuilding dependancy file $@ @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< | $(PERL) -e '\''while(<>){s/^(.*)\.o:/$$1.o deps\/$$1.d:/g;print;}'\''> $@' # include all dep files include $(DEPS)