Scout-sama
Grünschnabel
Hallo,
ich habe ein kleines Problem. Ich schreibe an einem C Programm, welches aus zwei ausführbaren Dateien bestehen soll (teil1.exe und teil2.exe), die sich Funktionen aus einer seperaten Datei (tools.c) teilen.
Die Makefile für beide Ausführbaren dateien sieht jeweils so aus:
*****
teil2.exe: teil2.o tools.o
gcc -o teil2 teil2.o tools.o
teil2.o: teil2.c tools.h
gcc -c -Wall teil2.c
tools.o: tools.c tools.h
gcc -c -Wall tools.c
clean:
-rm -f *.o teil1
*****
(Für Teil1 das selbe)
Jetzt möchte ich allerdings eine einziege makefile haben, die bei der Ausführung Teil1.exe UND Teil2.exe compiliert.
Allerdings funktioniert es nicht, wenn ich beide Texte der makefiles zu einer kombiniere (es wird dann nur der erste Teil compiliert).
Hat jemand ein Tipp, oder ist es makefilebedingt erst gar nicht möglich.
ich habe ein kleines Problem. Ich schreibe an einem C Programm, welches aus zwei ausführbaren Dateien bestehen soll (teil1.exe und teil2.exe), die sich Funktionen aus einer seperaten Datei (tools.c) teilen.
Die Makefile für beide Ausführbaren dateien sieht jeweils so aus:
*****
teil2.exe: teil2.o tools.o
gcc -o teil2 teil2.o tools.o
teil2.o: teil2.c tools.h
gcc -c -Wall teil2.c
tools.o: tools.c tools.h
gcc -c -Wall tools.c
clean:
-rm -f *.o teil1
*****
(Für Teil1 das selbe)
Jetzt möchte ich allerdings eine einziege makefile haben, die bei der Ausführung Teil1.exe UND Teil2.exe compiliert.
Allerdings funktioniert es nicht, wenn ich beide Texte der makefiles zu einer kombiniere (es wird dann nur der erste Teil compiliert).
Hat jemand ein Tipp, oder ist es makefilebedingt erst gar nicht möglich.