Hi,
 
I miss the function 'uniq' without sorting.
 
The function is useful to reduce include path list in huge and automatically generated Makefile projects. An example is AutoSar.
Benefits are:
- acceleration
- commandline limitations of some cross compiler
- easyer to read commandline.
 
Currently I use:
 
----------------  snip ----------------
 
################################################################################
#
#  function uniq(list)
#
#  do uniq without sort.
#
#  Makfile has uniq only in sort which is not possible for include path order.
#
#  tr " " "\n" : fields -> lines
#  cat -n      : add lines numbers
#  sort -uk2   : sort uniq with field 2
#  sort -nk1   : sort in previous order
#  cut -f2-    : remove line numbers
#  tr "\n" " " : lines -> fields
#
uniq=$(shell echo $(1) | tr " " "\n" | cat -n | sort -uk2 | sort -nk1| cut -f2- | tr "\n" " ")
 
----------------  snip ----------------
 
 
I would like to contribute the C-function to make.
 
Is this the right place to ask ?
 
Kind Regards,
Clemens
 
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to