Re: Need help with a makefile [RESOLVED]

From: David Christensen <dpchrist_at_holgerdanske.com>
Date: Wed, 07 Feb 2024 20:12:42 UTC
On 2/7/24 11:36, Mehmet Erol Sanliturk wrote:
> Assume you have a program to be compiled in different operating systems .
> Actually to maintain  ONE make file for ALL involved operating systems may
> be
> very difficult not only for you but also for your users .
> 
> Instead of trying to use one make file , the following approach may be more
> easy to manage
> ( This idea is not originally developed by me , but I have learned it from
> other people ) :
> 
> For each different OS , define a directory with a make file specific to the
> OS .
> Since the make file is specific to the OS , if a user does not use that OS
> , make file
> will not cause any difficulty .
> 
> If a change is made in one of the OS make files , it will not affect the
> other OS make files .
> 
> If some parts are common to different OS make files , these parts may be
> stored into a separate
> directory and may be included into relevant make files .
> 
> Use of such a division of make files may eliminate a large number of "if"
> conditional and sometimes conflicting
> statements required to be used in a single common file .


Portability is not a new problem and TIMTOWTDI.  If the OP's code is 
destined for multiple platforms, perhaps the learning curve of power 
tools would be justified:

https://www.gnu.org/software/automake/

https://www.gnu.org/software/autoconf/


David