bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: function uniq in make


From: Tim Murphy
Subject: Re: function uniq in make
Date: Mon, 6 Aug 2018 07:02:04 -0700

You could try to write a new function and get it accepted but don't forget that there is a mechanism for loadable modules that allows you to make functions which can be dynamically loaded into an existing version of gnu make.

Regards, 

Tim 

On Mon, 6 Aug 2018, 05:32 , <address@hidden> wrote:
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
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-make

reply via email to

[Prev in Thread] Current Thread [Next in Thread]