CFLAGS vs CPPFLAGS

The implicit make rule for compiling a C program is %.o:%.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< where the $() syntax expands the variables. As both CPPFLAGS and CFLAGS are used in the compiler call, which you use to define include paths is a matter of personal taste. For instance if foo.c is a … Read more

Make install, but not to default directories?

It depends on the package. If the Makefile is generated by GNU autotools (./configure) you can usually set the target location like so: ./configure –prefix=/somewhere/else/than/usr/local If the Makefile is not generated by autotools, but distributed along with the software, simply open it up in an editor and change it. The install target directory is probably … Read more

What are Makefile.am and Makefile.in?

Makefile.am is a programmer-defined file and is used by automake to generate the Makefile.in file (the .am stands for automake). The configure script typically seen in source tarballs will use the Makefile.in to generate a Makefile. The configure script itself is generated from a programmer-defined file named either configure.ac or configure.in (deprecated). I prefer .ac … Read more

tech