C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Utilisation de make et g++

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French)
View previous topic :: View next topic  
Author Message
Salut
Guest





PostPosted: Mon May 24, 2004 12:58 pm    Post subject: Utilisation de make et g++ Reply with quote



Bonjour,

J'essaye de faire un fichier makefile pour cpp.
le fichier marche correctement pour c mais pas pour cpp

fichier makefile :
CC = g++

CFLAGS = -g3 -O3 -L/usr/X11R6/lib -lX11 -Wno-deprecated
OBJ1 = essai.o
#OBJECTS = $(OBJ1)

ESSAI: $(OBJ1)
$(CC) $(OBJ1) -o ESSAI $(CFLAGS)

#dependance
essai.o : conf.h

#fin de fichier

le problème est que pour la compilation make lance :
g++ -c -o essai.o essai.cpp
et ne rajoute pas les flags !!
Ces flags ne sont rajouter que pour le link


si j'ai un fichier essai.c ca marche correctement :
g++ -g3 -O3 -L/usr/X11R6/lib -lX11 -Wno-deprecated -c -o essai.c essai.c




Back to top
Matthieu Moy
Guest





PostPosted: Mon May 24, 2004 1:21 pm    Post subject: Re: Utilisation de make et g++ Reply with quote



"Salut" <Salut (AT) hotmail (DOT) com> writes:

Quote:
#dependance
essai.o : conf.h

Si tu ne donnes pas de règle pour essai.o, make va utiliser une règle
implicite (qui n'utilise pas CFLAGS, mais quelque chose comme
CPPFLAGS). Tu devrais rajouter quelque chose comme

%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@

Quelque part dans ton Makefile.

[ Par ailleurs, ta question est hors sujet ici ]

--
Matthieu

Back to top
Salut
Guest





PostPosted: Mon May 24, 2004 3:01 pm    Post subject: Re: Utilisation de make et g++ Reply with quote



OK merci,
je me suis rabattu sur fr.comp.lang.c++ parce que je ne savais pas ou me
renseigner exactement !


"Matthieu Moy" <MatthieuNOSPAM.Moy (AT) imag (DOT) fr.invalid> a écrit dans le message
de news: [email]vpqhdu6ota9.fsf (AT) ecrins (DOT) imag.fr[/email]...
Quote:
"Salut" <Salut (AT) hotmail (DOT) com> writes:

#dependance
essai.o : conf.h

Si tu ne donnes pas de règle pour essai.o, make va utiliser une règle
implicite (qui n'utilise pas CFLAGS, mais quelque chose comme
CPPFLAGS). Tu devrais rajouter quelque chose comme

%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@

Quelque part dans ton Makefile.

[ Par ailleurs, ta question est hors sujet ici ]

--
Matthieu



Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.