Ajout de tests pour vérifier le comportement des variables sur plusieurs lignes avec Bake et Make

This commit is contained in:
Moncef STITI 2025-02-12 20:42:04 +01:00
parent be8664958b
commit a228509e8f
9 changed files with 121 additions and 0 deletions

@ -0,0 +1,5 @@
test avec des variables sur plusieurs lignes
au lieu de : -ansi -pedantic
on a : -ansi \
-pendantic

@ -0,0 +1,40 @@
# Ce makefile viens de : https://iut-fbleau.fr/sitebp/doc_make/makefile/
### VARIABLES ###
CC = gcc
CFLAGS = -Wall \
-ansi \
-pedantic
LIBS = -lm
EXE = exemple
OFILES = extension.o \
main.o
### BUT PAR DEFAUT ###
but : ${EXE}
### REGLES ESSENTIELLES ###
extension.o : extension.h
main.o : extension.h
${EXE} : ${OFILES}
$(CC) $(CFLAGS) -o ${EXE} ${OFILES} ${LIBS}
### REGLES OPTIONNELLES ###
run : but
./${EXE}
clean :
-rm -f ${OFILES} ${EXE}
mrproper : clean but
### BUTS FACTICES ###
.PHONY : but clean mrproper
### FIN ###

@ -0,0 +1,6 @@
#include <stdio.h>
#include "extension.h"
void afficher_message(void) {
printf("Hello, world! Ceci est un message depuis extension.c\n");
}

@ -0,0 +1,6 @@
#ifndef EXTENSION_H
#define EXTENSION_H
void afficher_message(void);
#endif /* EXTENSION_H */

@ -0,0 +1,6 @@
#include "extension.h"
int main(void) {
afficher_message();
return 0;
}

@ -0,0 +1,40 @@
# Ce makefile viens de : https://iut-fbleau.fr/sitebp/doc_make/makefile/
### VARIABLES ###
CC = gcc
CFLAGS = -Wall \
-ansi \
-pedantic
LIBS = -lm
EXE = exemple
OFILES = extension.o \
main.o
### BUT PAR DEFAUT ###
but : ${EXE}
### REGLES ESSENTIELLES ###
extension.o : extension.h
main.o : extension.h
${EXE} : ${OFILES}
$(CC) $(CFLAGS) -o ${EXE} ${OFILES} ${LIBS}
### REGLES OPTIONNELLES ###
run : but
./${EXE}
clean :
-rm -f ${OFILES} ${EXE}
mrproper : clean but
### BUTS FACTICES ###
.PHONY : but clean mrproper
### FIN ###

@ -0,0 +1,6 @@
#include <stdio.h>
#include "extension.h"
void afficher_message(void) {
printf("Hello, world! Ceci est un message depuis extension.c\n");
}

@ -0,0 +1,6 @@
#ifndef EXTENSION_H
#define EXTENSION_H
void afficher_message(void);
#endif /* EXTENSION_H */

@ -0,0 +1,6 @@
#include "extension.h"
int main(void) {
afficher_message();
return 0;
}