Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Aufbau einer Makefile
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
hoschi
Advocate
Advocate


Joined: 19 Jul 2003
Posts: 2517
Location: Ulm, Germany, Europe

PostPosted: Wed Oct 15, 2003 9:57 pm    Post subject: Aufbau einer Makefile Reply with quote

hallo,

ich habe es schon mal gewusst, aber leider vergessen:(
wie muss ich meine makefile aufbauen c-flags und c++-flags usw.


nur kurze erkärung einfach wie ich die zu kompilierenede datei angeben und wie die flags angegeben werden müssen
:D


und vielleicht noch ein beispiel wie man der per kommandozeile auch "schnell" mal eingeben kann um mal "zwischendrin" was zu kompilieren?



vielen dank im voraus
dussel der sich nichts aufgeschrieben hat und wieder vergessen hat :roll:
_________________
Just you and me strogg!
Back to top
View user's profile Send private message
andreh
Tux's lil' helper
Tux's lil' helper


Joined: 03 Feb 2003
Posts: 117
Location: Laboe, Germany

PostPosted: Wed Oct 15, 2003 10:30 pm    Post subject: Reply with quote

GNU Autoconf, Automake, and Libtool und Using History Interactively aus dem Bash Reference Manual.
Back to top
View user's profile Send private message
hoschi
Advocate
Advocate


Joined: 19 Jul 2003
Posts: 2517
Location: Ulm, Germany, Europe

PostPosted: Wed Oct 15, 2003 10:46 pm    Post subject: Reply with quote

danke, aber das war nicht ganz was ich mir vorgestellt habe(finde da leider auch nicht was ich suche)...mir reichen eigentlich ein oder zwei beispiele...ganz winzig :D

zur bash: nett gemeint von dir, aber das wird nicht gehen :roll:
_________________
Just you and me strogg!


Last edited by hoschi on Wed Oct 15, 2003 10:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
andreh
Tux's lil' helper
Tux's lil' helper


Joined: 03 Feb 2003
Posts: 117
Location: Laboe, Germany

PostPosted: Wed Oct 15, 2003 10:52 pm    Post subject: Reply with quote

Das es nicht das war, was du dir vorgestellt hattest, war mir klar.
Formuliere deine Frage bezüglich der Bash bzw. einer anderen Shell bitte etwas genauer, dann kannst du auch mit einer korrekten Antwort rechnen.
Back to top
View user's profile Send private message
hoschi
Advocate
Advocate


Joined: 19 Jul 2003
Posts: 2517
Location: Ulm, Germany, Europe

PostPosted: Wed Oct 15, 2003 10:59 pm    Post subject: Reply with quote

gerne :D

also:
ich habe lediglich eine kleine c oder c++ source-datei und möchte sie kompilieren, wenn ich das jetzt per makefile machen will...wie muss die makefile aussehen?

mal ein beispiel zenario:
die source datei heisst "foo.cc"
und kompiliert wird mit "-march athlon-xp -03 fomit-frame-pointer usw."

wie muss meine makefile aussehen(sind ja nicht mehr als zwei zeilen)?



und zur bash:
ich weiß dass man zum kompilieren nicht zwingend eine makefile braucht, man kann die zu kompilierende datei und die flags auch mit einem einzigen bash-kommando angeben und den kompilier-vorgang durchführen...sozusagen das ganze einfach ohne makefile für skiller :D


ich hoffe du verstehst was ich meine, das bash-kommando für "skiller" ist mir aber nicht so wichtig das erstellen einer makefile schon!
_________________
Just you and me strogg!
Back to top
View user's profile Send private message
hoschi
Advocate
Advocate


Joined: 19 Jul 2003
Posts: 2517
Location: Ulm, Germany, Europe

PostPosted: Wed Oct 15, 2003 11:15 pm    Post subject: habs doch noch gefunden: Reply with quote

source-code datei lautet: lotto.cpp

inhalt der makefile:
CXXFLAGS=-march=pentium3 -O3 -funroll-all-loops
lotto: lotto.cpp


oder für faule per bash direkt:
g++ -O3 -march=pentium3 -o lotto lotto.cpp


für was -o weiß ich aber nicht:/
_________________
Just you and me strogg!
Back to top
View user's profile Send private message
favo
n00b
n00b


Joined: 15 Oct 2003
Posts: 18

PostPosted: Thu Oct 16, 2003 1:33 am    Post subject: Re: habs doch noch gefunden: Reply with quote

hoschi wrote:
[..]
für was -o weiß ich aber nicht:/


o = outputfile .. so wie das fertige binaryfile heissen soll :)
Back to top
View user's profile Send private message
andreh
Tux's lil' helper
Tux's lil' helper


Joined: 03 Feb 2003
Posts: 117
Location: Laboe, Germany

PostPosted: Thu Oct 16, 2003 5:34 pm    Post subject: Reply with quote

hoschi wrote:
wie muss meine makefile aussehen(sind ja nicht mehr als zwei zeilen)?


Sie könnte z.B. so aussehen:

Code:
CC = gcc
CFLAGS = -march=athlon-xp -O3 -fomit-frame-pointer
CXXFLAGS = $(CFLAGS)

foo: foo.o
        $(CC) $(CFLAGS) -o $@ $<

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

clean:
        rm -f foo
        rm -f foo.o


Dein Bash-Problem verstehe ich allerdings immer noch nicht.
Back to top
View user's profile Send private message
hoschi
Advocate
Advocate


Joined: 19 Jul 2003
Posts: 2517
Location: Ulm, Germany, Europe

PostPosted: Thu Oct 16, 2003 7:10 pm    Post subject: Reply with quote

danke, das bash probleme gibt es ja schon nicht mehr>>>siehe oben:)
_________________
Just you and me strogg!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) 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