Génération automatique dépendances Makefile
Il n'est maintenant plus nécessaire de mettre à jour les dépendances dans les Makefile : les dépendances sont générés automatiquement par l'option -MMD de gcc
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
CC=gcc
|
||||
CFLAGS=-std=c99 -Werror -Wall -Wextra -Wpedantic -Wshadow -Wno-missing-field-initializers -Wstrict-overflow -lm -lcurl
|
||||
DEPFLAGS=-MMD -MF
|
||||
OUTPUT=../bin/Release/GINPA
|
||||
OBJ=../obj/Release
|
||||
DEP=Dep
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS+=-g
|
||||
@ -14,13 +16,10 @@ endif
|
||||
|
||||
all: $(OBJ)/controleur.o $(OBJ)/conversion.o $(OBJ)/destruction.o $(OBJ)/miscellaneous.o $(OBJ)/controleAffichage.o $(OBJ)/waiting.o
|
||||
|
||||
$(OBJ)/%.o: %.c %.h
|
||||
$(CC) -c -o $@ $< $(CFLAGS) $(GFLAGS)
|
||||
$(OBJ)/%.o: %.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) $(GFLAGS) $(DEPFLAGS) $(DEP)/$(basename $<).d
|
||||
|
||||
$(OBJ)/controleur.h: ../Modele/load.h ../Modele/calcul.h ../Vue/vue.h conversion.h destruction.h miscellaneous.h
|
||||
$(OBJ)/conversion.h: controleur.h
|
||||
$(OBJ)/destruction.h: controleur.h
|
||||
$(OBJ)/miscellaneous.h: controleur.h
|
||||
-include $(DEP)/*.d
|
||||
|
||||
debug:
|
||||
make DEBUG=1
|
||||
|
17
Makefile
17
Makefile
@ -2,9 +2,10 @@ CC=gcc
|
||||
CFLAGS=-std=c99 -Werror -Wall -Wextra -Wpedantic -Wshadow -Wno-missing-field-initializers -Wstrict-overflow
|
||||
LDFLAGS=-std=c99 -Werror -Wall -Wextra -Wpedantic -Wshadow -Wno-missing-field-initializers -Wstrict-overflow -lm -lcurl
|
||||
GFLAGS=-lcsfml-graphics -lcsfml-window -lcsfml-system
|
||||
DEPFLAGS=-MMD -MF
|
||||
OUTPUT=bin/Release/GINPA
|
||||
OBJ=obj/Release
|
||||
DEP=
|
||||
DEP=Dep
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS+=-g
|
||||
@ -26,19 +27,25 @@ recursive:
|
||||
make $(ARG) -C Controleur
|
||||
make $(ARG) -C Modele
|
||||
|
||||
$(OBJ)/main.o: main.c Vue/vue.h
|
||||
$(CC) -c -o $@ $< $(CFLAGS) $(GFLAGS)
|
||||
$(OBJ)/main.o: main.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) $(GFLAGS) $(DEPFLAGS) $(DEP)/$(basename $<).d
|
||||
|
||||
-include $(DEP)/*.d
|
||||
|
||||
debug:
|
||||
make DEBUG=1
|
||||
|
||||
.PHONY: clean mrproper
|
||||
|
||||
#Supprime tous les fichiers objets
|
||||
#Supprime tous les fichiers objets et fichiers dépendance
|
||||
clean:
|
||||
find obj -name '*.o' -delete
|
||||
rm -rf Dep/*.d
|
||||
rm -rf Modele/Dep/*.d
|
||||
rm -rf Controleur/Dep/*.d
|
||||
rm -rf Vue/Dep/*.d
|
||||
|
||||
#Supprime tous les fichiers binaires et objets
|
||||
#Supprime tous les fichiers binaires ,objets et dépendances
|
||||
mrproper: clean
|
||||
rm -rf bin/Debug/GINPA
|
||||
rm -rf bin/Release/GINPA
|
||||
|
@ -1,7 +1,9 @@
|
||||
CC=gcc
|
||||
CFLAGS=-std=c99 -Werror -Wall -Wextra -Wpedantic -Wshadow -Wno-missing-field-initializers -Wstrict-overflow
|
||||
DEPFLAGS=-MMD -MF
|
||||
OUTPUT=../bin/Release/GINPA
|
||||
OBJ=../obj/Release
|
||||
DEP=Dep
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS+=-g
|
||||
@ -14,10 +16,10 @@ endif
|
||||
|
||||
all: $(OBJ)/load.o $(OBJ)/agglo.o $(OBJ)/calcul.o $(OBJ)/others.o
|
||||
|
||||
$(OBJ)/%.o: %.c %.h ../Headers/structures.h
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
$(OBJ)/%.o: %.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) $(DEPFLAGS) $(DEP)/$(basename $<).d
|
||||
|
||||
$(OBJ)/agglo.h: calcul.h
|
||||
-include $(DEP)/*.d
|
||||
|
||||
debug:
|
||||
make DEBUG=1
|
||||
|
12
Vue/Makefile
12
Vue/Makefile
@ -1,8 +1,10 @@
|
||||
CC=gcc
|
||||
CFLAGS=-std=c99 -Werror -Wall -Wextra -Wpedantic -Wshadow -Wno-missing-field-initializers -Wstrict-overflow
|
||||
GFLAGS=-lcsfml-graphics -lcsfml-window -lcsfml-system -lm
|
||||
DEPFLAGS=-MMD -MF
|
||||
OUTPUT=../bin/Release/GINPA
|
||||
OBJ=../obj/Release
|
||||
DEP=Dep
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS+=-g
|
||||
@ -15,14 +17,10 @@ endif
|
||||
|
||||
all: $(OBJ)/vue.o $(OBJ)/creation.o $(OBJ)/chargement.o $(OBJ)/selection.o $(OBJ)/affichage.o $(OBJ)/deplacement.o
|
||||
|
||||
$(OBJ)/%.o: %.c %.h
|
||||
$(CC) -c -o $@ $< $(CFLAGS) $(GFLAGS)
|
||||
$(OBJ)/%.o: %.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS) $(GFLAGS) $(DEPFLAGS) $(DEP)/$(basename $<).d
|
||||
|
||||
$(OBJ)/vue.h: affichage.h chargement.h creation.h selection.h
|
||||
$(OBJ)/creation.h: vue.h
|
||||
$(OBJ)/chargement.h: vue.h
|
||||
$(OBJ)/selection.h: vue.h
|
||||
$(OBJ)/affichage.h: vue.h
|
||||
-include $(DEP)/*.d
|
||||
|
||||
debug:
|
||||
make DEBUG=1
|
||||
|
@ -1,5 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
|
Reference in New Issue
Block a user