<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Makefilefrage: Wie kann jede Quelldatei von Änderungen ihrer header abhängen?]]></title><description><![CDATA[<p>Hallo, wie im titel schon gesagt, möchte ich das bei der benutzung meines makesfiles jede quelldatei auch dann neu kompiliert wird, wenn sich einer ihrer #includes ändert.</p>
<p>also z.B.: main.cpp inkludiert header.h . header.h ändert sich ==&gt; main.cpp wird beim nächsten make neukompiliert</p>
<p>Ich hoffe auf eure Hilfe<br />
Gruß Fencer</p>
<pre><code>SRCDIR := ../src
INCDIR := -I$(SRCDIR)/include -I/usr/cross/include

BINDIR := /usr/cross/bin

CFLAGS := -Wall -Wextra $(INCDIR) -nostdlib -nostdinc -fno-builtin -fno-stack-protector 
csources :=$(shell find $(SRCDIR) -mindepth 1 -maxdepth 5 -name &quot;*.c&quot;)
asmsources :=$(shell find $(SRCDIR) -mindepth 1 -maxdepth 5 -name &quot;*.s&quot;)

cobjects := $(patsubst %.c,%.o,$(csources))
asmobjects:=$(patsubst %.s,%.o,$(asmsources))
depfiles:= $(patsubst %.c,%.d,$(csources))

all: kernel

kernel: $(cobjects) $(asmobjects)
	$(BINDIR)/i586-elf-ld -o kernel -Tlink.ld $(cobjects) $(asmobjects)
clean:
	rm $(cobjects) $(asmobjects)
	rm kernel

%.o: %.c
	$(BINDIR)/i586-elf-gcc -c $&lt; -o $@ $(CFLAGS)

%.o: %.s
	nasm -felf32 $&lt;
</code></pre>
<p>edit: wenn nötig bitte verschieben. tschuldigung für den fall.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/251808/makefilefrage-wie-kann-jede-quelldatei-von-änderungen-ihrer-header-abhängen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 06:10:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/251808.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Oct 2009 20:49:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Makefilefrage: Wie kann jede Quelldatei von Änderungen ihrer header abhängen? on Sat, 10 Oct 2009 20:52:32 GMT]]></title><description><![CDATA[<p>Hallo, wie im titel schon gesagt, möchte ich das bei der benutzung meines makesfiles jede quelldatei auch dann neu kompiliert wird, wenn sich einer ihrer #includes ändert.</p>
<p>also z.B.: main.cpp inkludiert header.h . header.h ändert sich ==&gt; main.cpp wird beim nächsten make neukompiliert</p>
<p>Ich hoffe auf eure Hilfe<br />
Gruß Fencer</p>
<pre><code>SRCDIR := ../src
INCDIR := -I$(SRCDIR)/include -I/usr/cross/include

BINDIR := /usr/cross/bin

CFLAGS := -Wall -Wextra $(INCDIR) -nostdlib -nostdinc -fno-builtin -fno-stack-protector 
csources :=$(shell find $(SRCDIR) -mindepth 1 -maxdepth 5 -name &quot;*.c&quot;)
asmsources :=$(shell find $(SRCDIR) -mindepth 1 -maxdepth 5 -name &quot;*.s&quot;)

cobjects := $(patsubst %.c,%.o,$(csources))
asmobjects:=$(patsubst %.s,%.o,$(asmsources))
depfiles:= $(patsubst %.c,%.d,$(csources))

all: kernel

kernel: $(cobjects) $(asmobjects)
	$(BINDIR)/i586-elf-ld -o kernel -Tlink.ld $(cobjects) $(asmobjects)
clean:
	rm $(cobjects) $(asmobjects)
	rm kernel

%.o: %.c
	$(BINDIR)/i586-elf-gcc -c $&lt; -o $@ $(CFLAGS)

%.o: %.s
	nasm -felf32 $&lt;
</code></pre>
<p>edit: wenn nötig bitte verschieben. tschuldigung für den fall.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1790732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1790732</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sat, 10 Oct 2009 20:52:32 GMT</pubDate></item><item><title><![CDATA[Reply to Makefilefrage: Wie kann jede Quelldatei von Änderungen ihrer header abhängen? on Sat, 10 Oct 2009 20:56:25 GMT]]></title><description><![CDATA[<p>Hier geht es nur um Standard (also ISO) C++ Fragen! Eine Makefile hat damit nichts zu tun.</p>
<p>Ansonsten schau dir die <a href="http://c-plusplus.net/forum/viewtopic-var-t-is-88418.html" rel="nofollow">Ultimative Makefile</a> an!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1790734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1790734</guid><dc:creator><![CDATA[rüdiger]]></dc:creator><pubDate>Sat, 10 Oct 2009 20:56:25 GMT</pubDate></item><item><title><![CDATA[Reply to Makefilefrage: Wie kann jede Quelldatei von Änderungen ihrer header abhängen? on Sat, 10 Oct 2009 21:00:35 GMT]]></title><description><![CDATA[<p>trotzdem danke für deine Antwort</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1790737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1790737</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sat, 10 Oct 2009 21:00:35 GMT</pubDate></item><item><title><![CDATA[Reply to Makefilefrage: Wie kann jede Quelldatei von Änderungen ihrer header abhängen? on Sun, 11 Oct 2009 00:31:57 GMT]]></title><description><![CDATA[<p>Alternativ kannst du dir auch einfache Buildsysteme wie SCons anschauen.<br />
Wenn du dann bei der Verteilung des Programmes wegen dessen Verbreitung auf make setzen willst, wären sowieso die autotools angebracht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1790772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1790772</guid><dc:creator><![CDATA[JustAnotherNoob]]></dc:creator><pubDate>Sun, 11 Oct 2009 00:31:57 GMT</pubDate></item><item><title><![CDATA[Reply to Makefilefrage: Wie kann jede Quelldatei von Änderungen ihrer header abhängen? on Sun, 11 Oct 2009 07:21:44 GMT]]></title><description><![CDATA[<p>Einfach die Objekte (*.o) auch von den Header-Dateien abhängig machen. Entweder manuell (soundso.o : dings.h bums.h), oder automatisch (<a href="http://en.wikipedia.org/wiki/Makedepend" rel="nofollow">makedepend</a>).</p>
<p>Alternativ kannst Du ein anderes Build-System nutzen, welches solche Abhängigkeiten automatisch erkennt (<a href="http://www.cmake.org/" rel="nofollow">cmake</a>, <a href="http://www.boost.org/doc/tools/build/index.html" rel="nofollow">Boost.Build</a>, ...)</p>
<p>Gruß,<br />
SP</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1790798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1790798</guid><dc:creator><![CDATA[Sebastian Pizer]]></dc:creator><pubDate>Sun, 11 Oct 2009 07:21:44 GMT</pubDate></item><item><title><![CDATA[Reply to Makefilefrage: Wie kann jede Quelldatei von Änderungen ihrer header abhängen? on Sun, 11 Oct 2009 10:59:37 GMT]]></title><description><![CDATA[<p>jap die methode aus dem ultimate makefile hat funktioniert.</p>
<p>danke ich werd mir auch scons, autotool,... mal genauer anschauen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1790863</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1790863</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sun, 11 Oct 2009 10:59:37 GMT</pubDate></item></channel></rss>