Questions tagged [makefile]
88 questions
568
votes
14 answers
How do I make rm not give an error if a file doesn't exist?
I'm writing a makefile that will clean up some useless files at the end of the compilation. If a target has already been made, it will of course skip that target and the useless file may not be there. So if I do this:
rm lexer.ml interpparse.ml…
Jason Baker
- 8,932
90
votes
5 answers
How to run make file from any directory?
In order to run make file, I am supposed to go to the make file's directory and from there only I can run the make file. How can I do the same even if i am in any directory?
Dinesh
- 1,079
29
votes
3 answers
How to setup vim to edit both Makefile and normal code files with two different types of indentation?
I am using Mac OSX 10.7.5, the contents of .vimrc is as follow:
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set shiftround
set smarttab
set autoindent
set copyindent
autocmd FileType make setlocal noexpandtab
What I am…
forestclown
- 521
- 1
- 7
- 14
12
votes
4 answers
How to use makefiles on Windows
I have a LaTeX project using make files for compilation and want to write the texts on Windows using Kile.
I had a quick look on google but only really came up with Make for Windows the last version of which dates back to 2006. Maybe it is just…
black_puppydog
- 277
- 1
- 3
- 6
11
votes
1 answer
How to escape "$@" in a makefile?
test:
@echo "#!/bin/bash\njava -classpath \"$(CLASSPATH)\" com.atm.ATM \"$@\"" > test
@chmod a+x test
I am trying to escape the "$@" so that it literally appears in the "test" script as "$@" (passing the arguments invoked on the bash script…
xomm
- 331
9
votes
2 answers
Makefile fails to install file correctly, installing HPL
I started installing HPL a while ago and had a related question. I've been following along with this guide from Intel. I figure this warrants a whole new one. When I try to make the archive, the output seems fine until the end, where it gives an…
zr00
- 331
- 5
- 16
7
votes
2 answers
For simple projects, what do makefiles offer over "plain" bash scripts?
For example, if I'm developing a front-end only website, I might have several CoffeeScript files, several Sass files, several HTML Files, and a few images.
The CoffeeScript files need to be compiled to JavaScript, the Sass files need to be compiled…
Closure Cowboy
- 730
5
votes
2 answers
Unable to preserve hard links. Why?
I'm trying to create a Makefile that would automate remastering Knoppix distribution.
I'm trying to copy filesystem from the read-only compressed loop device to normal filesystem to be able to modify it and then compress it to replace the old one.…
dpc.pw
- 143
5
votes
1 answer
cd in a Makefile doesn't seems to be taken into account after sshfs
I have a Makefile with a sshfs command followed with a cd command:
mr: # mount-remote
sshfs -p 5022 -o nonempty myname@myssh.serveur.fr:mnt /home/julien/myworking_path
cd ./working_directory_mwe1/wk_subd_mwe2/
The first command,…
JKHA
- 189
5
votes
1 answer
Install R 3.5.2 under Ubuntu: "jni.h: No such file or directory"
I have a problem with installing the newest version of R, an error "fatal error: jni.h: No such file or directory" that I don't understand appeared.
Here is what I did before getting an error in the installation of R :
#download tar.gz…
4
votes
1 answer
Should make contain `-rm` or `rm -f`
The question should be clear from the title, but here goes.
Which is better, or, are there any better options:
thing:
rm -f a.file b.file
doTheMake
thing:
-rm a.file b.file
doTheMake
I want always to delete a.file and b.file…
Ainsley H.
- 143
4
votes
0 answers
How do I write a Makefile target for hundreds of numbered files?
I have some art projects that use blender as part of the toolchain. I would like to be able to write a Makefile target which specifies that several hundred files can be updated with a single command. The following syntax does not actually work,…
Mutant Bob
- 382
4
votes
3 answers
Diff in bash script?
I've been toying around with makefiles and bash scripts and I'm interested in this:
Is it possible to get a boolean value from a diff(or something similar) so that I can use it in a bash script to evaluate an if statement(so that the user will not…
Gman
- 41
4
votes
1 answer
Use matlab in makefiles etc. How to speed things up?
I use a lot of matlab to process data etc. Yet I find my workflow a bit of sluggish, so I was wondering if I could speed things up a little using makefiles.
What I would like to do is write an .m file which, when called, creates a file with all of…
romeovs
- 309
4
votes
2 answers
Send env to a makefile target
I am trying to set an env var which is git sha1 commit for a makefile target. I am setting a lot of env vars and only this fails with no such file or directory error. I am hell confused. Please help me pass this as env var to my makefile target.…
Medhamsh
- 303