<?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[Problem mit der ultimativen Makefile]]></title><description><![CDATA[<p>Wenn ich versuche folgendes Programm:</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
	cout&lt;&lt;&quot;Hallo Welt&quot;&lt;&lt;endl;
	system(&quot;pause&quot;);
};
</code></pre>
<p>mit folgender (der ultimativen) Makefile:</p>
<pre><code>TARGET   := ./program
CXXFLAGS := -g -W -Wall -Wno-long-long -pedantic -std=c++98
CXX      := g++
LIBS     := 
EXT      := cpp
BUILDDIR := build 

override BUILDDIR := $(strip $(BUILDDIR))
SOURCES  := $(wildcard *.$(EXT))
OBJECTS  := $(patsubst %.$(EXT), $(BUILDDIR)/%.o, $(SOURCES))
DEPS     := $(patsubst %.$(EXT), $(BUILDDIR)/%.dep, $(SOURCES)) 

.PHONY: all
all: $(TARGET) 

$(TARGET): $(OBJECTS) $(DEPS)
	$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) 

ifneq ($(MAKECMDGOALS), clean)
-include $(DEPS)
endif 

$(OBJECTS): $(BUILDDIR)/%.o: %.$(EXT) $(BUILDDIR)/%.dep $(BUILDDIR)/.tag 
	$(CXX) $(CXXFLAGS) -c $&lt; -o $@ 

$(DEPS): $(BUILDDIR)/%.dep: %.$(EXT) $(BUILDDIR)/.tag 
	$(CXX) $(CXXFLAGS) -MM $&lt; -MT $@ -MT $(&lt;:.$(EXT)=.o) -o $@ 

%.tag:
	mkdir -p $(dir $(@))
	touch $@ 

.PHONY: clean 
clean:
	rm -rf $(BUILDDIR)
</code></pre>
<p>zu kompilieren bekomme ich folgenden Fehler:</p>
<pre><code>C:\Dokumente und Einstellungen\meinname\Desktop&gt;mingw32-make
mkdir -p build/
Syntaxfehler.
mingw32-make: *** No rule to make target `build/main.dep', needed by `build/main
.o'.  Stop.
</code></pre>
<p>Könnte mir BITTE jemand erklären was ich falsch mache?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/197507/problem-mit-der-ultimativen-makefile</link><generator>RSS for Node</generator><lastBuildDate>Mon, 29 Jun 2026 05:02:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/197507.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Nov 2007 14:02:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit der ultimativen Makefile on Sun, 11 Nov 2007 14:02:28 GMT]]></title><description><![CDATA[<p>Wenn ich versuche folgendes Programm:</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
	cout&lt;&lt;&quot;Hallo Welt&quot;&lt;&lt;endl;
	system(&quot;pause&quot;);
};
</code></pre>
<p>mit folgender (der ultimativen) Makefile:</p>
<pre><code>TARGET   := ./program
CXXFLAGS := -g -W -Wall -Wno-long-long -pedantic -std=c++98
CXX      := g++
LIBS     := 
EXT      := cpp
BUILDDIR := build 

override BUILDDIR := $(strip $(BUILDDIR))
SOURCES  := $(wildcard *.$(EXT))
OBJECTS  := $(patsubst %.$(EXT), $(BUILDDIR)/%.o, $(SOURCES))
DEPS     := $(patsubst %.$(EXT), $(BUILDDIR)/%.dep, $(SOURCES)) 

.PHONY: all
all: $(TARGET) 

$(TARGET): $(OBJECTS) $(DEPS)
	$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) 

ifneq ($(MAKECMDGOALS), clean)
-include $(DEPS)
endif 

$(OBJECTS): $(BUILDDIR)/%.o: %.$(EXT) $(BUILDDIR)/%.dep $(BUILDDIR)/.tag 
	$(CXX) $(CXXFLAGS) -c $&lt; -o $@ 

$(DEPS): $(BUILDDIR)/%.dep: %.$(EXT) $(BUILDDIR)/.tag 
	$(CXX) $(CXXFLAGS) -MM $&lt; -MT $@ -MT $(&lt;:.$(EXT)=.o) -o $@ 

%.tag:
	mkdir -p $(dir $(@))
	touch $@ 

.PHONY: clean 
clean:
	rm -rf $(BUILDDIR)
</code></pre>
<p>zu kompilieren bekomme ich folgenden Fehler:</p>
<pre><code>C:\Dokumente und Einstellungen\meinname\Desktop&gt;mingw32-make
mkdir -p build/
Syntaxfehler.
mingw32-make: *** No rule to make target `build/main.dep', needed by `build/main
.o'.  Stop.
</code></pre>
<p>Könnte mir BITTE jemand erklären was ich falsch mache?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1401339</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1401339</guid><dc:creator><![CDATA[alfonsospringer]]></dc:creator><pubDate>Sun, 11 Nov 2007 14:02:28 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit der ultimativen Makefile on Sun, 11 Nov 2007 20:20:19 GMT]]></title><description><![CDATA[<p>kann mir denn niemand weiterhelfen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> ? Ich benutze mingw 5.3.1</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1401601</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1401601</guid><dc:creator><![CDATA[alfonsospringer]]></dc:creator><pubDate>Sun, 11 Nov 2007 20:20:19 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit der ultimativen Makefile on Mon, 12 Nov 2007 14:17:16 GMT]]></title><description><![CDATA[<p>LOL.</p>
<p>Die marginale Aussage: &quot;Syntaxfehler.&quot; wird bei mir im gleichen Hirnlappen verarbeitet wie: &quot;Speicherzugriffsfehler.&quot; Beide mit Punkt am Ende. Das wars.</p>
<p>Soviel sei verraten: das sind beide betriebssystem-nahe Meldungen. Deine Meldung kommt von cmd.exe, weil es die Anweisung &quot;mkdir -p build/&quot; infolge des falschen Pfadseparators nicht versteht. Weg mit ihm!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1401879</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1401879</guid><dc:creator><![CDATA[cheopz]]></dc:creator><pubDate>Mon, 12 Nov 2007 14:17:16 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit der ultimativen Makefile on Mon, 12 Nov 2007 17:30:20 GMT]]></title><description><![CDATA[<p>was ist ein Pfadseperator?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1402018</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1402018</guid><dc:creator><![CDATA[alfonsospringer]]></dc:creator><pubDate>Mon, 12 Nov 2007 17:30:20 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit der ultimativen Makefile on Thu, 27 Dec 2007 06:43:49 GMT]]></title><description><![CDATA[<p>Der Slash. (Sorry, hat ein bißchen gedauert)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1426658</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1426658</guid><dc:creator><![CDATA[cheopz]]></dc:creator><pubDate>Thu, 27 Dec 2007 06:43:49 GMT</pubDate></item></channel></rss>