<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"DJ-Pfulio" &lt;DJPfulio@jdpfu.com&gt;<br><b>To: </b>"Atlanta Linux Enthusiasts" &lt;ale@ale.org&gt;<br><b>Sent: </b>Sunday, February 5, 2017 5:10:39 AM<br><b>Subject: </b>Re: [ale] Including Makefile<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;">It has been 15 yrs since I did any non-trivla Makefiles.<br><br>We always had 1 Makefile.inc for each C++ project, but every directory<br>had its on Makefile. &nbsp;We would chdir into each subdirectory and build<br>using the Makefile there (higher level Makefile did this), not a<br>recursive include. &nbsp;Did some fairly large projects that way - 4-teir<br>stuff. &nbsp;Builds for 12 different platforms controlled by gmake (including<br>Windows).<br><br>We didn't use symlinks - at the time, Windows didn't support that.<br><br>Might not help you.<br></blockquote><div><br></div><div>In this project I have 400+ Makefiles. &nbsp;Additional 200 that would have been, but I created a bash script instead.</div><div><br data-mce-bogus="1"></div><div>I'm working in a tree that has 20 years of history. &nbsp;Some code is that old. &nbsp;Most of it is not. &nbsp;The ideas of managing the tree are that old. &nbsp;</div><div><br data-mce-bogus="1"></div><div>There is a subdir for each package in this tree. &nbsp;Some even go deeper.</div><div><br data-mce-bogus="1"></div><div>perl-modules</div><div>&nbsp; modules</div><div>&nbsp; &nbsp; &lt;200&gt; dirs here.</div><div><br data-mce-bogus="1"></div><div>A lot of this is clean up work to reign in the management headaches of those old ways of doing things.</div><div><br data-mce-bogus="1"></div><div>An example with openssl</div><div><br data-mce-bogus="1"></div><div>Old:</div><div>&nbsp; openssl-X.X.X</div><div>&nbsp; &nbsp; &nbsp;&lt;all the files needed&gt; &nbsp;configure, Makefile, etc. &nbsp;</div><div><br data-mce-bogus="1"></div><div>New:</div><div>&nbsp; openssl-X.X.X</div><div>&nbsp; &nbsp; &nbsp;src</div><div>&nbsp; &nbsp; &nbsp; &nbsp; openssl-x.x.x.tar.xz (As downloaded from Internet)</div><div>&nbsp; &nbsp;Makefile</div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>In the old way we would compile and then loop back around and "install". &nbsp;That has always been a problem because some packages need others.</div><div>In those cases we'd include the directories of the dependents in their build. &nbsp;Over 20 years libtool created problems because finalization is done durnig 'make install' of the package using libtool like that. &nbsp;A real nightmare. &nbsp;In the new you can only install. &nbsp;You either make clean or make install. &nbsp;</div><div><br data-mce-bogus="1"></div><div>Install creates</div><div><br data-mce-bogus="1"></div><div>openssl-x.x.x:</div><div>&nbsp; build/openssl-x.x.x (unpacked tarball)</div><div>&nbsp; build/target/openssl-x.x.x-n (PKG name DESTDIR)</div><div>&nbsp; pkg/openssl-x.x.x-n.tar.xz (Results of the build ready for install)</div><div><br data-mce-bogus="1"></div><div>Last thing make install does is to install that tarball as a package, after it removes what may have</div><div>been there.</div><div><br></div><div>No more nightmare and it is a great dream!</div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>My idea on the include file is that openssl's parent has an include file that I wanted all to use. &nbsp;I was thinking up a way I could force the include in case someone forgot. &nbsp;Links would work. &nbsp;The file idea could allow me to add stuff pertinent to that child off the main directory. &nbsp;I was working on cleanup of an image that contains all the tools needed to compile for the avr, including the arduino API when needed. &nbsp;Converting from the old to the new was great. &nbsp;1000s of files now down to &lt; 30. &nbsp;At this point I've modified many of our makefiles before. &nbsp;Occasionally I added a few targets unpack,pack,and replace. &nbsp;The first two pack and unpack the src tarball in the src dir. &nbsp;Unpack if I need to make mods. &nbsp;We don't want to make mods to the build of the xample above. &nbsp;In some cases I'm working with the old method that I created a tarball from and have to look at it. &nbsp;In some cases it is our code and I want to make mods. &nbsp;The last, replace, scp's the pkg result to me lab device, removes the old, and installs it. &nbsp;This allows me to not flash firmware and reboot. &nbsp;I thought about just adding those targets to the include instead.</div><div><br data-mce-bogus="1"></div><div>The end result may be that almost all makefiles eventually go away. &nbsp;Our of 400 almost the content of those is 80% identical. &nbsp;Natural progression with something like that is that I move to the ideas of PKGBUILD, debian/rules, rh.specs.......</div><div><br data-mce-bogus="1"></div><div>The conversion work has been brutal, but we are reaping rewards now. &nbsp;The final target dir that is converted in firmware is no longer really the final. &nbsp;It is that developer's target and when they create the firmware rsync creates a copy and then a script creates the image from that. &nbsp;The new final stage removes packages not required. &nbsp;This was not possible before because there was no package management. &nbsp;If you did do this you had to know the files within a package that you wanted to remove. &nbsp;Kernel headers is in the target because the build needs it. &nbsp;The final target removes it by the package name of 'kernel-headers', &nbsp;Just like any distribution would. Perl modules used only for testing removed. &nbsp;Python used for building stuff is removed, etc. &nbsp;Environment variables control the script. &nbsp;It is called prep (prep for image) and PREPKEEPDOCS=1 will keep man pages on it. &nbsp;For development purposes and sometimes I do need to read a man page while I'm working on this stuff.</div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I'm also cleaning out bad habits. &nbsp;I've modified a lot of code. &nbsp;I've modified the kernel, drivers in the kernel, and in some cases I've added a debug interface in /proc to those drivers giving me grief. &nbsp;I've modified some of the OSS packages for better behavior in 24x7x365 environments. &nbsp;Typically I'd tag the change in the code. &nbsp;In the new I've ripped out all my changes, restored the tarball, and those changes are in a patch file at the root of that packages' build. &nbsp; I was concerned that I could not fully extract my changed from the kernel tree because of all I had made. &nbsp;I took the original source and used diff like normal. &nbsp;Nervous over nothing. :)</div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div></div></body></html>