Bonjour,
je suis sur un projet d'informatique pour mon master et nous avons voulu faire un makefile pour bien synthétiser la compilation de notre code. Mais lorsque nous compilons depuis peu nous obtenons ceci durant notre compilation :
Nous ne savons pas trop d'où vient notre erreur mais voici notre makefile :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 ************ Génération de TableDesIdentificateurs.o dans temp ************ g++ -Wall -g -O2 -I. -c -o temp/TableDesIdentificateurs.o src/TableDesIdentificateurs.cpp src/TableDesIdentificateurs.h ************ Génération de TableDesSymboles.o dans temp ************ g++ -Wall -g -O2 -I. -c -o temp/TableDesSymboles.o src/TableDesSymboles.cpp src/TableDesSymboles.h ************ Génération de Type.o dans temp ************ g++ -Wall -g -O2 -I. -c -o temp/Type.o src/Type.cpp src/Type.h ************ Génération test1 dans bin ************ g++ -o bin/test1 temp/TableDesIdentificateurs.o temp/TableDesSymboles.o temp/Type.o -lfl /usr/bin/ld:temp/TableDesIdentificateurs.o: file format not recognized; treating as linker script /usr/bin/ld:temp/TableDesIdentificateurs.o:1: syntax error collect2: ld returned 1 exit status make: *** [bin/test1] Erreur 1
Voila et nous avons noté un petit truc c'est qu'on dirait que lors du make, notre compilation ne parcours pas les endroits ou on compile notre flex (.l) et notre bison (.y)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 CPP=g++ LD=g++ EX=flex BIS=bison WBIN=bin WSRC=src WOBJ=temp WLANG=lang BIN=$(WBIN)/test1 SRCS=$(wildcard $(WSRC)/*.cpp) OBJS=$(SRCS:.cpp=.o) OBJ1=$(notdir $(OBJS)) OBJS := $(addprefix $(WOBJ)/,$(OBJ1)) CPPFLAGS=-Wall -g -O2 -I. -c -o LDFLAGS=-lfl all:$(BIN) echo "************ Génération terminée ! ************" @echo $(OBJS) $(BIN):$(OBJS) @echo "************ Génération" $(notdir $@) "dans" $(WBIN) "************"; $(LD) -o $@ $(OBJS) $(LDFLAGS) @echo "\n" $(WOBJ)/%.o:$(WSRC)/%.cpp $(WSRC)/%.h @echo "************ Génération de" $(notdir $@) "dans" $(WOBJ) "************"; $(CPP) $(CPPFLAGS) $@ $^ @echo "\n" $(WSRC)/%.cpp:$(WLANG)/%.y @echo "************ Génération de" $(notdir $@) "avec" $(BIS) "dans" $(WSRC) "************"; $(BIS) -d -o $@ $< @echo "\n" $(WSRC)/%.cpp:$(WLANG)/%.l @echo "************ Génération de" $(notdir $@) "avec" $(EX) "dans" $(WSRC) "************"; $(EX) -o$@ $<; @echo "\n" .PHONY: clean distclean clean: @echo "************ Suppression de" $(notdir $(OBJS)) "présent dans" $(WOBJ) "************"; rm -rf $(OBJS) @echo "\n" distclean: @echo "************ Suppression de" $(notdir $(BIN)) "présent dans" $(WBIN) "************"; rm -rf $(BIN) @echo "\n"
Merci vraiment à ceux qui pourront m'aider là-dessus.
Partager