Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
39 views

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)...
user377486's user avatar
2 votes
1 answer
47 views

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 ...
user44791's user avatar
Advice
5 votes
0 replies
111 views

I have a project where I need to build a series of targets. If the target has a same-named 'suppsrc' file that can be transformed to a 'supplement' file, use that too. That is, if I have a file a.in, ...
Keith Davies's user avatar
0 votes
1 answer
77 views

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 ...
Pollo's user avatar
  • 299
0 votes
2 answers
68 views

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 ...
Metal Slime's user avatar
-1 votes
0 answers
30 views

I have a very simple Makefile: a b c: @echo work done for target $@ I would expect, that the echo command is run for any of the 3 targets. I would expect the output: work done for target a work ...
JSc's user avatar
  • 1
0 votes
1 answer
43 views

I have a recursive Makefile setup where a root Makefile delegates builds to subdirectory Makefiles via $(MAKE) BUILDTARGET=.... Most subdirectories build fine, but the boot/ directory behaves ...
martin esparragoza's user avatar
0 votes
1 answer
93 views

Consider this Makefile: run-%: % ./$< I have a test1.cpp file, so I expect make to build test1.o and test1 using chained implicit rules when I run make run-test1. However, what I get is make: *...
Jason's user avatar
  • 386
-4 votes
1 answer
61 views

I want GNU make command to fail if the environment var AUTO_CALL is not specified. I could do so: .PHONY: x x: ifndef AUTO_CALL @echo "Don't call `make` manually." else ... endif ...
porton's user avatar
  • 5,909
2 votes
1 answer
56 views

I have been making a Haskell project that I want to continue on in C at some point through the FFI. I wanted to create a makefile to compile all the source with Clang for C and GHC for Haskell. The ...
Jacob Bauer's user avatar
1 vote
0 answers
75 views

I am working on Windows OS. And here is my makefile snippet. COMPILER_ROOT := C:/Users/kpt DATE := $(COMPILER_ROOT)/build/busybox_glob.exe date SED := $(COMPILER_ROOT)/build/busybox_glob.exe sed ...
kathy's user avatar
  • 45
1 vote
2 answers
59 views

I cannot comment out an info line inside a define. The following makefile shows the behavior (mind the tabs) define tmpl $(info info inside define, not commented, parameter is: $(1)) # $(info info ...
stefan's user avatar
  • 3,791
0 votes
0 answers
32 views

While installing GCC-15.1.0 on TinyCore64 Linux on Oracle VirtualBox on Windows 11 Home on Acer Aspire Thin & Light Laptop with AMD Ryzen 5 5625U with 48GB (16GB+32GB) RAM & 512GB NMVe gen3.0 ...
Chi Kun's user avatar
1 vote
1 answer
83 views

I'm trying to keep my Makefile compatible between BSD and GNU make. It is not particularly complicated, but there is one spot, where I'd very much like to assign a value based on the output of a ...
Mikhail T.'s user avatar
  • 4,266
3 votes
1 answer
215 views

I'm working on a project in C, and I'm using GNU Make to handle compiling everything, but I'm having a lot of trouble trying to compile every .c file in my project, including ones in subdirectories. ...
TimeSquared's user avatar
0 votes
0 answers
36 views

I have a makefile that has to deal with building for both Windows and Linux platforms. I use wsl for the Linux testing. I have a build tree as thus: makefile src (sub makefile in here as well) obj man ...
Daniel Evans's user avatar
0 votes
1 answer
43 views

I encountered the following line in a g++ generated .d file "/home/test/file27.gcm":| /home/test/file27.o What does ':|' means compared to ':' I could not find any mention of it in gnu make ...
programmer's user avatar
0 votes
2 answers
77 views

I have an issue in a Makefile where I'm trying to read a value in from an AWS secret manager secret into a Make variable as follows: $(eval SECRET_NAME := some/aws/secretname) $(eval SECRET_FILE := ....
scot's user avatar
  • 1,310
0 votes
0 answers
42 views

In a makefile I need to check, whether a program rocq exists in the system. If it exists assign one value to the variable, otherwise assign another value. I created the following code: OUTPUT=$(shell ...
user4035's user avatar
  • 24k
2 votes
2 answers
94 views

The project I am working on is required to incorporate sources from a previous project, however, the configuration of that code differs between the legacy and current project. The legacy source uses a ...
Walkingbeard's user avatar
0 votes
1 answer
31 views

I am trying to setup each target to measure the elapse time the target takes when using a GNU Make file. I started to prototype this code. date: start_time := $(date +"%S") @echo "Start ...
Twowolfs's user avatar
0 votes
1 answer
137 views

In a makefile, I want to have a macro that inserts some symbols/source code from one variable into another one if those symbols/source code do not exist in the destination variable: the way I want to ...
Ulises V.'s user avatar
1 vote
0 answers
48 views

I would like to have a single list of prerequisites to be used in multiple targets. I came up with the syntax below. For some reason I have to have the string substitution rules both in the assignment ...
olh's user avatar
  • 328
1 vote
1 answer
51 views

I have the following Makefile sample: BUILD = build PATH_POT3 = src/pot/pot3/ MPIFC = mpiifort FFLAGS = -O3 MOL_LIST = $(shell find $(PATH_POT3) -mindepth 1 -maxdepth 1 -type d) $(foreach MOL,$(...
TobiR's user avatar
  • 203
0 votes
0 answers
100 views

I'm compiling a custom build of AOSP 12.1 r27 with my own device tree. I've added the following line to device.mk PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/prebuilt/[email protected]:$...
Nate's user avatar
  • 181
2 votes
1 answer
103 views

I ran into a problem when the linker complains about undefined reference to <function> after compiling all the objects and files, even though functions are declared and defined. I've been ...
rat's user avatar
  • 41
0 votes
1 answer
182 views

I would like to use the astrometry.net software suite on windows, specifically the executable files, not the web interface. However, there are no recent and maintained binaries for Windows I could ...
LoneWanderer's user avatar
  • 3,347
0 votes
0 answers
55 views

I inherited a fairly large project, built with autoconf. It builds fine in static, but has a very strange behavior when building shared, namely the libfoo.so is created as a symbolic link to libfoo.so....
Davide's user avatar
  • 17.9k
2 votes
2 answers
82 views

I have a makefile with a loop that should iterate through the elements in a list and pass each element to a function. In the first iteration, it seems to pass a blank element, and then it never passes ...
CONts's user avatar
  • 33
0 votes
1 answer
45 views

Please consider the following setup: $ ls base.mk file.ext Makefile $ cat Makefile include base.mk algorithm = another-alg $ cat base.mk source = file.ext binary = $(algorithm) algorithm = the-alg ...
onlycparra's user avatar
1 vote
2 answers
76 views

I want to use the tool msgfmt in a makefile to generate .mo files from .po sources. The .po sources are per language and reside in a folder structure like this: $(projectpath)/locale/de/LC_MESSAGES $(...
Ultra Junkie's user avatar
1 vote
2 answers
94 views

I have the below Makefile. # # General Makefile # BUILD := build CXXFLAG := -std=c++20 CXX := g++ SRC := 16.15.cc OBJ := $(SRC:%.cc=$(BUILD)/%.o) DEP := $(OBJ:.o=.d) MKDIR_P := mkdir -p all: ...
yapkm01's user avatar
  • 3,811
3 votes
1 answer
99 views

Here is a Makefile I made, it is quite explicit but also maybe too verbose and I wonder if it would be possible to change things (whether it be the logic or the directory structure itself) in order to ...
ismbks's user avatar
  • 98
0 votes
1 answer
77 views

The following Makefile configs = $(filter-out $(wildcard ./configs/project/*/root.yaml), $(wildcard ./configs/project/*/*.yaml)) .PHONY: compile compile: $(configs:.yaml=.sql) %.sql: %.yaml @...
Ari's user avatar
  • 4,211
4 votes
1 answer
345 views

In the last few weeks, I've been experimenting for the first time with C++20 modules after reading about them for years. I extensively worked with them in Visual Studio and I did some successful test ...
Andrea Bocco's user avatar
  • 1,088
0 votes
1 answer
266 views

During R package installation on Windows, make fails on the step of detecting gcc: > devtools::install('c:/Temp/REddyProc-1.3.3') ── R CMD build ───────────────────────────────────────────── ✔ ...
halt9k's user avatar
  • 1,055
1 vote
1 answer
68 views

I am trying to re-assign a makefile variable (depending on its initial value), while keeping the new value in a submakefile. Here is the layout: Makefile subdir/ - Makefile-sub Main makefile: ...
Magyar_57's user avatar
0 votes
1 answer
113 views

I am trying to install Coin-HSL (https://licences.stfc.ac.uk/product/coin-hsl) to use with CasADi in Matlab on Windows. I did the following: Install MSYS2 in C:/msys64 In MSYS2 I installed the ...
LeoMa's user avatar
  • 11
0 votes
0 answers
89 views

I'm trying to compile gmake with tcc in a (gentoo) musl-libc system. I first configure with CC=tcc ./configure --program-prefix=g then ./build.sh but I get the following error: config.status: creating ...
Andrew K's user avatar
2 votes
1 answer
33 views

I have a makefile that is running a custom program on large numbers of input file. The program has large startup cost, and is more efficient processing multiple files in the same run I would like to ...
dash-o's user avatar
  • 14.7k
-1 votes
1 answer
36 views

It's been a very long time since I had to use Make, and I remember there was a trick to do this, but my memory fails me, and the vocabulary is too general for the search... So: SOURCES := $(wildcard */...
wvxvw's user avatar
  • 9,713
0 votes
0 answers
82 views

I want the result of the tool in REVTOOL and its parameters returned into variable REV. I tried with this call in my makefile: commonbase := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) ...
Volker's user avatar
  • 507
0 votes
1 answer
38 views

I have a command that will check foo.cpp and MAY regenerate it. Regeneration is based of factors that aren't knowable to make, so I must run the command every time. libfoo.a depends on foo.o which ...
Swiss Frank's user avatar
  • 2,514
1 vote
1 answer
43 views

I've been reading the make manual to try to decypher an existing Makefile. I'm stuck on the filter-out in this line: KERNEL_ELF_DEPS = $(filter-out %: ,$(file < $(KERNEL_ELF).d)) $(KERNEL_MANIFEST)...
simgar's user avatar
  • 618
0 votes
1 answer
45 views

I want my gmake to recursively gmake in all subdirectories, but first copy a Makefile to a given subdirectory before running make there, if it doesn't already exist. The following works perfectly, but ...
Swiss Frank's user avatar
  • 2,514
0 votes
0 answers
74 views

Body: I am experiencing a strange issue with GNU Make on WSL (Windows Subsystem for Linux). When using = for variable assignment, concatenation doesn't work as expected. However, when I switch to :=, ...
范北海's user avatar
0 votes
0 answers
40 views

I am trying to build Apache TVM library for MIPs platform using steps explained on this page for RISC. Following are the steps I followed: $ sudo apt-get update $ sudo apt-get install g++-9-multilib-...
MsA's user avatar
  • 3,029
0 votes
2 answers
57 views

This makefile can generate images for each page of PDF documents: %.pdf: wget http:/example.com/$@ doc_0-page_0.png: doc_0.pdf convert "$^[0]" $@ doc_0-page_1.png: doc_0.pdf convert &...
Isidro Arias's user avatar
1 vote
1 answer
43 views

I've generated dependency files (*.d) automatically with make (using g++ -MMD), and in these files I see that the rules created don't have any recipes. Moreover, from my testing, I've noticed that ...
Hakim's user avatar
  • 3,457
0 votes
2 answers
55 views

I have a tool that I use to generate C++ header files as part of the build. I only want to write out the generated headers if they changed from what is already on disk so that I don't trigger a ...
ryan's user avatar
  • 1

1
2 3 4 5
93