From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.43.69] (unknown [182.2.75.207]) by gnuweeb.org (Postfix) with ESMTPSA id 42EFE7E6CA; Wed, 9 Mar 2022 00:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1646786479; bh=Uw6X5Lk8FqzvsSIuTvcDgkig1zAgSiWVyzC5BXTQ4Gg=; h=Date:To:Cc:References:From:Subject:In-Reply-To:From; b=jji03fbdB+fFbmktVHTOGaWI2ix1Gfd29ydJHG5FVWanZIHvJrdiTBuRz8Vjj/C9Y 1fflPGTuZEa0zaVkq7n4r5uREGck1x85/nRNAo5onEOpKpfVPKF8oOfxZ1uJmUB1aC ZIqxsHkqfzrn/FyQDHdSuPAWp00aeV6PucgMXvMzddFdVh8205IXuq/DMhuJbtyOEz w3ZuaMRd1KcHNTPbEz0bEphZBf8tmSBwfrqGoYLkpjViNGkNK+SRr0NtW6I7f/GUEH ubINEwJpVGq+0Dx7aGVMs3R1XObgyV0woTuzVdnMsq/IqxAkLqbEa0jwhyCS20gVVq S9ZNZa0jpwfeA== Message-ID: Date: Wed, 9 Mar 2022 07:41:14 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Alviro Iskandar Setiawan Cc: Jens Axboe , Pavel Begunkov , Alviro Iskandar Setiawan , io-uring Mailing list , GNU/Weeb Mailing List References: <20220308224002.3814225-1-alviro.iskandar@gnuweeb.org> <20220308224002.3814225-3-alviro.iskandar@gnuweeb.org> From: Ammar Faizi Subject: Re: [PATCH liburing 2/2] src/Makefile: Add header files as dependency In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 3/9/22 7:23 AM, Alviro Iskandar Setiawan wrote: > On Wed, Mar 9, 2022 at 6:06 AM Alviro Iskandar Setiawan wrote: >> On Wed, Mar 9, 2022 at 5:52 AM Ammar Faizi wrote: >>> This is ugly, it blindly adds all of them to the dependency while >>> they're actually not dependencies for all the C files here. For >>> example, when compiling for x86, we don't touch aarch64 files. >>> >>> It is not a problem for liburing at the moment, because we don't >>> have many files in the src directory now. But I think we better >>> provide a long term solution on this. >>> >>> For the headers files, I think we should rely on the compilers to >>> generate the dependency list with something like: >>> >>> "-MT ... -MMD -MP -MF" >>> >>> Then include the generated dependency list to the Makefile. >>> >>> What do you think? >> >> Yes, I think it's better to do that. I'll fix this in v2. >> thx > > Sir, I am a bit confused with the include dependency files to the Makefile. > > I use like this: > > -MT -MMD -MP -MF > > the dependency file is generated, but how to include them dynamically? > I think it shouldn't be included one by one. > > So after this > > [...] -MT "setup.os" -MMD -MP -MF ".deps/setup.os.d" [...] > [...] -MT "queue.os" -MMD -MP -MF ".deps/queue.os.d" [...] > [...] -MT "register.os" -MMD -MP -MF ".deps/register.os.d" [...] > [...] -MT "syscall.os" -MMD -MP -MF ".deps/syscall.os.d" [...] > > files .deps/{setup,queue,registers,syscall}.os.d are generated, but I > have to include them to Makefile right? How to include them all at > once? Untested, but I think you can do something like: -include $(liburing_objs:%=.deps/%.d) where liburing_objs is the variable that contains: {setup,queue,registers,syscall}.os. -- Ammar Faizi