Find the answer to your Linux question:
Results 1 to 3 of 3
I don't know; maybe I'm just stupid now, but I really haven't been able to find anything on this. Say I'm configuring a program with automake, and I want to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578

    GNU automake CPPFLAGS for individual files


    I don't know; maybe I'm just stupid now, but I really haven't been able to find anything on this.
    Say I'm configuring a program with automake, and I want to compile some source files in the same subdir with different CPPFLAGS than others. In this case, I want to compile one file with the GTK+ include directories and some other without. I know that you can specify specific LDFLAGS for different targets, and so I think that there should be something similar for CPPFLAGS as well.
    Now of course it doesn't _hurt_ to compile the other files with the GTK include directories, but I must say that it doesn't feel clean to compile files with unneccessary CPPFLAGS.
    When I look at the generated Makefile, there doesn't appear do be support for that, but I though I'd ask just to be sure.

  2. #2
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    Code:
    typeA_SOURCES = \
        stuff.c
    typeB_SOURCES = \
        stuff2.c
    With this you are right, you cannot use different INCLUDES. But, if there is only one file you need a flag for, like --enable-pedantic or something crazy like that then you can do it with a single file, but as per the info file:
    Code:
    * _LDADD:                                A Program.
    * _LDFLAGS:                              A Program.
    * _LIBADD:                               A Library.
    * _SOURCES:                              A Program.
    * _TEXINFOS:                             Texinfo.
    those are all the pkgname_* macros you have to work with. If you need special compile options for one file that doesn't work with another maybe there is something wrong at a bit deeper level.
    I respectfully decline the invitation to join your delusion.

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yes, enabling it on a single file (not a package) was exactly what I was planning to do. But I just haven't been able to find the declaration for it. Have I just been blind again?

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •