I was thinking about this blog post since some time now but I never wrote it because I thought it will be lame. Many of us are using Make but most of us don't know the power for using it everyday for easy tasks... I use Make in nearly all of my projects and it is soo helpful to me.
Now let's Make make things done...!
Sooooo, what is Make?
From the GNU Make website: "GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files. Make gets its knowledge of how to build your program from a file called the makefile, which lists each of the non-source files and how to compute it from other files. When you write a program, you should write a makefile for it, so that it is possible to use Make to build and install the program."
As you can read, Make is built for software developers to build binary files from their code and for this Make is very useful especially when having many source files for building the final piece of software...
But!!! Make is soo powerful to just execute very easy but boring tasks with just one command. So let's say you have to execute a few commands every time you want to execute some repeating tasks in your project, just use Make.
Make is based on makefiles so you need to create a file named Makefile in the root of your project. You can have makefiles in subfolders of your project tree but I will not cover this here because this post is about the most simple usage of Make.
A very simple Makefile is shown below. It creates a file when you in your current working directory just run "make" or "make all". When you then run "make clean" the file will be deleted.
Our first Makefile:
all: touch file clean: rm -f file
This is easy... or not?
A more useful example:
Let's say, you have three commands you need to execute to make a backup of three hosts you are responsible for. Just create a directory where you want to store you backup Makefile. Just name it what you want. "cd" to that directory and create a Makefile with the content below. When you now run "make" or "make backup" in the new directory three "rsync" commands will be executed... This is nice because you can define very complex tasks and they are documented in the Makefile and not only in the shell history. To be honest this example is really very lame but it shows the power of make for everyday tasks in allday projects.
backup: rsync -av host1.example.com:/ /backup/host1/ rsync -av host2.example.com:/ /backup/host2/ rsync -av host3.example.com:/ /backup/host2/
At the end...
Make is soo much more powerful but as I said before I will not cover this here. The most well known project which is beeing build using Make is the Linux Kernel but even other very important projects like OpenWrt are beeing built using Make. I mention these two projects because they are really using Make to the edge. Since a very long time most C code based projects on GNU (gcc) based operating systems are using Make for compiling their code to executables or libraries.
I use Make every day because I have repeating tasks consisting of more then one command in all of projects and Make makes it easy for me to handle this. When you have some shell completion and are writing "make " and then hitting the "tab" key in your project root you will also have all "make commands" available you defined in the Makefile.
I am very happy that we can use so many powerful tools for free when using a free and open operating system like GNU/Linux!
I hope this helps you and I wish you a lot of fun when you let Make get your job done... :)
sorry, I wanted to write this post earlier but a bad Covid-19 infection kicked me out of life for some weeks. I am healthy since some days but I still have many problems. I wish no one to get infected by Covid-19. My father was infected too but he didn't had so many problems that I had. So, Covid-19 != Covid-19 for everyone.
A photo of my current workspace:
So, I wrote in my last post that I will report about my Wine "use case". Here it is and as you could read before, it is about music production using Ableton Live on Linux.
Ableton Live works very nice without any limits and errors using Linux, Wine, JACK and the WineASIO driver for low latency (5ms is very nice). In my case it is the systemd free Linux distribution named Artix. Artix is based on Arch Linux and is my everyday Linux since some years now...
You see a NOVATION BassStation on the left, then a Behringer TD-3 (yellow) and a Behringer RD-6 (red) followed by an M-AUDIO OXYGEN PRO 25 MIDIcontroller. In the middle is a Behringer XENYX X1622USB mixer and on the right a second Behringer TD-3 (silver). Two 303 clones are very useful when making acid sound! :D I am missing my two QUASIMIDI "The Raven" currently because they have some broken parts but I am fixing this in the near future and then I can rave on like in the 90's... :)
On the screens you see Ableton Live 11 which is the only DAW (Digital Audio Workstation) working perfectly on Linux using Wine. I read about other DAW's are working too but I really like the user interface of Ableton Live. I came from an Atari world using Cubase in the 90's and Ableton Live was intuitive like Cubase for the Atari computer. Todays Cubase is not an option for me because it does not work on Linux / Wine and also it is too oversized. I will not comment on other software here because I wanted Ableton Live. Maybe for you other DAW's are working great and give you a better feeling in usage but for me it will not. So, just try your favorite DAW using Wine on Linux! If the software is written clean and not using crazy Windows libraries it will maybe work. Ableton Live is using Qt for the user interface and since Qt is available for many operating systems (Linux, OSX, Windows etc.) with the same codebase it is working very smoothly using Wine on Linux. I recommend to get a free trial version of your favorite DAW before buying something because you can get errors and problems later. I tried Ableton Live for some days and stress tested it a little bit and all I did worked right out of the box without any errors. Even a lot of VST plugins are working perfectly nice... :)
To be honest, even free and open source DAW's does not have the power for creating electronic music in a productive way. Ardour is a very nice DAW but it is focused on audio recording. For MIDI it is missing a lot of features. Ableton Live is just what I need to go on fast and be productive and creative. But I use Ardour for recording.
It is very nice to see that there is a way for music production on Linux like a pro. Even if Ableton Live is proprietary software it is a very awesome piece of software. I do not hate proprietary software because many tools are just beeing used by a small group of people in the world and development of such a powerful product is really very expensive. I also use other proprietary software like IntelliJ as IDE for software development and I am very happy with this. These products are often not very expensive and I am soo thankful for their existence.
What is Artix Linux?
Answer from the Artix Linux homepage: "Artix Linux is a rolling-release distribution, based on Arch Linux. It uses real init systems, because PID1 must be simple, secure and stable."
What is Ableton Live?
Answer from Wikipedia: "Ableton Live is a digital audio workstation for macOS and Windows developed by Berlin-based Ableton. In contrast to many other software sequencers, Ableton Live is designed to be an instrument for live performances as well as a tool for composing, recording, arranging, mixing, and mastering. It is also used by DJs, as it offers a suite of controls for beatmatching, crossfading, and other different effects used by turntablists, and was one of the first music applications to automatically beatmatch songs."
What is Wine?
Answer from the Wine homepage: "Wine (originally an acronym for "Wine Is Not an Emulator") is a compatibility layer capable of running Windows applications on several POSIX-compliant operating systems, such as Linux, macOS, & BSD. Instead of simulating internal Windows logic like a virtual machine or emulator, Wine translates Windows API calls into POSIX calls on-the-fly, eliminating the performance and memory penalties of other methods and allowing you to cleanly integrate Windows applications into your desktop."
What is JACK?
Answer from the JACK homepage: "JACK Audio Connection Kit (or JACK) is a professional sound server API and pair of daemon implementations to provide real-time, low-latency connections for both audio and MIDI data between applications."
What is WineASIO?
Answer from the WineASIO homepage: WineASIO is a free software driver for Wine that provides low-latency, high-performance audio by way of ASIO. WineASIO enables you to use professional Windows audio composition, production, or engineering software on Linux.
How all this integrates smoothly into your desktop:
I wrote a small script ($HOME/bin/ableton.sh) to start Ableton Live on my computer because by default my desktop is running PipeWire for handling audio, video streams, and hardware and it is not possible to run a JACK session when PipeWire is running. The script kills all PipeWire stuff, starts a JACK session and Ableton Live afterwards. When exiting Ableton Live Qjackctl is the only thing that remains running but when you quit Qjackctl everything comes back to "normal" because the scripts waits to restore everything. Since I use JACK for other things too I do not kill it in the script but you can uncomment line 9 to automate this task.
In my applications menu I just start the script and not the Ableton Live binary directly. Everything behaves very nice for me and feels like nothing special happened. You can run Ableton Live even without JACK and WineASIO using PipeWire but with latencies around 500ms which makes this setup unusable. We would need a PipeWireASIO driver to solve this. Anyway, there is JACK support in PipeWire using pw-jack but i didn't testet it... ;)
#!/bin/sh killall pasystray killall pipewire sleep 3 /usr/bin/qjackctl & sleep 3 /usr/bin/wine start /unix "/home/hanez/.wine/drive_c/ProgramData/Ableton/Live 11 Standard/Program/Ableton Live 11 Standard.exe" #killall qjackctl wait sleep 3 /usr/bin/pipewire & sleep 3 /usr/bin/pasystray &
I believe the "sleep" commands are not so important but I had problems when not waiting a small amount of time before executing the next command.
Since I am using some applications that are only available for Windows operating systems I decided to use Wine instead of dual booting. I do 100% of my work on Linux based systems and it's annoying to reboot every time I need or want to run some .exe files. Using Wine many applications and games are working as expected without any errors. The only thing I did using "winecfg", to make it comfortable for me to use, was to map some Windows folders to some folders in my $HOME directory for making it easy to share files among applications and set my OS version to Windows 10.
I will post more information about my use case in some days... ;)
Ableton Live 11 Standard runs without any problems on Linux using Wine. I tried the trial before buying but couldn't find anything that is not working properly. I will mostly use it as a MIDI sequencer and for audio recording but even software instruments and effects are running like a charme - even some VST plugins are working properly.
Below you can see how I am accessing "drive C:\" from my desktop... My magic symlink... :D
hanez@jupiter ~ # cd C:\\ hanez@jupiter C:\ # pwd /home/hanez/C:\ hanez@jupiter C:\ # echo "?" ? hanez@jupiter C:\ # cd hanez@jupiter ~ # ls -l C:\\ lrwxrwxrwx 1 hanez hanez 26 3. Mai 20:06 'C:\' -> /home/hanez/.wine/drive_c/ hanez@jupiter ~ # echo ":)" :) hanez@jupiter ~ #
BTW: Many years ago I already played games using Wine. Here is a screenshot of Command and Conquer Red Alert 2.
UPDATE (July 20, 2022): I needed to install some fonts to make some VST plugins to work. I used winetricks for that and just installed all available fonts but I think it should be enough to only install "corefonts" but I don't know.