Activate virtualenv in Makefile

Here’s how to do it: You can execute a shell command in a Makefile using (); E.g. echoTarget: (echo “I’m an echo”) Just be sure to put a tab character before each line in the shell command. i.e. you will need a tab before (echo “I’m an echo”) Here’s what will work for activating virtualenv: … Read more

Alias target name in Makefile

Okay, I needed something similar. The path to my output artifacts were quite long, but I wanted short target names and also benefit easily from bash-completion. Here is what I’m came up with: os := [arbitrary long path to an artifact] platform := [arbitrary long path to a differ artifact] packer := [common parts of … Read more

In makefiles what do CC and LD stand for?

Names of these variables originate from names of the corresponding tools. Usually the meaning of these abbreviations is the following: CC stands for “C compiler” (in GCC abbreviation it is also treated as “compiler collection”). LD is a linker (comes from “link editor” or from “loader”). These are also commonly used in makefiles (see Implicit … Read more

Makefiles: What is an order-only prerequisite?

First, let’s recall what the ordinary prerequisites are. Basically, the prerequisites in Makefile have two functions: They are checked and, if necessary, are built before the target If any of the prerequisites gets rebuilt (or is simply newer than the target) then the target will also be rebuilt. Now, the order-only prerequisites do item 1, … Read more

Complex conditions check in Makefile

If your make is GNU-make and all the defined variables include a non-space character, ifdef VAR1 && VAR2 && VAR3 can be written as ifneq ($(and $(VAR1),$(VAR2),$(VAR3)),) On a related note, probably and function requires version 3.81 or later. In case some defined variables may be empty strings, if we prepare the following functions: ifndef_any_of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)