Questions tagged [vpath]
28 questions
0
votes
1 answer
Use vpath to find generated files
I'm trying to write a Makefile that compiles a *.c into an *.o and then move it to obj/. However when I try to link all the *.o files in main I get an error as if the generated files were not found. I tried to prefix the code with the right path but…

tomoshimi
- 25
- 5
0
votes
1 answer
Search current directory last when looking for dependencies using GNU make and VPATH
This is a GNU Make dependency resolution issue.
My problem is that I copy the source files from a remote file server to a scratch disk (which speeds up the build process by 50%). If the file copy fails, I want to use the source files from the file…

dala
- 1,975
- 3
- 14
- 15
0
votes
1 answer
Make: Utilizing VPATH to compile and link files with a different extension
I have a somewhat odd Make case that I'm struggling to figure out. I have a C++ project I'm starting with some .cpp files, and I need to compile some source files from multiple remote directories that are utilized by several applications. This is…

noisebloom
- 65
- 5
0
votes
0 answers
How does make pass 'VPATH' to the sub-make
Thanks a lot for the comments. In this case actually VPATH is not used.
I write some makefiles to recursively build my project.
Part of the makefile in the root directory looks like this,
VPATH += $(shell find -type d)
export VPATH
#Codes to…

ZF Du
- 1
- 2
0
votes
0 answers
Makefile VPath force prerequisite compile
I'm trying to link a bunch of object files into a shared object. I specify the location of some of the object files which are located in a different directory using VPATH. If the .o file exists in that directory, then I get an error message that…

PentiumPro200
- 641
- 7
- 23
0
votes
0 answers
Trouble using vpath in makefile
I had a bunch of src files ( all in one folder) and .h files spread over different folders. With a makefile i was able to build the .c files successfully.
Now, i introduced 2 .c files , but in a different folder to the makefile and am not able to…

kishore .
- 2,123
- 2
- 16
- 12
0
votes
2 answers
GNU make: Circular dependency when VPATH is specified
Does anybody can help me to understand why GNU make considers "circular dependency" in the following example. If the VPATH is not specified and the source file presents in the current directory everything is Ok.
$ cat Makefile
VPATH = src
src%.o:…

Alex
- 612
- 3
- 9
0
votes
1 answer
Need to "make" twice when using vpaths
I've been getting into programming for the last 2 years or so and I'm finally "breaking out of the console" but as i do so, i also want to become independant from IDEs, therefore, i've been learning make but here's an issue i can't seem to find an…

Maximilien Mellen
- 3
- 1
- 2
0
votes
1 answer
vpath issue - not getting what i assumed
I have vpath set as follows:
vpath %.cpp $(SRC)
Now if i want to get the list of object files to be created, should it not work with the following ?
COBJS=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
It is not. I am not getting any list of files when i…

sajis997
- 1,089
- 1
- 15
- 29
0
votes
1 answer
autoconf: use AS_INIT_GENERATED to generate a script in a subdirectory
How can I use AS_INIT_GENERATE to generate a script that is not in the same directory as the configure script, in particular so that VPATH builds will be honoured?
For example, for a configure.ac file…

Zorawar
- 6,505
- 2
- 23
- 41
0
votes
1 answer
Using VPATH with ndk-build
Currently trying to port a Makefile to an Android.mk file such that I can build a shared library with ndk-build
I can't seem to get VPATH to do anything though.
e.g.
# File: Android.mk
LOCAL_PATH := $(call my-dir)
include…

bph
- 10,728
- 15
- 60
- 135
0
votes
1 answer
VPATH not working with Makefile Rule
I have added another rule to a Makefile to attempt to build a C shared library that uses SWIG to wrap the functions for Java using JNI
The additional rule looks like this (basically lifted from one of the SWIG java examples)
java: $(program_C_SRCS)
…

bph
- 10,728
- 15
- 60
- 135
0
votes
1 answer
Make and VPATH. Why are my source files being placed where I don't want them?
I am trying to compile with make. I have source in two directories, src and altsrc. I want make to look in altsrc for source files first, and then in src. I want the objects to go into directory obs. The relevant parts of my Makefile looks…

bob.sacamento
- 6,283
- 10
- 56
- 115