Note that there are some explanatory texts on larger screens.

plurals
  1. POinvoking make from a script
    primarykey
    data
    text
    <p>I have a situation where I have to compile a .cc file after changing variables frequently. My script changes the variables in the .cc file</p> <p>Then i try to compile it first changing into the directory in the shell script by saying cd </p> <p>and then followed by make. All my shell instructions are saved in a .sh file.</p> <p>however when i run this i get the error</p> <pre><code>make: *** No targets specified and no makefile found. Stop. </code></pre> <p>but when i manually go to the directory and type make it works.</p> <p>Why can't the shell script get the make to work?</p> <p>EDIT I added the script</p> <pre><code>#! /bin/sh # simDir=/home/amm/ns-projects/EURANE/Release simtime=21 high_users=5 low_users=3 rm user_throughput.txt qos_throughput.txt echo "Iteration,Users, Low, High,Low average,High average, Average cell througput" &gt;&gt; qos_throughput.txt for(( husers = 1; husers &lt;= $high_users; husers++ )) ### Outer for loop ### do for(( lusers = 1 ; lusers &lt;= $low_users; lusers++ )) ### Inner for loop ### do total_users=0 let total_users=$husers+$lusers echo "$total_users $husers $lusers" #Configure the sh file num_users=0 cd /home/chanditha/EURANE_multi_cells_itpp/simulation_scripts printf -v num_users "NUM_USERS=\"%d\"" $total_users rm hsdpa_ftp_4cells.sh perl -pe "s/.*/$num_users/ if $. == 5" hsdpa_ftp_4cells_old.sh &gt; hsdpa_ftp_4cells.sh chmod u+x hsdpa_ftp_4cells.sh #Configure the awk file cd /home/chanditha/EURANE_multi_cells_itpp/simulation_scripts/scripts awkline=0 printf -v awkline "class_cuttoff=max_flow-%d;" $husers rm tcp_performance_4cells.awk perl -pe "s/.*/$awkline/ if $. == 137" tcp_performance_4cells_old.awk &gt; tcp_performance_4cells.awk #Change the directory and go to the .cc file cd /home/chanditha/ns-allinone-2.30/ns-2.30/umts printf -v cut_off "int cut_off = flow_max_-%d;" $husers; rm hsdpalink.cc perl -pe "s/.*/$cut_off/ if $. == 2109" hsdpalink_old.cc &gt; hsdpalink.cc #Make it make clean &amp;&amp; make done cd /home/chanditha/EURANE_multi_cells_itpp/simulation_scripts ./hsdpa_ftp_4cells_run_all.sh done </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload