View previous topic :: View next topic |
Author |
Message |
hoschi Advocate
Joined: 19 Jul 2003 Posts: 2517 Location: Ulm, Germany, Europe
|
Posted: Wed Oct 15, 2003 9:57 pm Post subject: Aufbau einer Makefile |
|
|
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
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 _________________ Just you and me strogg! |
|
Back to top |
|
|
andreh Tux's lil' helper
Joined: 03 Feb 2003 Posts: 117 Location: Laboe, Germany
|
|
Back to top |
|
|
hoschi Advocate
Joined: 19 Jul 2003 Posts: 2517 Location: Ulm, Germany, Europe
|
Posted: Wed Oct 15, 2003 10:46 pm Post subject: |
|
|
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
zur bash: nett gemeint von dir, aber das wird nicht gehen _________________ 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 |
|
|
andreh Tux's lil' helper
Joined: 03 Feb 2003 Posts: 117 Location: Laboe, Germany
|
Posted: Wed Oct 15, 2003 10:52 pm Post subject: |
|
|
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 |
|
|
hoschi Advocate
Joined: 19 Jul 2003 Posts: 2517 Location: Ulm, Germany, Europe
|
Posted: Wed Oct 15, 2003 10:59 pm Post subject: |
|
|
gerne
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
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 |
|
|
hoschi Advocate
Joined: 19 Jul 2003 Posts: 2517 Location: Ulm, Germany, Europe
|
Posted: Wed Oct 15, 2003 11:15 pm Post subject: habs doch noch gefunden: |
|
|
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 |
|
|
favo n00b
Joined: 15 Oct 2003 Posts: 18
|
Posted: Thu Oct 16, 2003 1:33 am Post subject: Re: habs doch noch gefunden: |
|
|
hoschi wrote: | [..]
für was -o weiß ich aber nicht:/ |
o = outputfile .. so wie das fertige binaryfile heissen soll |
|
Back to top |
|
|
andreh Tux's lil' helper
Joined: 03 Feb 2003 Posts: 117 Location: Laboe, Germany
|
Posted: Thu Oct 16, 2003 5:34 pm Post subject: |
|
|
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 |
|
|
hoschi Advocate
Joined: 19 Jul 2003 Posts: 2517 Location: Ulm, Germany, Europe
|
Posted: Thu Oct 16, 2003 7:10 pm Post subject: |
|
|
danke, das bash probleme gibt es ja schon nicht mehr>>>siehe oben:) _________________ Just you and me strogg! |
|
Back to top |
|
|
|