Article 4Y1VE Executing shell cmd inside makefile

Executing shell cmd inside makefile

by
barunparichha
from LinuxQuestions.org on (#4Y1VE)
I am building start.c and test.c inside Makefile.

Requirment:
Building of test.c should start, if executable(start) returns 1.
But I am not getting string "Start", from executable start.
So probably Makefile is not executing start.

Makefile:
Code:CC = gcc
CFLAGS = -g
RM = rm -f

TRG=test
ST=start

all: $(TRG) $(ST)
echo "hello"

$(TARGET): $(TRG) $(ST)

$(ST):
$(CC) $(CFLAGS) -o $(ST) $(ST).c
sh `$(./$(ST))`

$(TRG):
$(CC) $(CFLAGS) -o $(TRG) $(TRG).c

clean: $(TRG) $(ST)
$(RM) $(TRG) $(TRG).o
$(RM) $(ST) $(ST).ostart.c:
Code:#include<stdio.h>
int main()
{
printf("\nStart");
return 1;
}Output of make:
Code:gcc -g -o test test.c
gcc -g -o start start.c
sh ``latest?d=yIl2AUoC8zA latest?i=QoDK7iSPlIo:6AKpXRFys3Y:F7zBnMy latest?i=QoDK7iSPlIo:6AKpXRFys3Y:V_sGLiP latest?d=qj6IDK7rITs latest?i=QoDK7iSPlIo:6AKpXRFys3Y:gIN9vFwQoDK7iSPlIo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments