add basic makefile examples
This commit is contained in:
		
							
								
								
									
										86
									
								
								slides/makefiles/makefiles.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								slides/makefiles/makefiles.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,86 @@ | |||||||
|  | --- | ||||||
|  | title: | ||||||
|  | - Making Makefiles | ||||||
|  | author: | ||||||
|  | - Malin | ||||||
|  |  | ||||||
|  | theme: | ||||||
|  | - Warsaw | ||||||
|  | colortheme: | ||||||
|  | - orchid | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | # Intro | ||||||
|  |  | ||||||
|  | - input, process, output. | ||||||
|  | - automatic idempotence | ||||||
|  | - *Gotcha*: directories | ||||||
|  | - This, that, and these | ||||||
|  |  | ||||||
|  | *** | ||||||
|  |  | ||||||
|  | # Variables | ||||||
|  |  | ||||||
|  | - From your shell. | ||||||
|  | - New variables. | ||||||
|  | - Filenames as variables. | ||||||
|  | - *Gotcha*: no shell variables, only make! | ||||||
|  |  | ||||||
|  | ## Equality | ||||||
|  |  | ||||||
|  | - Variables with '=', never ':='. | ||||||
|  | - *Gotcha*: one shell per line. | ||||||
|  | - Variables as shell output. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | *** | ||||||
|  |  | ||||||
|  |  | ||||||
|  | # Phonies, and the Problems with Lies | ||||||
|  |  | ||||||
|  | - clean (common) | ||||||
|  | - check (excellent) | ||||||
|  |  | ||||||
|  | *** | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ## Non-Compiling Checks | ||||||
|  |  | ||||||
|  | - `make` -n | ||||||
|  | - *Gotcha*: shell output variables. | ||||||
|  |  | ||||||
|  | *** | ||||||
|  |  | ||||||
|  |  | ||||||
|  | # The Fourth Sigil: `%` | ||||||
|  |  | ||||||
|  | - Standard rules, e.g. ImageMagick, copying, et c. | ||||||
|  | - *Gotcha*: intermediaries are deleted. | ||||||
|  |  | ||||||
|  | *** | ||||||
|  |  | ||||||
|  |  | ||||||
|  | # Bling: make2graph | ||||||
|  |  | ||||||
|  | - *Gotcha*: completely outdated. | ||||||
|  |  | ||||||
|  | *** | ||||||
|  |  | ||||||
|  | # Inclusivity | ||||||
|  |  | ||||||
|  | - `include dir/Makefile` | ||||||
|  | - *Gotcha*: directory has not changed | ||||||
|  | - `$(MAKEFILE_LIST)` | ||||||
|  |  | ||||||
|  |  | ||||||
|  | # Special Commands | ||||||
|  |  | ||||||
|  | - dirname | ||||||
|  | - `DIR = test -d $(dirname $@) || mkdir $(dirname $@)` | ||||||
|  | - patsubst | ||||||
|  | - Wildcards (or not?) | ||||||
|  |  | ||||||
|  | # Maintanance | ||||||
|  |  | ||||||
|  | - backups | ||||||
|  | - saving files | ||||||
		Reference in New Issue
	
	Block a user