From nobody Wed Feb 07 20:12:42 2024 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TVWWX0F6Pz5B0rc for ; Wed, 7 Feb 2024 20:12:56 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "holgerdanske.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TVWWV6rwMz462R for ; Wed, 7 Feb 2024 20:12:54 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=holgerdanske.com header.s=nov-20210719-112354 header.b=jFxvkcAm; dmarc=pass (policy=none) header.from=holgerdanske.com; spf=pass (mx1.freebsd.org: domain of dpchrist@holgerdanske.com designates 184.105.128.27 as permitted sender) smtp.mailfrom=dpchrist@holgerdanske.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=holgerdanske.com; s=nov-20210719-112354; t=1707336766; bh=9j6+pu3GOPaiyVHvnHPHMNpZ+7+ULMUzBDQMfMtKaMo=; h=Received:Message-ID:Date:MIME-Version:User-Agent:Subject: Content-Language:To:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=jFxvkcAmiPMl/4etCHn4oY5AhDIso6nkdubh+lSXA6l+kLKv8igmU8Y0MCWl6xPwM SUo24aYrL0r08Addc/zurp+szYOoEAKKQcKScTo+2Y5WtNuGzgPhqPZpC/N8K0cSiR svrxfTpT6Ok4pF7qbcXJx0XxEZa1jx7nxSmbc8r/dCS73bhlDskZcAJBMTWhDWi7lp ss7NPZVdmnfsTxYzmNONXjZXWGl4CtQAXaliytyAYy0KR5yY+8PRlce3eE6HdD4N/o YOWw+hlTiKFg1wBgbhxO3490h5dWXUAkVkpFvARlUxkVGWRPghMrCm5wZzB9n5RUFF 0m6aXuTntshlr9bv/EE2jWRTD+qzLc9oTbLcq+jDC8w/Hq/DK4TyRNSeBoJJeArPb8 GGChxAwaEYTM0KopSj98tSuslflGHZCY2zUZh3M8vht2Z1cAQ/q93bNNBEH1xDiJ7V 4Ky6TlbRMq+5T/iYfR1ozQTXEPBxp5cJT8d5/60Rkksi1/5O2zH0+Yw5JmwPX/dQ31 00+DQck8AaDAwjEgjr8BObErPKlARqeqnRw62p9VYc0/Dk00wyHNGarFAjN4BiKik5 lSPyuHYqqTX3Jnutn13e0oPFPXMkQ8lp6k4VKDOKZ4zZAENFMpTpcGdoehQuQxLmCQ s9rKIF18UU5Jd6NMzCL69HIk= Received: from 99.100.19.101 (99-100-19-101.lightspeed.frokca.sbcglobal.net [99.100.19.101]) by holgerdanske.com with ESMTPSA (TLS_AES_128_GCM_SHA256:TLSv1.3:Kx=any:Au=any:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN) for ; Wed, 7 Feb 2024 12:12:46 -0800 Message-ID: <54278033-5eda-4c7b-aa66-3ba5e5c5988a@holgerdanske.com> Date: Wed, 7 Feb 2024 12:12:42 -0800 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Need help with a makefile [RESOLVED] Content-Language: en-US To: questions@freebsd.org References: <8_kmThiamXBYyS8xs6DcL-Sdkr244nfiKNXas7jkXifkzGss3sleWGJN6n4BV7jof6jpKK9vHnYVpKImQHAbGuGlJindprbvtRFh04q_PI4=@proton.me> From: David Christensen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.43 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.54)[-0.542]; DMARC_POLICY_ALLOW(-0.50)[holgerdanske.com,none]; R_DKIM_ALLOW(-0.20)[holgerdanske.com:s=nov-20210719-112354]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; XM_UA_NO_VERSION(0.01)[]; DKIM_TRACE(0.00)[holgerdanske.com:+]; RCVD_TLS_ALL(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:6939, ipnet:184.104.0.0/15, country:US]; ARC_NA(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: 4TVWWV6rwMz462R 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