Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
1
answers
4620
views
Error while trying to compile headers in Ubuntu Jammy Jellyfish
I am currently trying to compile the headers in Jammy Jellyfish, and I am running into the following error: ``` /usr/src/linux-headers-5.15.0-25-generic$ sudo make SYNC include/config/auto.conf.cmd make[1]: *** No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by 'arch/x86/incl...
I am currently trying to compile the headers in Jammy Jellyfish, and I am running into the following error:
/usr/src/linux-headers-5.15.0-25-generic$ sudo make
SYNC include/config/auto.conf.cmd
make: *** No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by 'arch/x86/include/generated/uapi/asm/unistd_32.h'. Stop.
make: *** [arch/x86/Makefile:213: archheaders] Error 2
Before running the make command, I copied the old .config file /boot/config-5.15.0-25-generic into the .config file in /usr/src/linux-headers-5.15.0-25-generic/
I've seen a few posts where this error has been posted, but I have not seen any answers that fix the issue. If there is more information needed, please let me know.
Thanks
Dinger149
(21 rep)
Jul 11, 2022, 08:09 PM
• Last activity: Aug 7, 2025, 02:04 AM
3
votes
1
answers
2902
views
How do you specify the pkg-config path when compiling something with cmake?
I want to build ffmpeg with support for the av1 codec on CentOS 7. I start by following the instructions [here][1]: git clone https://aomedia.googlesource.com/aom mkdir aom_build cd aom_build cmake ../aom make sudo make install This writes a file to `/usr/local/lib64/pkgconfig/aom.pc`. When I later...
I want to build ffmpeg with support for the av1 codec on CentOS 7.
I start by following the instructions here :
git clone https://aomedia.googlesource.com/aom
mkdir aom_build
cd aom_build
cmake ../aom
make
sudo make install
This writes a file to
/usr/local/lib64/pkgconfig/aom.pc
.
When I later clone ffmpeg's git repo and try to run ./configure --enable-libaom ...
, it complains that pkg-config can't find the aom.pc file.
This is because if I run pkg-config --variable pc_path pkg-config
, I can see that pkg-config only checks here:
/usr/lib64/pkgconfig:/usr/share/pkgconfig
It doesn't look in /usr/local/lib64/pkgconfig
, where aom.pc is.
So far, the only fix I've come up with is to run this instead in ffmpeg's git directory:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH/usr/local/lib64/pkgconfig: ./configure --enable-libaom ...
This works, but I'd rather just tell libaom to write aom.pc to /usr/lib64/pkgconfig in the first place.
Is there any way, when building aom, to tell cmake or make to write the aom.pc file to /usr/lib64/pkgconfig instead of /usr/local/lib64/pkgconfig?
In other projects that have a ./configure
step, I've seen it possible to specify this with ./configure --pkgconfigdir=/usr/lib64/pkgconfig
, but the aom project doesn't have a ./configure
script, so I'm not sure what to do here.
Tal
(2252 rep)
Apr 24, 2019, 02:52 PM
• Last activity: Jul 28, 2025, 12:07 AM
50
votes
4
answers
45730
views
How to list all targets in make?
Let's say you have a project structure with lots of Makefiles and there is a top level Makefile that includes all the other. How can you list all the possible targets? I know writing make and then tabbing to get the suggestions would generally do the trick, but in my case there are 10000 targets. Do...
Let's say you have a project structure with lots of Makefiles and there is a top level Makefile that includes all the other.
How can you list all the possible targets?
I know writing
make
and then tabbing to get the suggestions would generally do the trick, but in my case there are 10000 targets. Doing this passes the results through **more** and also for some reason scrolling the list results in a freeze. Is there another way?
Sogartar
(661 rep)
Sep 16, 2015, 01:26 PM
• Last activity: Jul 23, 2025, 02:33 PM
4
votes
1
answers
323
views
POSIX-compliance of NMAKE
[NMAKE by Microsoft][1] comes with some components of Visual Studio. Is it POSIX-compliant? [1]: https://learn.microsoft.com/en-us/cpp/build/reference/nmake-reference
NMAKE by Microsoft comes with some components of Visual Studio. Is it POSIX-compliant?
Rāṣidu'l-Qamar
(43 rep)
Jul 19, 2025, 05:05 PM
• Last activity: Jul 19, 2025, 06:44 PM
2
votes
1
answers
200
views
How to get multiple pattern rule %/$* variables in a Makefile?
All we get in Makefiles is just one `%/$*` [pattern rule](https://www.gnu.org/software/make/manual/html_node/Pattern-Rules.html#Pattern-Rules) pair. ``` $ cat Makefile %.bla:; echo $* $ make -s m.bla m ``` How shortsighted of our Unix™ fathers. How can I achieve something like `%{0}.%{1}.bla`...
All we get in Makefiles is just one
How can I achieve something like
%/$*
[pattern rule](https://www.gnu.org/software/make/manual/html_node/Pattern-Rules.html#Pattern-Rules) pair.
$ cat Makefile
%.bla:; echo $*
$ make -s m.bla
m
How shortsighted of our Unix™ fathers.How can I achieve something like
%{0}.%{1}.bla
that will give me
$ make -s a.b.bla
a b
Sure, one could use $(basename)
, $(suffix)
, $(subst)
,
but I'm talking about two actual independent $*
-like variables.
Dan Jacobson
(560 rep)
Jun 30, 2025, 08:13 AM
• Last activity: Jul 1, 2025, 08:19 PM
5
votes
2
answers
363
views
How to do indirect variable substitution in a GNU Makefile?
In the shell I can do ``` $ a=b b=c; eval echo \$$a c ``` How do I do the same with GNU Make's `$(eval)` function? ``` $ cat Makefile a=b b=c x:; echo {What goes here in order to get:} $ make c ```
In the shell I can do
$ a=b b=c; eval echo \$$a
c
How do I do the same with GNU Make's $(eval)
function?
$ cat Makefile
a=b
b=c
x:; echo {What goes here in order to get:}
$ make
c
Dan Jacobson
(560 rep)
Jun 30, 2025, 05:33 AM
• Last activity: Jun 30, 2025, 06:55 AM
3
votes
3
answers
525
views
Always build specified targets with FreeBSD make (as with the GNU make -B flag)
I would like to force `make` on FreeBSD to execute the target I specify no matter if it's up to date or not. I know that it could be done with a `-B` flag in GNU make but I cannot find anything similar in the FreeBSD make manual page.
I would like to force
make
on FreeBSD to execute the target I specify no matter if it's up to date or not.
I know that it could be done with a -B
flag in GNU make but I cannot find anything similar in the FreeBSD make manual page.
Mateusz Piotrowski
(4983 rep)
Mar 29, 2018, 02:40 PM
• Last activity: Jun 21, 2025, 05:35 AM
9
votes
6
answers
2281
views
How can I get gmake to give me a list of all included makefiles?
I've inherited a major mess of a makefile network that was itself inherited from another project, with makefiles included all over the place. I'm trying to make a simple change without gutting the whole thing (tempting though that is, I just don't have the time right now). Is there any way to coax a...
I've inherited a major mess of a makefile network that was itself inherited from another project, with makefiles included all over the place. I'm trying to make a simple change without gutting the whole thing (tempting though that is, I just don't have the time right now).
Is there any way to coax a full makefile out of gmake, *i.e.*, with all the included files already included? I know how to get the database dumped, but that's just about as hard to follow with all the extraneous junk that gets loaded in.
Joe Sewell
(535 rep)
Jun 26, 2014, 08:48 PM
• Last activity: Jun 18, 2025, 03:04 PM
2
votes
1
answers
2396
views
libbfd-2.22.so missing while compiling Binutils/Glibc/Zlib
When I try to compile Binutils, Glibc and Zlib using chroot on my [LFS](http://www.linuxfromscratch.org/lfs/) system, I get this error: > ar: error while loading shared libraries: libbfd-2.22.so: cannot open shared object file: No such file or directory I compiled Binutils before without using chroo...
When I try to compile Binutils, Glibc and Zlib using chroot on my [LFS](http://www.linuxfromscratch.org/lfs/) system, I get this error:
> ar: error while loading shared libraries: libbfd-2.22.so: cannot open shared object file: No such file or directory
I compiled Binutils before without using chroot, the files libbfd.a, libbfd.so, libbfd-2.22.so and libbfd.la exist both in /tools/lib/ and /usr/lib/
I don't know where the compiler is searching for it.
How to continue compilation?
Vi Pau
(166 rep)
Aug 1, 2012, 07:29 AM
• Last activity: Jun 3, 2025, 09:01 PM
0
votes
1
answers
1289
views
Subset of string variable in Makefile
I am relatively new to using Make. I am trying to port a shell script that has a variable that is accessed using `${var:9:-1}`, however in Make as `$` is reserved I cannot use this convention. I am lost as whenever I try to search for answers they are extremely verbose. eg: ``` foo: bar=`abc|xyz` ba...
I am relatively new to using Make. I am trying to port a shell script that has a variable that is accessed using
${var:9:-1}
, however in Make as $
is reserved I cannot use this convention. I am lost as whenever I try to search for answers they are extremely verbose.
eg:
foo:
bar=abc|xyz
baz -n ${bar:9:-1}
Vincent Rodomista
(101 rep)
Apr 2, 2020, 12:04 AM
• Last activity: Jun 3, 2025, 02:17 PM
2
votes
1
answers
2062
views
Could not find a suitable mpi compiler (mpicxx or mpic++) whlie using "$ make -f Makefile.shlib auto "
As figure shows, I'm using Linux to install LIGGGHTS, when i type "make -f Makefile.shlib auto", it shows me [auto] Error 2, i tried to set USE_MPI to "OFF", but it did't work, my Question is, how do i using the MPICXX_USR variable? Thanks for your felp. [![enter image description here][1]][1] [1]:...
As figure shows, I'm using Linux to install LIGGGHTS, when i type "make -f Makefile.shlib auto", it shows me [auto] Error 2, i tried to set USE_MPI to "OFF", but it did't work, my Question is, how do i using the MPICXX_USR variable?
Thanks for your felp.

蔡翰昀
(21 rep)
Feb 18, 2019, 05:18 AM
• Last activity: May 30, 2025, 12:01 PM
0
votes
2
answers
48
views
Can I somehow include a sub-Makefile without creating an impicit rule for it?
Honestly, I want to control, when is this sub-make rebuilt. To my largest surprise, any time if I use an `include generated.sub.Makefile`, it also tries to rebuild-it and then re-read my whole Makefile structure. I do not want it. I know what is in `generated.sub.Makefile`, and I do not want it to b...
Honestly, I want to control, when is this sub-make rebuilt. To my largest surprise, any time if I use an
include generated.sub.Makefile
, it also tries to rebuild-it and then re-read my whole Makefile structure.
I do not want it. I know what is in generated.sub.Makefile
, and I do not want it to be rebuilt, except if I say so. I do not want it to be rebuilt only because I included it.
The goal is, generated.sub.Makefile
should be rebuilt always if I want to, and never if I explicitly did not command it.
Can I somehow do that?
peterh
(10448 rep)
May 28, 2025, 07:08 PM
• Last activity: May 28, 2025, 10:46 PM
0
votes
1
answers
3543
views
CMake returns linux/videodev.h not exist while build opencv
Got problem while building `opencv` accoding to [link][1]: Determining if the include file linux/videodev.h exists failed with the following output: Change Dir: /home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTC_affcb/fast" /usr/bin/make -f CMakeFiles/cmTC_affcb....
Got problem while building
opencv
accoding to link :
Determining if the include file linux/videodev.h exists failed with the following output:
Change Dir: /home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_affcb/fast"
/usr/bin/make -f CMakeFiles/cmTC_affcb.dir/build.make CMakeFiles/cmTC_affcb.dir/build
make[1] : Entering directory '/home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_affcb.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -O3 -DNDEBUG -o CMakeFiles/cmTC_affcb.dir/CheckIncludeFile.c.o -c /home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/pi/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:28: fatal error: linux/videodev.h: No such file or directory
#include
^
compilation terminated.
.....
.....
I just did cd linux in order to look file videodev.h is there, but system can't find such directory. File /usr/include/linux/videodev.h
exist on my system. I suppose compiler is not able to find it. How to solve such problem?
vico
(843 rep)
Jul 27, 2017, 01:04 PM
• Last activity: May 28, 2025, 02:06 PM
0
votes
1
answers
3747
views
How I can install some gcc compilers in arch linux?
I need to install earlier gcc than now. I already have gcc-10. I must install gcc-8 or gcc-6 in my computer then to build old project. I download the gcc-6 from github and tried install it as shown in this guide [https://gist.github.com/slizzered/a9dc4e13cb1c7fffec53][1]. I got the error: `target no...
I need to install earlier gcc than now. I already have gcc-10. I must install gcc-8 or gcc-6 in my computer then to build old project. I download the gcc-6 from github and tried install it as shown in this guide https://gist.github.com/slizzered/a9dc4e13cb1c7fffec53 . I got the error:
target not found: libart-lgpl
. Google was show me than it's error occurs due to than this package is't contents from main repository. Stop! Ones again. If I want to build gcc-6 then I need to download and install yaourt
then next install libart-lgpl
which is not in the official repository? Pleas help my download & install some gcc compilers from my computer.
Vando
(1 rep)
Apr 14, 2021, 04:50 PM
• Last activity: May 26, 2025, 02:08 AM
0
votes
1
answers
2250
views
Buildroot compile error, librt.so: undefined reference to
I'm trying to compile a [Buildroot](https://bellard.org/tinyemu/buildroot-riscv-2018-10-20.tar.gz) image using a preconfigured builtin _defconfig file... More specific the riscv64_xwin_defconfig which is a simple setup for a riscv64 image with Xorg builtin. Since it's a rather old build i'm doing th...
I'm trying to compile a [Buildroot](https://bellard.org/tinyemu/buildroot-riscv-2018-10-20.tar.gz) image using a preconfigured builtin _defconfig file... More specific the riscv64_xwin_defconfig which is a simple setup for a riscv64 image with Xorg builtin.
Since it's a rather old build i'm doing this inside a Fedora 23 Docker container which has gcc version 5.3.1, i don't think this is a problem since i can successfully build the non-Xwin riscv64 defconfig just fine
The problem resides when the Makefile tries to build the specific package "eudev-3.2"
Here is the config.log:
configure:3158: $? = 1
configure:3178: checking whether the C compiler works
configure:3200: /home/buildroot-riscv-2018-10-20/output/host/usr/bin/riscv64-buildroot-linux-gnu-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.c -lrt >&5
/home/buildroot-riscv-2018-10-20/output/host/usr/lib/gcc/riscv64-buildroot-linux-gnu/7.3.0/../../../../riscv64-buildroot-linux-gnu/bin/ld: warning: libpthread.so.0, needed by /home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so, not found (try using -rpath or -rpath-link)
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__pthread_barrier_wait@GLIBC_PRIVATE'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_attr_setstacksize@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__pthread_barrier_init@GLIBC_PRIVATE'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__pthread_unwind@GLIBC_PRIVATE'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_create@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_sigmask@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_once@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__shm_directory@GLIBC_PRIVATE'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_detach@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `pthread_cancel@GLIBC_2.27'
/home/buildroot-riscv-2018-10-20/output/host/usr/riscv64-buildroot-linux-gnu/sysroot/usr/lib64/lp64d/librt.so: undefined reference to `__pthread_get_minstack@GLIBC_PRIVATE'
collect2: error: ld returned 1 exit status
fabricio7p
(1 rep)
Jun 15, 2020, 11:56 PM
• Last activity: May 15, 2025, 06:05 AM
0
votes
2
answers
738
views
Make does not rebuild transitive dependencies of pattern rules on change, why?
I have a Makefile, roughly so: .PRECIOUS: %.a %.b %.c %.a: touch $@ %.b: %.a touch $@ %.c: %.b touch $@ If I create "test.c" with a `make test.c`, all the 3 files (`test.a`, `test.b`, `test.c`) are created correctly. However, if I now remove `test.a`, and then I try to re-create `test.c`, then nothi...
I have a Makefile, roughly so:
.PRECIOUS: %.a %.b %.c
%.a:
touch $@
%.b: %.a
touch $@
%.c: %.b
touch $@
If I create "test.c" with a
make test.c
, all the 3 files (test.a
, test.b
, test.c
) are created correctly. However, if I now remove test.a
, and then I try to re-create test.c
, then nothing happens.
Reason is obvious: because test.c
depends only on test.b
, and test.b
was not changed, not rebuild is needed. However, test.b
should be rebuilt because test.a
disappeared, and that should spread to test.c
as well. I find this behavior as a highly un-intuitive side effect.
Can I somehow let make to handle "transitive" dependencies on the intuitive way? (I.e. after the deletion of test.a
, all the targets must be rebuilt.)
The problem happens only with pattern rules.
(P.s. I need all the intermediate files, this is why the PRECIOUS. Default behavior of the GNU Make is that it deletes the intermediary files.)
peterh
(10448 rep)
Jan 10, 2024, 05:46 PM
• Last activity: May 4, 2025, 05:41 PM
0
votes
3
answers
75
views
Does CMake/make have the ability to make my Linux operating system unstable?
30 years ago, I've started `C++`. Mostly under DOS, `Windows 3.1` and `95`. I've wrote some for 10 years. Then `Java` replaced it at work, for about 20 years. Now `C++` in coming back in the front of the scene. I'm enjoying it but the whole environment has changed. It's with `stdlib` that I have to...
30 years ago, I've started
C++
. Mostly under DOS, Windows 3.1
and 95
. I've wrote some for 10 years. Then Java
replaced it at work, for about 20 years. Now C++
in coming back in the front of the scene. I'm enjoying it but the whole environment has changed. It's with stdlib
that I have to work now, and learn some changes that came from C++ 98
where I left it, up to C++ 23
where it is now.
My main troubles, however, aren't with the language itself. But the CMake
scripts and their complexities that make builds complex to understand, and sometimes: to perform. Generating make
script itself, a lot of sub projects, sometimes being helped by Conan
or another tool. It's difficult to figure all it can do.
But what is making me asking a question in this Unix/Linux S.E. and not StackOverflow, is that I had to generate and adapt a somewhat long C++
project (a generation coming from OpenApi
generator for pistache
server) few months ago.
During some changes I was attempting, I went on trouble with a gir1
library that was generated by an underlying sub project, for a purpose it only knows, whose .so.1
wasn't able to link to .so
or something like that, and where I was figuring that the underlying make
scripts could be able/willing to put their .so
binary to /usr/local/bin
or to some place where it could attempt to replace the binary currently used by my Debian 12
.
Or that, if I dared attempting to run my CMake
command with a sudo
, this could happen.
Are my fears true? May I put my OS definitively in trouble with a bad compilation, replacing a genuine component by a dev one? Does such risk exist and, in general, for any project involving make
builder, I have to be careful, Or is there some kind of protection on my operating system that prevent this absolutely?
Marc Le Bihan
(2353 rep)
Mar 30, 2025, 02:50 PM
• Last activity: Apr 26, 2025, 07:22 AM
0
votes
1
answers
75
views
Need to ensure a certain binary is built early and excluded from clean
Trying to run this code in my Makefile: ``` MAKEFLAGS+=--no-buildin-rules MAKEVARIABLES+=--no-builtin-variables fixClean: dissoc.c echo "Inside fixClean" ${CC} $ make clean make clean make: dissoc: No such file or directory make: dissoc: No such file or directory make: dissoc: No such file or direct...
Trying to run this code in my Makefile:
MAKEFLAGS+=--no-buildin-rules
MAKEVARIABLES+=--no-builtin-variables
fixClean: dissoc.c
echo "Inside fixClean"
${CC} $ make clean
make clean
make: dissoc: No such file or directory
make: dissoc: No such file or directory
make: dissoc: No such file or directory
make: dissoc: No such file or directory
echo "Inside fixClean"
Inside fixClean
gcc dissoc.c.c "-lcrypt" -o dissoc
cc1: fatal error: dissoc.c.c: No such file or directory
compilation terminated.
make: *** [Makefile:24: fixClean] Error 1
dissoc is needed by the Makefile.
It dissociates groups from group of undesired patterns.
It is needed by all targets: all, db, clean.
I want to exclude it from clearing, or at least rebuild it right after.
Also, make's default rules are wreaking havoc.
Is there anything more to do about them?
---
Let me explain a bit about dissoc. It is short for dissociation. It runs as a shell command:
TSRC=$(widlcard *.c) => about 37 files in the directory SLIBS=utils.c hash.c dsp.c logs.c fftw.c usrp.c decoder.c => 7 files These are static libs without a main function. CSRC=$(shell dissoc ${TSRC} \\ ${SLIBS}) \\ is the group separator. EXEC=$(basename ${CSRC}) ${OBJ}In EXEC I need only the 37-7= 30 cfiles. dissoc checks each file in TSRC (temporary sources) against SLIBS and removes it if it is a static library. SLIBS are processed through other patterns (basename, addsuffix) to generate the OBJ group. The idea is to remove the pattern clutter in Makefiles by reducing explicit patterns. SLIBS, static libs are still explicit, I guess I could check them automatically by looking for an "int main(" I've tried the make -d output and it is overwhelming. Testing patterns against an infinite group of legacy and new patterns? Not maintainable. A flex approach would be much simpler. On error it just reports the Makefile line number that matched, and the state that it happened. If the pattern work is heavy, a bison could be implemented as a back end.
Nibal
(11 rep)
Apr 24, 2025, 07:15 PM
• Last activity: Apr 26, 2025, 06:27 AM
1
votes
2
answers
442
views
sed in makefile is not working as expected when using regex
Got a makefile whith this command which convert folder names on `./cmd/` from `snake_case` to `PascalCase` ``` test: @for f in $(shell ls ./cmd/); do \ echo $${f}; \ echo $${f} | sed -r 's/(^|_)([a-z])/\U\2/g'; \ done ``` What I get when I run it is, with a prefixed uppercase `U`: ``` api_get_manual...
Got a makefile whith this command which convert folder names on
./cmd/
from snake_case
to PascalCase
test:
@for f in $(shell ls ./cmd/); do \
echo $${f}; \
echo $${f} | sed -r 's/(^|_)([a-z])/\U\2/g'; \
done
What I get when I run it is, with a prefixed uppercase U
:
api_get_manual
UapiUgetUmanual
And what I expect to get:
ApiGetManual
Ricardo Albear
(143 rep)
Apr 21, 2025, 04:48 PM
• Last activity: Apr 23, 2025, 01:52 PM
1
votes
2
answers
61
views
Can I use a flexible (either or) prerequisite in GNU make?
Is it possible to have a flexible extension for a prerequisite? For example, let's say I want to apply a rule to a list of targets that all have the same prerequisite pattern, except that some of them have a .xls extension, while the others have .xlsx. I'd like to allow for "%data.xlsx" OR "%data.xl...
Is it possible to have a flexible extension for a prerequisite? For example, let's say I want to apply a rule to a list of targets that all have the same prerequisite pattern, except that some of them have a .xls extension, while the others have .xlsx. I'd like to allow for "%data.xlsx" OR "%data.xls" in the code below.
-make
target := */*report.html
$(target): %report.html: %report.qmd %data.xlsx
quarto render $<
If it helps, I'm trying to re-compile all .qmd files in their respective directory; they result in .html files, and need data files that are either .xls, or .xlsx
- job1/
- job1_report.html
- job1_report.qmd
- job1_data.xls
- job2/
- job1_report.html
- job2_report.qmd
- job2_data.xlsx
- ...
user2165907
(111 rep)
Apr 19, 2025, 12:12 AM
• Last activity: Apr 21, 2025, 06:26 PM
Showing page 1 of 20 total questions