Améliorations du parser et ajout de nouveaux fichiers de test pour vérifier le comportement des variables sur plusieurs lignes avec Bake et Make, et suppression des fichiers obsolètes.
This commit is contained in:
@@ -1,40 +1,21 @@
|
||||
# Ce makefile viens de : https://iut-fbleau.fr/sitebp/doc_make/makefile/
|
||||
### VARIABLES ###
|
||||
|
||||
CC = gcc
|
||||
COMPILER = 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 ###
|
||||
OUTPUT = program
|
||||
|
||||
OBJS = main.o module.o
|
||||
|
||||
# Règle principale
|
||||
$(OUTPUT): $(OBJS)
|
||||
$(COMPILER) $(CFLAGS) -o $(OUTPUT) $(OBJS)
|
||||
|
||||
main.o: main.c
|
||||
$(COMPILER) $(CFLAGS) -c main.c -o main.o
|
||||
|
||||
module.o: module.c
|
||||
$(COMPILER) $(CFLAGS) -c module.c -o module.o
|
||||
|
||||
clean:
|
||||
rm -f $(OUTPUT) $(OBJS)
|
||||
|
||||
|
@@ -1,6 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include "extension.h"
|
||||
|
||||
void afficher_message(void) {
|
||||
printf("Hello, world! Ceci est un message depuis extension.c\n");
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
#ifndef EXTENSION_H
|
||||
#define EXTENSION_H
|
||||
|
||||
void afficher_message(void);
|
||||
|
||||
#endif /* EXTENSION_H */
|
@@ -1,6 +1,8 @@
|
||||
#include "extension.h"
|
||||
#include <stdio.h>
|
||||
#include "module.h"
|
||||
|
||||
int main(void) {
|
||||
afficher_message();
|
||||
printf("Hello from main!\n");
|
||||
print_message();
|
||||
return 0;
|
||||
}
|
||||
|
6
tests/C/test-16-strange-variables/bake/module.c
Normal file
6
tests/C/test-16-strange-variables/bake/module.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include "module.h"
|
||||
|
||||
void print_message(void) {
|
||||
printf("Hello from module!\n");
|
||||
}
|
6
tests/C/test-16-strange-variables/bake/module.h
Normal file
6
tests/C/test-16-strange-variables/bake/module.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef MODULE_H
|
||||
#define MODULE_H
|
||||
|
||||
void print_message(void);
|
||||
|
||||
#endif
|
@@ -1,40 +1,21 @@
|
||||
# Ce makefile viens de : https://iut-fbleau.fr/sitebp/doc_make/makefile/
|
||||
### VARIABLES ###
|
||||
|
||||
CC = gcc
|
||||
COMPILER = 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 ###
|
||||
OUTPUT = program
|
||||
|
||||
OBJS = main.o module.o
|
||||
|
||||
# Règle principale
|
||||
$(OUTPUT): $(OBJS)
|
||||
$(COMPILER) $(CFLAGS) -o $(OUTPUT) $(OBJS)
|
||||
|
||||
main.o: main.c
|
||||
$(COMPILER) $(CFLAGS) -c main.c -o main.o
|
||||
|
||||
module.o: module.c
|
||||
$(COMPILER) $(CFLAGS) -c module.c -o module.o
|
||||
|
||||
clean:
|
||||
rm -f $(OUTPUT) $(OBJS)
|
||||
|
||||
|
@@ -1,6 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include "extension.h"
|
||||
|
||||
void afficher_message(void) {
|
||||
printf("Hello, world! Ceci est un message depuis extension.c\n");
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
#ifndef EXTENSION_H
|
||||
#define EXTENSION_H
|
||||
|
||||
void afficher_message(void);
|
||||
|
||||
#endif /* EXTENSION_H */
|
@@ -1,6 +1,8 @@
|
||||
#include "extension.h"
|
||||
#include <stdio.h>
|
||||
#include "module.h"
|
||||
|
||||
int main(void) {
|
||||
afficher_message();
|
||||
printf("Hello from main!\n");
|
||||
print_message();
|
||||
return 0;
|
||||
}
|
||||
|
6
tests/C/test-16-strange-variables/make/module.c
Normal file
6
tests/C/test-16-strange-variables/make/module.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include "module.h"
|
||||
|
||||
void print_message(void) {
|
||||
printf("Hello from module!\n");
|
||||
}
|
6
tests/C/test-16-strange-variables/make/module.h
Normal file
6
tests/C/test-16-strange-variables/make/module.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef MODULE_H
|
||||
#define MODULE_H
|
||||
|
||||
void print_message(void);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user