1
I need my Makefile to run on the terminal so that it is not necessary to insert on the terminal $ time make run
, and yes only make run
, and let it show execution time in the same way. Can someone please help me?
Code of the Make:
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)
How long do you want to register? From build or just run?
– Jefferson Quesado
Taking advantage, it is better if you post the Makefile code, it is better to copy and paste in the reply
– Jefferson Quesado
I want to record the entire time of the process. And thanks for the tip on make, the next times I will do it this way.
– Vinícius França
Unfortunately, the directive
time
records the time of a past command. If you want all themake
, it is correct to do just that. It is even possible to make a recursive call tomake
and by thetime
there, but this is apparently gambitic– Jefferson Quesado
It is always a good directive to put the doubt code here in the SO-en
– Jefferson Quesado
Thanks, you’ve helped enough.
– Vinícius França