Questions tagged [vpath]
28 questions
6
votes
2 answers
Automake, generated source files and VPATH builds
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…

Craig McQueen
- 41,871
- 30
- 130
- 181
3
votes
2 answers
Recursive search in VPATH?
My C++ project has source files organized in nested subdirectories of ./src. I have a pattern rule in my makefile which compiles all of the .cpp source files into objects:
$(OBJDIR)/%.o: %.cpp makefile
$(CXX) -c $< -o $@
Since I am using this…

rampatowl
- 1,722
- 1
- 17
- 38
3
votes
1 answer
make 'vpath' directive, why isn't it sufficient for this prerequisite?
The following example makefile works as expected, using vpath to find object files and source files. But in the last line, where i tell make about the dependency of one object file on the other, I need to specify the directory $(objd)/ of the…

Jonatan Öström
- 2,428
- 1
- 16
- 27
3
votes
2 answers
Makefile to move .o files to Different Directory
I have source code in one directory and have a makefile in a different directory. I am able to compile the code using the make system's vpath mechanism. The .o files are being created in the same folder where the makefile is. But I want to move…

rock_buddy
- 265
- 1
- 6
- 14
3
votes
1 answer
How to make the target depend on lib file, but exclude it from $^ (VPATH involved)?
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…

Shahbaz
- 46,337
- 19
- 116
- 182
2
votes
1 answer
What does the V in vpath stand for?
The VPATH variable in makefile is used to indicate search paths. But what exactly does the "V" in it stand for?
The value of the make variable VPATH specifies a list of directories that make should search. Most often, the directories are expected…

richard.g
- 3,585
- 4
- 16
- 26
2
votes
1 answer
Makefile trickery using VPATH and include
I'm playing around with make files and the VPATH variable. Basically, I'm grabbing source files from a few different places (specified by the VPATH), and compile them into the current directory using simply a list of .o-files that I want.
So far so…

falstro
- 34,597
- 9
- 72
- 86
2
votes
1 answer
How to get absolute paths after vpath matching in make?
I have a makefile that depending on some properties sets vpath and generates a list of source files into one variable. I need to run the makefile without compiling anything (the compilation is actually handled by a different makefile) and just see…

Honza
- 4,349
- 2
- 24
- 40
1
vote
1 answer
Makefile: Can VPATH variable is applied to assigning Makefile variable?
i've tried to write simple makefile for practice.
I have two directories 1. srcs(.c), 2.include(.h)
and try to define SRCS variable that would contain all .c files
in current directory and srcs directory.
and below is my Makefile
CURDIR = $(shell…

ruach
- 1,369
- 11
- 21
1
vote
1 answer
make file vpath not replacement
i have little problem with making a make file, this is the code :
SHELL = /bin/sh
CC := gcc
CFLAGS := -Wall
VPATH = src:obj
HEADERS := parser.h
dirs = out obj
%.o : mkdirs %.c $(HEADERS)
$(CC) -c $(word 2,$^) -o obj/$@
all : parser.o
…

KarimS
- 3,812
- 9
- 41
- 64
1
vote
1 answer
Change directory in makefile for main shell
I have a following scenario in my build system.
1. 1000 makefiles in src directories
2. There is common.make file being included for all 1000 makefiles
3. links were created for makefiles and sources in object directory from source directory. Hence…

Jegan
- 188
- 3
- 15
0
votes
1 answer
How to do autotools VPATH builds with Rust
I am working on a library project which mixes C, C++, and Rust code. For historical reasons I use autotools to drive building.
Essentially, my Makefile.am looks like this:
libfoo_la_LIBADD +=…

Jose Gracia
- 133
- 6
0
votes
1 answer
Makefile - issues including directory
I've been working on a Makefile but having two issues. The application directory contains autotools files for a Yocto build but for development I'd like to do both x86 & ARM builds locally via Makefile.
The project has the following directory…

leo8382
- 91
- 8
0
votes
0 answers
Makefile relinking issue
I was trying to adjust my standard makefile to include vpath. I got it working as I want, however it keeps relinking now. Anybody knows what I'm doing wrong? Does it have to do with my usage of vpath?
Relevant part of my makefile:
NAME := …

Rutger Cappendijk
- 129
- 2
- 6
0
votes
1 answer
vpath not picking up newly built objects
I have this Makefile (and GNU Make):
vpath %.o .objs
OBJDIR=.objs
all: symbol_tests.so
symbol_tests.so: symbol_tests.o symbol.o # simulate linking
@echo Linking target: $@, prerequisites: $^
%.o: %.c | $(OBJDIR)/
gcc -o $(OBJDIR)/$@ -c…

thoni56
- 3,145
- 3
- 31
- 49