forked from menault/2026_TD1_DEV51_Qualite_Algo
Organise le dépôt et numérote les profils par étape
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
CC = gcc
|
||||
CFLAGS ?= -std=c11 -Wall -Wextra -Wpedantic -O0
|
||||
|
||||
SOURCE = src/analyseur.c
|
||||
PROGRAMME = build/analyseur
|
||||
PROGRAMME_PROFIL = build/profil/analyseur
|
||||
|
||||
.PHONY: all run check profile clean
|
||||
|
||||
all: $(PROGRAMME)
|
||||
|
||||
$(PROGRAMME): $(SOURCE) Makefile
|
||||
mkdir -p $(@D)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
run: $(PROGRAMME)
|
||||
cd build && ./analyseur
|
||||
|
||||
check: run
|
||||
cmp resultats/rapport_reference.txt build/rapport.txt
|
||||
|
||||
$(PROGRAMME_PROFIL): $(SOURCE) Makefile
|
||||
mkdir -p $(@D)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -pg $< -o $@ $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
profile: $(PROGRAMME_PROFIL)
|
||||
cd build/profil && ./analyseur
|
||||
cd build/profil && gprof -b ./analyseur gmon.out > profil.txt
|
||||
@printf 'Profil disponible dans build/profil/profil.txt\n'
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
Reference in New Issue
Block a user