Alternative uses for makefiles

The file file is usually used to compile the source; however, as a dependency mechanism, it makecan have many more possibilities.

For a small example, I have a script that runs daily, and it can update or create some "* .csv.gz" files in a directory based on some web clips; all gzipped files need to be combined into one file, and if there are new files, it is obvious that the consolidation process should be started.
In my case, the following makefile does the following task:

consolidation: datasummary.pcl

datasummary.pcl: *.csv.gz
    consolidate.py

The cron task starts the update process, and then make consolidation; if the file is datasummary.pclolder than any file *.csv.gz, it starts consolidate.py.

I'm very interested in ideas about the unusual (and not about the original compilation) use of the makefile. What other interesting examples of using a makefile can you give?

Suppose we are talking about GNU make; if not, indicate the version.

+3
source share
2 answers

I remember something a few years ago about loading Linux systems using Make files. The individual components of the system were set as targets, and make first loaded the dependencies, such as make. I believe they got impressive download speeds. This led to dependency-based booting in Debian / Ubuntu.

+1
source

, , make named, dhcpd pxe. :

ipaddr           name         alias1 alias2    #  model os      printer

:

192.168.0.1      battledown   nfs dns ldap     #  x3550 RHEL5u4 brother-color

make, , . , .

+1

Source: https://habr.com/ru/post/1768618/


All Articles