title: How to properly make my makefile to compile and run?
body: <p>The question is probably not the best one to describe my issue but I couldn't think of a better one. My makefile goes like this:</p>
  
  <pre><code>PROGRAM_NAME = prog
  
  OBJECT_FILES = $(PROGRAM_NAME).o
  CFLAGS = -O2 -Wall -g
  
  $(PROGRAM_NAME) : $(OBJECT_FILES)
      gcc $(CFLAGS) -o $@ $(OBJECT_FILES)
  
  $(PROGRAM_NAME).o : $(PROGRAM_NAME).c data.h
      gcc $(CFLAGS) -c $&lt;
  
  clean :
      $(RM) $(PROGRAM_NAME)
      $(RM) $(OBJECT_FILES)
      $(RM) *~ *.bak
  
  run :
      @$(MAKE) &amp;&amp; ./$(PROGRAM_NAME) $(ARGS)
  </code></pre>
  
  <p>When I want to compile and run I just do "make run". The issue with this is that my program handles the signal produced by Ctrl+Z and if I start my program with "make run", the signal will be sent to "make run" and not my program itself.</p>
  
  <p>Basically, calling "make run" is not the same thing as calling directly "make &amp;&amp; ./prog" because in the first case, "make run" will not terminate unless "prog" terminates first.</p>
  
  <p>Is there a way around this?</p>