I tried to run an execuatble after refering to some link on SO Run Executable from makefile. Everything works fine only that I need to type "make run" to execute all commands. I want to know how can I run it without having to type run and simply make should run everything. As of now make command only executes the rule all and to run the other part I have to use make run. I am new to Make. Could you also help me refine the code a little. Any help is appreciated.
all: rdata.c
-sudo rm a.out
-gcc rdata.c -o a.out
exec: run
run: all
-sudo ./a.out
sudo javac -classpath /home/hduser/12115_Select_Query/hadoop-core-1.1.2.jar -d mysort MySort.java
sudo jar -cvf mysort.jar -C mysort/ .
-hadoop fs -rmr MySort/output
-hadoop fs -rmr MySort/input
hadoop fs -mkdir MySort/input
hadoop fs -put Data/data.txt MySort/input
hadoop jar mysort.jar org.myorg.MySort MySort/input MySort/output
-sudo rm /home/hduser/Out/sort.txt
hadoop fs -copyToLocal MySort/output/part-r-00000 /home/hduser/Out/sort.txt
sudo gedit /home/hduser/Out/sort.txt
.PHONY: exec run