remake icon indicating copy to clipboard operation
remake copied to clipboard

Add this_file, this_counter, GNUremake

Open rocky opened this issue 5 years ago • 3 comments

@bstarynk this addresses the build failure and has a test for GNUremakefile

However I don't see that the this_ functions work.

For example for this Makefile

B = c d $(this_file) $(this_line) $(this_counter)

x:
	@echo $(B)

I get:

$ ../make -x -f this.Makefile
Reading makefiles...
Updating makefiles...
Updating goal targets...
 File 'x' does not exist.
Must remake target 'x'.
this.Makefile:5: target 'x' does not exist
##>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
echo c d   
##<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
c d
Successfully remade target file 'x'.

If the this functions work for you, maybe you can give an example simiilar to the above?

rocky avatar Jan 09 '21 16:01 rocky

Hey, long time not chat :)

~I had a first look at it and the func-call-with-no-argument handling in function.c seems to need work. In the Makefile using something like C = c d $(this_file fluffy) works but C = c d $(this_file) doesn't.~

In the function table a function with a max of 0 args can't be specified since max=0 means no maximum. A workaround could be change the syntax, like $(this file). That would allow for a shorter form if file, line and counter is needed, e.g. $(this file counter) but does make argument checking necessary.

Without any args expand_builtin_function seems not to be called at all in the above case.

In the next few days I'll have a closer look.

/Thomas

Edit: Remove "there's no check for max # of arguments", the first paragraph was after I did some changing, not true for the unmodfied commit

boretom avatar Jan 11 '21 22:01 boretom

@boretom Many thanks for investigating what's up, finding and fixing (at least some of) the problems and the review.

Also, all the best for 2021!

rocky avatar Jan 12 '21 12:01 rocky

After the dust settles, we should look into adding a few more tests. It shouldn't be that onerous. (In fact, this is something I think even I could do.) Thanks again.

rocky avatar Jan 12 '21 12:01 rocky