tools: shake cleanup, webmanual target fixup
This commit is contained in:
		
							parent
							
								
									2089168e7d
								
							
						
					
					
						commit
						a0e62a1d89
					
				
							
								
								
									
										18
									
								
								Shake.hs
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								Shake.hs
									
									
									
									
									
								
							| @ -42,8 +42,8 @@ import "directory"    System.Directory as S (getDirectoryContents) | |||||||
| 
 | 
 | ||||||
| usage = [i|Usage: | usage = [i|Usage: | ||||||
|  ./Shake.hs compile       # compile this script (optional) |  ./Shake.hs compile       # compile this script (optional) | ||||||
|  ./Shake                  # show commands |  | ||||||
|  ./Shake --help           # show options, eg --color |  ./Shake --help           # show options, eg --color | ||||||
|  |  ./Shake                  # show commands | ||||||
|  ./Shake manpages         # generate nroff files for man |  ./Shake manpages         # generate nroff files for man | ||||||
|  ./Shake webmanpages      # generate web man pages for hakyll |  ./Shake webmanpages      # generate web man pages for hakyll | ||||||
| |] | |] | ||||||
| @ -93,15 +93,15 @@ main = do | |||||||
|     -- docs |     -- docs | ||||||
| 
 | 
 | ||||||
|     -- man pages, converted to man nroff with web-only sections removed |     -- man pages, converted to man nroff with web-only sections removed | ||||||
|     let manpageNroffsForMan = [manpageDir p </> p | p <- manpages] |     let manpageNroffs = [manpageDir p </> p | p <- manpages] | ||||||
| 
 | 
 | ||||||
|     -- man pages, still markdown but with man-only sections removed |     -- man pages, still markdown but with man-only sections removed | ||||||
|     -- (we let hakyll do the final markdown rendering) |     -- (we let hakyll do the final markdown rendering) | ||||||
|     let manpageMdsForHakyll = ["site" </> p <.>".md" | p <- manpages] |     let webManpageMds = ["site" </> p <.>".md" | p <- manpages] | ||||||
| 
 | 
 | ||||||
|     phony "manpages" $ need manpageNroffsForMan |     phony "manpages" $ need manpageNroffs | ||||||
| 
 | 
 | ||||||
|     manpageNroffsForMan |%> \out -> do |     manpageNroffs |%> \out -> do | ||||||
|       let |       let | ||||||
|         md = out <.> "md" |         md = out <.> "md" | ||||||
|         tmpl = "doc/manpage.nroff" |         tmpl = "doc/manpage.nroff" | ||||||
| @ -114,9 +114,9 @@ main = do | |||||||
|         "--filter doc/pandoc-capitalize-headers" |         "--filter doc/pandoc-capitalize-headers" | ||||||
|         "-o" out |         "-o" out | ||||||
| 
 | 
 | ||||||
|     phony "webmanpages" $ need manpageMdsForHakyll |     phony "webmanpages" $ need webManpageMds | ||||||
| 
 | 
 | ||||||
|     manpageMdsForHakyll |%> \out -> do |     webManpageMds |%> \out -> do | ||||||
|       let |       let | ||||||
|         p = dropExtension $ takeFileName out |         p = dropExtension $ takeFileName out | ||||||
|         md = manpageDir p </> p <.> "md" |         md = manpageDir p </> p <.> "md" | ||||||
| @ -136,8 +136,8 @@ main = do | |||||||
| 
 | 
 | ||||||
|     phony "clean" $ do |     phony "clean" $ do | ||||||
|       putNormal "Cleaning generated files" |       putNormal "Cleaning generated files" | ||||||
|       removeFilesAfter "" manpageNroffsForMan |       removeFilesAfter "" manpageNroffs | ||||||
|       removeFilesAfter "" manpageMdsForHakyll |       removeFilesAfter "" webManpageMds | ||||||
|       putNormal "Cleaning object files" |       putNormal "Cleaning object files" | ||||||
|       removeFilesAfter "tools" ["*.o","*.p_o","*.hi"] |       removeFilesAfter "tools" ["*.o","*.p_o","*.hi"] | ||||||
|       putNormal "Cleaning shake build files" |       putNormal "Cleaning shake build files" | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user