-
Makefile
Dear experts,
i have written a make file for windows which is working quite well,
but i want to get the count of number of files which i am not getting can anyone please help me my makefile is as follows,
Code:
main :
for /r ${CWD} %%X in (*.txt) do (echo %%X)
all : main
echo "Hello "
echo ${make}
C:\MinGW\bin\make main
this is showing all the files in that directory with extension .txt , can any body help me how to get its count means number of files. what ever i am modifying it is giving me error i am trying this with eclipse with minGW installed. i tried like:
Code:
main:
set /A Count =0
for /r ${CWD} %%X in (*.txt) do ( set /A Count+=1)
echo %Count%
but this is not working .
please help me.
-
You can't use make to loop based on a changing state. You need to use something else.
-
Thanks for the reply,
but this is working know,
like
Code:
main :
for /r ${CWD} %%X in (*.txt) do (echo %%X)
all : main
echo "Hello "
echo ${make}
C:\MinGW\bin\make main
which is listing all the txt files from the current directory then why it cannot take out the count,
please help me if any alternate please inform me.