Hot answers tagged make
12
If you are trying to learn Linux, don't use Cygwin. Cygwin is primitive compared to modern Linux distributions. The Cygwin package manager (setup.exe) is horrible, and has needed a new UI for ages. Cygwin is different enough that you will spend a lot of time troubleshooting silly issues. Installing Xwindow and QT apps on Cygwin can be difficult and a waste ...
11
make install does whatever the Makefile author wants it to do. Typically, by this point, it is too late to change the install directory, as it is often known earlier, during the build, so help files and configuration files can be referenced with the correct pathnames.
Many projects use the GNU Autotools to try to improve their portability among hardware and ...
11
I was starting to get an exception as well:
make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)
Might be a different reason, but this problem is apparently caused when the PATH variable contains parentheses (, ), as it does on Win Vista/7. Unfortunately, the available GNU for Windows is hopelessly outdated.
My problem was fixed by ...
10
Make is a general purpose workflow program, usually used for compilation. But it can be used for anything.
When you do something like "make all", the make program executes a rule named "all" from a file in current directory named "Makefile". This rule usually calls the compiler to compile some source code into binaries.
When you do "make install", the make ...
9
Your 3rd version is correct, ./configure && make && sudo make install. Make and configure can be done as a normal user since you aren't trying to write files in a system directory, make install will often try to copy the binaries to /usr/bin or /bin which requires root access to write.
9
When you installed the Apple Developer tools, did you also install the "Unix Development" package? From the Xcode 3.2.2 developer tools for Mac SDK 10.6 and iPhone SDK 3.2 README file:
Installation
The Xcode and iPhone SDK installer provides six options for configuring the installation from the “Customize...” button:
...
UNIX ...
8
From the vim(1) man page:
+{command}
-c {command}
{command} will be executed after the first file has been read. {command} is interpreted as an Ex command. If the {command} contains spaces it must be enclosed in double quotes (this depends on the shell that is used). Example: Vim "+set si" main.c
Note: You can use up to 10 "+" or "-c" ...
7
You may not actually need root permissions to install a given software package, or you may not have access to root privileges via sudo or su or other methods.
One of the ./configure script's common options is --prefix, which changes the base installation directory from whatever the default is. So on a system where I have no root privs at all, I can still ...
5
Most important thing to mention regarding installing software on Linux is that it's much more reliable and easy to install software from your distribution (this is it's purpose!). Only use make install if there's no other way (consider alternate programs as well).
Common mistake of Windows users is to download programs from different places and try to ...
4
The terminal used by gvim is a very dumb terminal. Among other things, it doesn't support ANSI color sequences. See
:help gui-shell
for a little on this. If you launch a shell from gvim (:sh), you can send ANSI color sequences to the "terminal" (e.g., ls --color=always) and you will see the escape sequences themselves, not colors.
4
You don't need to write any special Makefiles for determining the number of cores; the default flags can be specified in environment and Linux coreutils come with a tool called nproc:
export MAKEFLAGS="-j$(nproc)"
If nproc does not exist in your system, an alternative (also only for Linux) is getconf:
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
...
4
sudo is only available in certain distributions. In others, you must use su
to switch to the root user, the run the command. They are NOT assuming you are already logged in as root, since you should never just be running things as root. They are assuming that you know enough about your system to know how to run something as root. It is quite common to ...
4
Recipies in a makefile must be preceeded by a single standard tab character, nothing else.
^I is the representation of the tab character (see the table on the Wikipedia ASCII page), and therefore this should be correct.
So you should be able to enter it using Tab or Ctrl+I.
(assuming these are not remapped by the software)
Edit
On further investigation ...
4
Some of the tests are historic. In some cases the software package is really old and has been around long enough that they tried to build on old systems that didn't have all the resources that we have now. But you might as well leave these old checks in - it doesn't cost much in the way of size.
Some of the checks are for multiple ways of doing things. If ...
3
The line
sudo cp bin/* /usr/local/bin
is installing the compiled binaries into /usr/local/bin. If you want to install them someplace else, simply change the destination folder in this statement. For example if you want to put them in a bin folder in your home directory it would be
cp bin/* ~/bin
(You can omit the sudo part if you are installing to ...
3
You can use inotifywait from inotifytools:
This command simply blocks for inotify events, making it appropriate for use in shell scripts. It can watch any set of files and directories, and can recursively watch entire directory trees.
3
Not a bash solution, but you should use a Makefile, possibly with -l to not
exceed some maximum load.
NJOBS=1000
.PHONY = jobs
jobs = $(shell echo {1..$(NJOBS)})
all: $(jobs)
$(jobs):
do_something $@
Then to start 20 jobs at a time do
$ make -j20
or to start as many jobs as possible without exceeding a load of 5
$ make -j -l5
3
make(1) is an extremely powerful tool.
Generally, when a program is distributed as source code, the archive containing the code will also include Makefiles. make can read these files and turn the source code into an executable program.
Despite the fact that you'll most often see make used to turn .c files into .o files and .o files into executables, make ...
3
You can have both Windows and Linux on the same disk, by using Linux as an application within Windows. This way, you don't disturb Windows at all.
I suggest the Wubi linux distribution, since it's a variant of the very popular and easy to use Ubuntu Linux. Wubi allows you to install and uninstall Ubuntu as any other Windows application, in an extremely ...
3
Technically, there is no reason why not - this really is based on how the makefile was set up. It is all designed around dependencies. If the 'install' target is made dependent on the rest of the product, then it would implicitly build the product as you are thinking.
The reason they are separated out is that you are usually going to do a 'make' as the ...
3
A version of nmake which is compatible with Windows 7 also comes with xampp:
http://www.apachefriends.org/en/xampp-windows.html
Or you can try here:
http://johnbokma.com/perl/make-for-windows.html
3
You're looking for inotifywait, part of inotify-tools. There are some examples of how to use it on the project's site but a simple approach is,
while true; do inotifywait code.cpp -e modify; make; done
the key part of which is,
inotifywait code.cpp -e modify
That command will wait until code.cpp is modified then exit. Put in the infinite loop and ...
3
Xcode 3
The latest Xcode 3.2.6 (with the iOS SDK) is available under this link:
https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_3.2.6_and_ios_sdk_4.3__final/xcode_3.2.6_and_ios_sdk_4.3.dmg
You need to be signed up to the free Apple Developer program in order for this to work, I guess. Note that this version will not ...
3
sed only sees one line at a time, so searching for consecutive line-feeds will not work. One way is to push all the data into the hold space, and then do the replace when all input has been gathered, e.g.:
sed -r -n '
$! { # When it is not the last line
1 { h } # Replace hold space with first line
1! { H } # Otherwise ...
3
You need the last version:
./configure && make && sudo make install
Configure and make can happen in your local folder but you'll need root permissions to install. That command accomplishes it.
Make sure the application you're installing isn't in the package manager already. It's typically much easier to use the pre-compiled software for ...
2
How about:
#!/bin/bash
if ! [ -e /path/to/foo ]
then
cp foo /path/to/
fi
Even better, if this is e.g. a configuration file that might have new, useful options you could:
#!/bin/bash
if ! [ -e /path/to/foo ]
then
cp foo /path/to/
else
cp -f foo /path/to/foo.new
fi
so that they still have a copy they can refer to.
2
I think your commands from your Makefile are just going to be bash? If so, you can try using the bash if conditional that depends on whether the file exists:
if [ -f $FILE ];
then
#echo "File $FILE exists"
else
#echo "File $FILE does not exists"
cp $SRC_FILE $FILE
fi
Bash code from here.
In the event that you discover the Makefile being run in ...
2
I have found that trying to use CPAN with cygwin is more bother than it is worth. I ended up ignoring cygwin's perl. I installed Strawberry perl and told cygwin to use that instead.
It's not perfect but fails to build a lot less CPAN modules than the native cygwin perl.
2
It all depends on how portable the developers made their program. Unix is not GNU/Linux and therefore not all programs will compile that easily on a Mac as they would on a typical Linux system. Expect developers to be lazy – some might even try to compile their code on Windows and Ubuntu only.
How to install NEAT C++
However, this one's relatively easy.
...
Only top voted, non community-wiki answers of a minimum length are eligible