From: Dave S. <da...@sm...> - 2005-08-30 21:09:29
|
Craig Hughes wrote: > On Aug 30, 2005, at 12:21 PM, Dave Smith wrote: > >> I've just started doing something similar myself. My idea was to >> modify the .mk files for non core stuff to use a new env var $ >> (TARGETUL_DIR) instead of $(TARGET_DIR). This for XM owners would >> be a synomym for TARGET_DIR, but for others it would effectively >> point to a /usr/local directory on the MMC card mounted in a card >> reader (or something similar). > > >> This would then give you a switch (i.e. where you pointed >> TARGETUL_DIR) to either everything in root_fs, or secondary packages >> going uncompressed onto the MMC > > > I don't like this approach as much as having 2 sets of targets, where > it defined TARGET_DIR differently for the two set of sub-makes. The > way you propose means that if you change your mind and want to > install to flash instead of MMC or vice-versa, you have to edit lots > of make files, changing lots of lines in each file. My way, you only > need to change the top-level Makefile to move the target(s) you > changed your mind about into the other variable. Fundamentally, the > *.mk makefiles shouldn't really have to know what the ultimate > destination is. They should just build themselves in whatever > upstream says their environment is, and then some later step does the > actual packaging (eg jffs2root.mk or mmcoverlay.mk which can be > written to look in the other target dir) > > C If you wanted to move from Flash to MMC, you would only need to change the definition of the TARGETUL_DIR variable and all secondary targets would then get shifted to MMC. There would be a one off hit in modifying some of the *.mk files, but that would be a simple search & replace for TARGET_DIR to TARGETUL_DIR for each target that was to be potentially MMCised. They wouldn't know their final target, as that would be set by the top level makefile. I don't see where you would define the second set of targets. It's on a back burner right now anyway, so I'm happy to drop it if there is something better coming up :) Regards, Dave |