F L writes: > Thank you very much Paul and Philip. I still need to read what you pointed > out. > > What I want is very straightforward. during make/build process, I > want to run a shell command to extract two numbers from two > different files. If they are same(or different), then I do > something. > > That is why my prototype uses echo to get the number? > > $(eval v1=$(shell sh -c "echo 1")) >
I think you could do what you want with standard utilities without resorting to $(shell). o Make recipe to extract number from first file. Write to intermediate file. o Make recipe to extract number from second file. Write to intermediate file. o Compare two files. For example, something like this: extract-1 extract-2: <command> >$@ comparison: extract-1 extract-2 if diff extract-1 extract-2 ; then echo "Files same"; else echo "Files differ"; fi _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make