help-make
[Top][All Lists]
Advanced

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

Re: ifeq problem?


From: thutt
Subject: Re: ifeq problem?
Date: Tue, 2 Oct 2018 08:41:36 -0700

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



reply via email to

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