Make file and compile in terminal

1

I need my makefile to run on the terminal so that it is not necessary to insert $ time make run , but only make run , and that it shows the execution time in the same way. Can anyone help me please?

Make code:

NAME=TP1_main2
CC=gcc
TODOS_ARQUIVOS_PONTOH = TP1_main2.c 
TODOS_ARQUIVOS_OBJ = $(NAME).o TP1_main2.o

%.o: %.c $(TODOS_ARQUIVOS_PONTOH)
    $(CC) -o $@ -c $< $(OPCOES_COMPILADOR)

all: $(TODOS_ARQUIVOS_OBJ)
    gcc -o $(NAME) $^ $(OPCOES_COMPILADOR)

run: all
    ./$(NAME)

clean:
    rm *.o $(NAME)
    
asked by anonymous 07.09.2017 / 21:50

0 answers