include files for cgxCADTools

Robert Kennedy amtor at hotmail.com
Tue Aug 2 12:10:44 UTC 2022


Mark,

I agree with Josh, these headers look like they were automatically generated using something like "make depends".

When creating a Makefile, it is GOOD practice to include these lines as it will ensure that the Project will rebuild the correct files when a header file was changed.  Since it is a REAL pain to create them manually.  Many developers use something like "make depends".

If there is a "depends:" target in the Makefile, you could patch the Makefile and add "depends" as the first Phony target to the "all:" target.  e.g.

all:  depends main etc etc

Alternatively, you could try just patching the Makefile by removing all these lines (and any other line where a system header is the ONLY dependency in the rule).  The vast majority of time, they are NOT needed to build the initial project.  (They are needed if you want to use "make" to rebuild your project properly on subsequent runs where the developer has changed one of more of these system header files.  This is not a normal scenario if one is using Macports to build the project).

The most important rules are the rules involving the source code files (which must be kept).
e.g.  $(OBJDIR-MAIN)/%.o: %.c
      $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

Make sure the Makfile has an "INCLUDES:" that lists the location of all the header files.  If it does, make will find them and build the initial project!

e.g. I am working on a new port where I converted an Xcode project to one using a Makefile.  I used "make depends" to generate these dependencies, Macports built the code just fine when I either:

  1.  Deleted all the lines below "# DO NOT DELETE THIS LINE -- make depend needs it"; or
  2.  Added "depends" as the first phony target to the all: phoney target

e.g. all: depends utils altivec mpeg2enc main $(PRODUCT)

You could even patch the Makefile and add another target called "macports" and tell Macports to build that:

      macports:  depends all

      And in the portfile, you would add:

build.target        macports

Good luck,

Rob


________________________________
From: macports-dev <macports-dev-bounces at lists.macports.org> on behalf of Mark Brethen <mark.brethen at gmail.com>
Sent: August 1, 2022 8:51 PM
To: MacPorts Developers <macports-dev at lists.macports.org>
Subject: Re: include files for cgxCADTools

I’ll ask the developer

Sent from my iPhone

> On Aug 1, 2022, at 4:53 PM, Joshua Root <jmr at macports.org> wrote:
>
> A lot of them aren't even standard headers; I believe the ones under bits/ are glibc implementation details. I would suspect this part of the Makefile was not hand-written but generated with one of the compiler's -M options. To work correctly in that case, it would need to be regenerated for each new system the software is built on.
>
> - Josh
>
>> On 2022-8-2 05:23 , Chris Jones wrote:
>> The makefile here is very poorly written. You should never directly reference standard headers like that…
>>>> On 1 Aug 2022, at 4:52 pm, Mark Brethen <mark.brethen at gmail.com> wrote:
>>>
>>> This Makefile has the following lines:
>>>
>>> CadReader.o: /usr/include/stdlib.h /usr/include/bits/libc-header-start.h
>>> CadReader.o: /usr/include/features.h /usr/include/stdc-predef.h
>>> CadReader.o: /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h
>>> CadReader.o: /usr/include/bits/long-double.h /usr/include/gnu/stubs.h
>>> CadReader.o: /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h
>>> CadReader.o: /usr/include/bits/floatn.h /usr/include/sys/types.h
>>> CadReader.o: /usr/include/bits/types.h /usr/include/bits/typesizes.h
>>> CadReader.o: /usr/include/bits/types/clock_t.h
>>> CadReader.o: /usr/include/bits/types/clockid_t.h
>>> CadReader.o: /usr/include/bits/types/time_t.h
>>> CadReader.o: /usr/include/bits/types/timer_t.h
>>> CadReader.o: /usr/include/bits/stdint-intn.h /usr/include/endian.h
>>> CadReader.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
>>> CadReader.o: /usr/include/bits/byteswap-16.h
>>> CadReader.o: /usr/include/bits/uintn-identity.h /usr/include/sys/select.h
>>> CadReader.o: /usr/include/bits/select.h /usr/include/bits/types/sigset_t.h
>>> CadReader.o: /usr/include/bits/types/__sigset_t.h
>>> CadReader.o: /usr/include/bits/types/struct_timeval.h
>>> CadReader.o: /usr/include/bits/types/struct_timespec.h
>>> CadReader.o: /usr/include/sys/sysmacros.h /usr/include/bits/sysmacros.h
>>> CadReader.o: /usr/include/bits/pthreadtypes.h
>>> CadReader.o: /usr/include/bits/thread-shared-types.h
>>> CadReader.o: /usr/include/bits/pthreadtypes-arch.h /usr/include/alloca.h
>>> CadReader.o: /usr/include/bits/stdlib-float.h
>>>
>>> /usr/include doesn’t exist on Big Sure (I assume its deprecated?) however, they can be found at
>>>
>>> ~ $ xcrun --sdk macosx --show-sdk-path
>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk
>>>
>>> although I don’t see a ‘bits’ subdirectory. Has it been relocated?
>>>
>>> Thanks,
>>> Mark
>>>
>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20220802/85e1a583/attachment.htm>


More information about the macports-dev mailing list