]> wirehaze git hosting - ppos.git/blob - queue/makefile

wirehaze git hosting

add ppos/
[ppos.git] / queue / makefile
1 # TAD filas genéricas
2 # Prof. Carlos A. Maziero, DINF UFPR
3 # Versão 1.0 - 09/2025
4
5 # ATENÇÃO: ESTE ARQUIVO NÃO DEVE SER ALTERADO;
6 # ALTERAÇÕES SERÃO DESCARTADAS NA CORREÇÃO.
7
8 # flags de compilação e ligação
9 CC = gcc
10 CFLAGS = -std=c99 -Wall -Wextra -O0 -g -Wno-unused-function -Wno-unused-parameter
11 LDFLAGS = -z noexecstack
12 BIN = testa-fila
13 OUT = saida.txt
14
15 # estes alvos não são arquivos
16 .PHONY: test clean purge
17
18 # compila e liga o projeto
19 testa-fila: testa-fila.o queue.o
20 queue.o: queue.c queue.h
21 testa-fila.o: testa-fila.c queue.h
22
23 # teste: compara saída gerada com saída esperada
24 test: $(BIN)
25 @echo "Gerando saída em $(OUT)"
26 ./$(BIN) > $(OUT)
27 @echo "Comparando saídas esperada e gerada (formato diff)"
28 @if diff testa-fila.txt $(OUT) ; then \
29 echo "CORRETO: saidas identicas" ; \
30 else \
31 echo "ERRADO: saidas diferentes" ; \
32 fi
33
34 # limpa arquivos temporários
35 clean:
36 -rm -f *.o *~ $(OUT)
37
38 # limpa tudo, deixa só o o código-fonte
39 purge: clean
40 -rm -f $(BIN)