bug-make
[Top][All Lists]
Advanced

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

function uniq in make


From: clemens1509
Subject: function uniq in make
Date: Mon, 6 Aug 2018 10:19:08 +0200

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
 

reply via email to

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