Sample Header Ad - 728x90

How to write a function that returns parent path in makefile

0 votes
2 answers
276 views
I am creating a new makefile and I would like to create a set of utility functions which may be repetitively called. One of the functions is about how to return the parent path from any given path, e.g., return /some_folder from /some_folder/somefile. I can use subst and last word to extract the last word from the path. But I don't have a clue on how to exclude the last word. I would also like to find the common ancestor of two paths. Is there a general solution to such problems in makefile?
Asked by Ziqi Fan (247 rep)
Nov 11, 2024, 04:43 PM
Last activity: Nov 13, 2024, 04:22 AM