merging schedule
[henge/webcc.git] / make / lib / awk.mk
1 ################################################################################
2 # Desc: Named functions for awk
3 # Author: Ken Grimes
4 # Date: 2016
5 ################################################################################
6 # This makefile consists of awk programs that may come in handy as an extension
7 # to the basic lisp make capabilities without having to invoke guile
8 ################################################################################
9
10 # AWK_REVERSE_SQUASH############################################################
11 # The following awk program reverses the order of a list while also removing
12 # duplicate entries. The effect of this when run on the dependency tree is that
13 # it will remove duplicates occurring in reverse order, allowing the most deeply
14 # nested libraries to be built, and linked, first. #############################
15 define AWK_REVERSE_SQUASH =
16 awk \
17 '
18 { for(i=NF;i>0;i--)
19 if (!a[$$i]++)
20 print $$i
21 }
22 '
23 #/AWK_REVERSE_SQUASH############################################################
24 endef