16

I'm getting the below error with automake. I know you can put AUTOMAKE_OPTIONS = subdir-objects" at the top of Makefile.am. But how can I set this behaviour for all files, so I don't need to do it case by case?

Makefile.am:454: warning: source file 'libs/esl/src/esl_threadmutex.c' is in a subdirectory,
          Makefile.am:454: but option 'subdir-objects' is disabled
          Makefile.am:454: warning: source file 'libs/esl/ivrd.c' is in a subdirectory,
          Makefile.am:454: but option 'subdir-objects' is disabled
          Makefile.am:454: warning: source file 'libs/esl/src/esl_json.c' is in a subdirectory,
          Makefile.am:454: but option 'subdir-objects' is disabled
          Makefile.am:454: warning: source file 'libs/esl/src/esl_buffer.c' is in a subdirectory,
          Makefile.am:454: but option 'subdir-objects' is disabled
          tests/unit/unit.mk:6: warning: source file 'tests/unit/switch_event.c' is in a subdirectory,
          tests/unit/unit.mk:6: but option 'subdir-objects' is disabled
          Makefile.am:854:   'tests/unit/unit.mk' included from here
          tests/unit/unit.mk:13: warning: source file 'tests/unit/switch_hash.c' is in a subdirectory,
          tests/unit/unit.mk:13: but option 'subdir-objects' is disabled
          Makefile.am:854:   'tests/unit/unit.mk' included from here
          Makefile.am:441: warning: source file 'src/tone2wav.c' is in a subdirectory,
          Makefile.am:441: but option 'subdir-objects' is disabled
          Makefile.am: installing 'build/config/depcomp'
jaseUK
  • 303
  • 2
  • 4
  • 11

1 Answers1

11

It's not something you add "case-by-case", as AUTOMAKE_OPTIONS applies to the whole project. It's also supposedly the only way it should be used in the future, thus the warnings; for now it's opt-in.

You can also set this in configure.ac with AM_INIT_AUTOMAKE, see Autotools Mythbuster (full disclosure: I'm the author) for the full set of automake options you can use.

Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
Diego Elio Pettenò
  • 3,152
  • 12
  • 15
  • When I said case by case I meant per project not the individual files / folders. I'm looking for option that is universal in the automake config. Not updating each projects configue.ac. Thanks – jaseUK Aug 03 '16 at 13:17
  • 1
    Then there is none. There is no such thing as automake config. – Diego Elio Pettenò Aug 03 '16 at 14:05
  • `AM_INIT_AUTOMAKE([subdir-objects])` fails saying "configure.ac:11: error: option '[subdir-objects]' not recognized'. Without square brackets it works. This is automake (GNU automake) 1.16.3. – Ale Mar 30 '22 at 17:29