25,696 questions
0
votes
0
answers
23
views
No gcc compiling log "CC [M] " showing up when build external modules using linux rpi-5.10.y
environment
OS: Arch Linux x86_64
Host: Windows Subsystem for Linux - archlinux (2.6.2.0)
Kernel: Linux 6.6.87.2-microsoft-standard-WSL2
compiler: aarch64-linux-gnu-gcc 15.1.0 Using built-in specs.
...
1
vote
2
answers
69
views
Is it incorrect/undefined behavior when libraries are linked using relative path?
I am building a shared library A which depends on another shared library B present in another directory dir2. When I link shared library B to A with relative path using -L../dir2 -lB it builds fine. ...
-1
votes
1
answer
52
views
Makefile error when .PHONY target doesn't contain the output file names
The Makefile below throws the following error when compiled.
Error:
make: *** No rule to make target 'libfoo.so.0.1', needed by 'all'. Stop.
Makefile:
LIBNAME = libfoo
SOLIBNAME = $(LIBNAME).so.0.1
...
0
votes
1
answer
92
views
Recipe throws error while compiling a target: "make: *** No rule to make target"
I have a Makefile which contains a target by name abc-def-ghi. When I compile this particular target in my Linux machine with the command make abc-def-ghi, it builds successfully, but when the same ...
1
vote
1
answer
64
views
ifdef with target-specific variables
This Makefile specifies a target-specific variable and a global one
VAR=value
target: VAR2=value2
ifdef VAR
VAR3+=$(VAR)
endif
ifdef VAR2
VAR3+=$(VAR2)
endif
target:
@echo $(VAR) $(VAR2)...
2
votes
1
answer
63
views
Gnu make 4.3 Makefile change output directory of dynamic target
I am trying to compile .c-files and store the output .o-files into different folders. When making a debug-build, the output files should be stored in build/debug/. When making a release-build, the ...
1
vote
2
answers
76
views
Conditional statement in makefile based on querying present working directory
From here, I realize it is possible to query the pwd.
I have the following 2 lines that I currently comment on/off
# LDLIBSOPTIONS=-L "/home/OpenXLSX/linux/lib"
LDLIBSOPTIONS=-L "/...
1
vote
1
answer
60
views
Using tee in a Linux makefile
I am trying to save the output of a makefile. I have tried everything that I can think of without success.
> >> tee compile.log
> 1> tee compile.log
> 2> tee compile.log
> &>...
2
votes
3
answers
183
views
How to create test executables in Makefile in C?
I want to build make test with Makefile, and the test target should generate <file_name>_test executable based on the folder tests/<file_name>.c. All tests/*.c files have a main() function....
3
votes
2
answers
174
views
How to write Makefile for debugging only one header and source in c
The lib folder contains many *.h and *.c files, and all files are in development phrase and they contain many errors including syntax errors. So I want to write the Makefile to debug all libraries one ...
2
votes
2
answers
139
views
Nested C Makefile
C/Makefile relative newbie here. I have a C project whose structure looks like this:
main.c
subdir1
a.h
a.c
b.h
b.c
subdir2
x.h
x.c
y.h
...
0
votes
1
answer
79
views
Why doesn't make fail if a file exists but there is no rule for it
The following is a minimal example from something odd that was happening to me. My situation was obviously more complex than what follows, but the "misunderstanding" boils down exactly to ...
0
votes
1
answer
50
views
How to pass -B (rebuild all) to submake
I am using an alternate make system tied in to the main make. The issue is when I do:
make -B
For rebuild all, it does not pass that to the submake. I want the submake to also do a rebuild.
The only ...
0
votes
1
answer
66
views
mingw32-make application was unable to start correctly (0xC0000142)
I installed mingw64 on my Windows 11 system a few days ago.
When using mingw32-make, the following code (lines 27 and 28) in the makefile is failing.
voice.exe: ${OBJS}
${CC} -o "$@" ${...
0
votes
2
answers
69
views
How to apply the same recipe to different target with pattern?
Here is my Makefile. All the %.o depend on %.c and main.h, except the ones under main, event, cmd folder, which depend on $(MAIN_HEADERS).
How do I combine the below and make them simpler, as their ...