Makefile

Post Reply
Message
Author
BlackPanther
Posts: 44
Joined: 29. May 2001 21:16
Location: Bern/Schweiz

Makefile

#1 Post by BlackPanther »

Hallo,

Kann mir jemand sagen, wie ich das Makefile machen muss, damit die Sourcen in einem Verzeichnis "../proj_xy/src"", die Objektfiles in einem Verzeichnis "../proj_xy/obj"" und die Executeables und das Makefile im Stammverzeichnis "../proj_xy/" sind?

Mein Makfile sieht etwa so aus:

# Makfile
all: main.o difftime.o output.o biorhyt.o zwischenjahre.o wochentag.o tiff.o
$(CC) -o biorhythmus.exe main.o difftime.o output.o biorhyt.o zwischenjahre.o wochentag.o tiff.o

main.o: main.c difftime.c output.c zwischenjahre.c
$(CC) -c main.c

difftime.o: difftime.c zwischenjahre.c
$(CC) -c difftime.c
.
.
.

# End of Makefile

Bei den Sourcen kann ich einfach "src/" vor die *.c anfügen, oder?

Besten Dank für eure Hilfe,

mfg
Mike

Boron

Re: Makefile

#2 Post by Boron »

Wie du schon selber vermutest. Bei den quellen das "src/" davor machen, und für Objektdateien ein "obj/" davor schreiben.

Das Verzeichnis obj sollte dann natürlich schon existieren. Das kannst du ja automatisch im Makefile erstellen lassen, zuerst prüfen ob es existiert, wenn nicht "mkdir obj".

Gruss Boron

BlackPanther
Posts: 44
Joined: 29. May 2001 21:16
Location: Bern/Schweiz

Re: Makefile

#3 Post by BlackPanther »

Danke Boron,

Nun hat es geklappt <img src="http://www.pl-forum.de/UltraBoard/Images/Wilk.gif" border="0" align="middle">

BlackPanther
Posts: 44
Joined: 29. May 2001 21:16
Location: Bern/Schweiz

Re: Makefile

#4 Post by BlackPanther »

Danke Boron,

Nun hat es geklappt <img src="http://www.pl-forum.de/UltraBoard/Images/Wilk.gif" border="0" align="middle">

Post Reply