vpath

How to make the target depend on lib file, but exclude it from $^ (VPATH involved)?

五迷三道 提交于 2020-01-15 06:14:16
问题 Imagine this structure: root/ | +-- include/ +-- src/ +-- build/ +-- lib/ +-- tests/ | +-- common +-- test1 +-- test2 +-- test3 In tests/ , the folder common/ contains a couple of source files that generate data or read data from logged file etc, which are shared between all tests. Each test therefore has only one file; main.c (currently). The Makefile of each test looks like this: .SUFFIXES: .SUFFIXES: .c .o TARGET := test # OS dependent stuff omitted for brevity CFLAGS += -I../../include -I

How to make the target depend on lib file, but exclude it from $^ (VPATH involved)?

瘦欲@ 提交于 2020-01-15 06:13:16
问题 Imagine this structure: root/ | +-- include/ +-- src/ +-- build/ +-- lib/ +-- tests/ | +-- common +-- test1 +-- test2 +-- test3 In tests/ , the folder common/ contains a couple of source files that generate data or read data from logged file etc, which are shared between all tests. Each test therefore has only one file; main.c (currently). The Makefile of each test looks like this: .SUFFIXES: .SUFFIXES: .c .o TARGET := test # OS dependent stuff omitted for brevity CFLAGS += -I../../include -I

Automake, generated source files and VPATH builds

强颜欢笑 提交于 2020-01-14 08:55:13
问题 I'm doing VPATH builds with automake. I'm now also using generated source, with SWIG. I've got rules in Makefile.am like: dist_noinst_DATA = whatever.swig whatever.cpp: whatever.swig swig -c++ -php $^ Then the file gets used later: myprogram_SOURCES = ... whatever.cpp It works fine when $builddir == $srcdir . But when doing VPATH builds (e.g. mkdir build; cd build; ../configure; make ), I get error messages about missing whatever.cpp . Should generated source files go to $builddir or $srcdir