Re: Re: Build Under Linux

Home › Forums › Development › Build Under Linux › Re: Re: Build Under Linux

#27491
JimShorts
Member

@dynmosaic wrote:

puddles,

One more Q for you. Right now, when I go to libs, do a make, it will start to build for every library, does not matter whether there is any change or not. Is there a way to build only when there is a change? I guess one has to put in the right dependency. So what’s the best way of achieving this?

Once the build completes there is some library that was built, buried down in the tree. This is what gets installed. Just determine a file that has to get built and use that to conditionally do the build.

For example:
dir1:
if [ ! -f libntfs/lib/libntfs.a ] ; then
cd libntfs && $(COMMAND1) ;
fi

Another thing I’d like is a target to “make clean”, but there doesn’t seem to be one. The whole thing seemed to be kind of a hack just to get the required libraries to be present.

If one were to do it right…

1)I’d put all the intelligence inside each subdirectory in libs, so each would have its own Makefile instead of the top one.
2) The top one would just have a SUBDIRS definition, and would just use an iteration mechanism to go into each subdir and make a target
3) All Makefiles would support the targets all, install and clean. You can do make clean multiple times without it erroring out (that is, all “rm” commands include the “-f” flag so they don’t fail even if the file to delete isn’t there.
4) Doing a “make all” on the toplevel would just do “make all” inside each subdirectory. Same for make install and make clean.
4) The make install step must be done by the user manually. On windows it’s “sudo make install”. On linux it’d be “sudo -E make install”. Note the -E is just to preserve the environment variables, which are needed to know where the devkitPPC tree is.

But that all would take some time to accomplish. And the real goal was tinkering with wiiMC in the first place…

ETA: Actually having the Makefiles be in each subtree can’t really work, as the Makefile itself has to be generated by using the right configure command. We had a hack I came up with where if you had a file “makefile” next to “Makefile”, the make utility itself will pick the “makefile” first. Then that file can invoke Makefile with “make -f Makefile” commands. But this won’t go over well if the OS is case insensitive.