<?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[Hilfe bei Makefile]]></title><description><![CDATA[<p>Das folgende Mafefile habe ich auch dem Forum hier. Es kompiliert wunderbar außer: Ich habe zusätzlich zu meinen cpp dateien noch .c dateien in meinem Projekt welche ich gerne dazukompileren würde. In der Form geht das aber nicht - leider kenne ich mich nicht genug aus wie ich das folgende makefile anpassen muss damit auch c - dateien dazugenommen werden. Kann mir jemand helfen?</p>
<pre><code>TARGET   := ./out
CXXFLAGS := -O3
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;:.c=.o) -o $@

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

.PHONY: clean
clean:
        rm -rf $(BUILDDIR)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/196121/hilfe-bei-makefile</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 02:24:53 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/196121.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Oct 2007 17:10:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hilfe bei Makefile on Thu, 25 Oct 2007 17:10:55 GMT]]></title><description><![CDATA[<p>Das folgende Mafefile habe ich auch dem Forum hier. Es kompiliert wunderbar außer: Ich habe zusätzlich zu meinen cpp dateien noch .c dateien in meinem Projekt welche ich gerne dazukompileren würde. In der Form geht das aber nicht - leider kenne ich mich nicht genug aus wie ich das folgende makefile anpassen muss damit auch c - dateien dazugenommen werden. Kann mir jemand helfen?</p>
<pre><code>TARGET   := ./out
CXXFLAGS := -O3
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;:.c=.o) -o $@

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

.PHONY: clean
clean:
        rm -rf $(BUILDDIR)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1392033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1392033</guid><dc:creator><![CDATA[Mistero]]></dc:creator><pubDate>Thu, 25 Oct 2007 17:10:55 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Makefile on Thu, 25 Oct 2007 17:36:59 GMT]]></title><description><![CDATA[<pre><code>EXT      := cpp 
zu
EXT      := c*
</code></pre>
<p>Sollte funktionieren. (keine Garantie dafür, hab es nicht ausprobiert)</p>
<p>Denk dabei auch an die Unterschiede zwischen C und C++<br />
wie z.B. &quot;name mangling&quot; und benutzt gegebenfalls &quot;extern&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1392052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1392052</guid><dc:creator><![CDATA[Mario Sandler]]></dc:creator><pubDate>Thu, 25 Oct 2007 17:36:59 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Makefile on Thu, 25 Oct 2007 17:43:58 GMT]]></title><description><![CDATA[<pre><code>*** missing separator.  Schluss.
</code></pre>
<p>kommt beim ändern zu c*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1392055</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1392055</guid><dc:creator><![CDATA[Mistero]]></dc:creator><pubDate>Thu, 25 Oct 2007 17:43:58 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Makefile on Fri, 26 Oct 2007 09:13:28 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-8.html" rel="nofollow">Rund um die Programmierung</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1392352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1392352</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Fri, 26 Oct 2007 09:13:28 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Makefile on Fri, 26 Oct 2007 12:39:18 GMT]]></title><description><![CDATA[<p>make file file maker</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1392489</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1392489</guid><dc:creator><![CDATA[Grobiline]]></dc:creator><pubDate>Fri, 26 Oct 2007 12:39:18 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Makefile on Fri, 26 Oct 2007 13:49:22 GMT]]></title><description><![CDATA[<p>Ändere</p>
<pre><code>EXT      := cpp
# ...

SOURCES  := $(wildcard *.$(EXT))
OBJECTS  := $(patsubst %.$(EXT), $(BUILDDIR)/%.o, $(SOURCES))
DEPS     := $(patsubst %.$(EXT), $(BUILDDIR)/%.dep, $(SOURCES))
</code></pre>
<p>in</p>
<pre><code>CXXEXT := cpp
CEXT := c
#...

CXXSOURCES  := $(wildcard *.$(CXXEXT))
CXXOBJECTS  := $(patsubst %.$(CXXEXT), $(BUILDDIR)/%.o, $(CXXSOURCES))
CXXDEPS     := $(patsubst %.$(CXXEXT), $(BUILDDIR)/%.dep, $(CXXSOURCES))

CSOURCES  := $(wildcard *.$(CEXT))
COBJECTS  := $(patsubst %.$(CEXT), $(BUILDDIR)/%.o, $(CSOURCES))
CDEPS     := $(patsubst %.$(CEXT), $(BUILDDIR)/%.dep, $(CSOURCES))

SOURCES := $(CSOURCES) $(CXXSOURCES)
OBJECTS := $(COBJECTS) $(CXXOBJECTS)
DEPS := $(CDEPS) $(CXXDEPS)
</code></pre>
<p>und</p>
<pre><code>$(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;:.c=.o) -o $@
</code></pre>
<p>in</p>
<pre><code>$(CXXOBJECTS): $(BUILDDIR)/%.o: %.$(CXXEXT) $(BUILDDIR)/%.dep $(BUILDDIR)/.tag
        $(CXX) $(CXXFLAGS) -c $&lt; -o $@

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

$(COBJECTS): $(BUILDDIR)/%.o: %.$(CEXT) $(BUILDDIR)/%.dep $(BUILDDIR)/.tag
        $(CC) $(CFLAGS) -c $&lt; -o $@

$(CDEPS): $(BUILDDIR)/%.dep: %.$(CEXT) $(BUILDDIR)/.tag
        $(CC) $(CFLAGS) -MM $&lt; -MT $@ -MT $(&lt;:.$(CEXT)=.o) -o $@
</code></pre>
<p>hab es aber nicht getestet. So ungefähr halt.</p>
<p>&lt;edit&gt;benutz bitte bessere Topics <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /> &lt;/edit&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1392540</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1392540</guid><dc:creator><![CDATA[rüdiger]]></dc:creator><pubDate>Fri, 26 Oct 2007 13:49:22 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Makefile on Sat, 27 Oct 2007 19:52:30 GMT]]></title><description><![CDATA[<p>Wie kann ich in das Makefile derart ändern, daß ich Shared Librarys inkludieren kann ? Ich hatte es Greenhorn-mässig erstmal mit untigem Eintrag probiert ?</p>
<blockquote>
<p>LIBS := boost_filesystem-gcc42-1_34_1</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1393269</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393269</guid><dc:creator><![CDATA[Winn logged off]]></dc:creator><pubDate>Sat, 27 Oct 2007 19:52:30 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Makefile on Sat, 27 Oct 2007 21:24:09 GMT]]></title><description><![CDATA[<p>Winn logged off schrieb:</p>
<blockquote>
<p>Wie kann ich in das Makefile derart ändern, daß ich Shared Librarys inkludieren kann ? Ich hatte es Greenhorn-mässig erstmal mit untigem Eintrag probiert ?</p>
<blockquote>
<p>LIBS := boost_filesystem-gcc42-1_34_1</p>
</blockquote>
</blockquote>
<p>Okay, also die Einbindung von INCLUDE's und LIBRARY's habe ich nun hinbekommen, wie aber kann man ein MakeFile modifizieren, damit aus dem Build-Verzeichnis auch die darunter liegenden Verzeichnisse aka *.cpp abgesucht und in dem Build-Prozess eingebunden werden ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393340</guid><dc:creator><![CDATA[Winn]]></dc:creator><pubDate>Sat, 27 Oct 2007 21:24:09 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Makefile on Sat, 27 Oct 2007 23:49:47 GMT]]></title><description><![CDATA[<p>Winn logged off schrieb:</p>
<blockquote>
<p>Wie kann ich in das Makefile derart ändern, daß ich Shared Librarys inkludieren kann ? Ich hatte es Greenhorn-mässig erstmal mit untigem Eintrag probiert ?</p>
<blockquote>
<p>LIBS := boost_filesystem-gcc42-1_34_1</p>
</blockquote>
</blockquote>
<p>Du musst die Parameter da natürlich so eintragen, wie der GCC (bzw. der verwendete Compiler sie versteht). Für Libraries benutzt man das -l-Flag. Siehe <a href="http://man.cx/gcc" rel="nofollow">man: gcc</a></p>
<p>Winn schrieb:</p>
<blockquote>
<p>Winn logged off schrieb:</p>
<blockquote>
<p>Wie kann ich in das Makefile derart ändern, daß ich Shared Librarys inkludieren kann ? Ich hatte es Greenhorn-mässig erstmal mit untigem Eintrag probiert ?</p>
<blockquote>
<p>LIBS := boost_filesystem-gcc42-1_34_1</p>
</blockquote>
</blockquote>
<p>Okay, also die Einbindung von INCLUDE's und LIBRARY's habe ich nun hinbekommen, wie aber kann man ein MakeFile modifizieren, damit aus dem Build-Verzeichnis auch die darunter liegenden Verzeichnisse aka *.cpp abgesucht und in dem Build-Prozess eingebunden werden ?</p>
</blockquote>
<p>Die Zeile anpassen <code>SOURCES := $(wildcard *.$(EXT))</code></p>
<p>Siehe auch <a href="http://www.gnu.org/software/make/manual/make.html" rel="nofollow">http://www.gnu.org/software/make/manual/make.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393410</guid><dc:creator><![CDATA[rüdiger]]></dc:creator><pubDate>Sat, 27 Oct 2007 23:49:47 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Makefile on Mon, 29 Oct 2007 09:58:57 GMT]]></title><description><![CDATA[<p><strong>EDIT::Hab mir nun mit einem Shell-Skript geholfen, benötige also keine Hilfe mehr... Makefiles sind mir dafür zu aufwendig - Danke trotzdem !</strong></p>
<p>rüdiger schrieb:</p>
<blockquote>
<p>Die Zeile anpassen <code>SOURCES := $(wildcard *.$(EXT))</code><br />
Siehe auch <a href="http://www.gnu.org/software/make/manual/make.html" rel="nofollow">http://www.gnu.org/software/make/manual/make.html</a></p>
</blockquote>
<p>Das habe ich probiert, inzwischen sieht meint MakeFile so aus - quittiert wird seine Ausführung mit &quot;make: *** No rule to make target `caeBox.cpp', needed by `build/caeBox.o'. Stop.&quot; Wobei die Datei &quot;caeBox.cpp&quot; im &quot;./subfolder/&quot; liegt. Der von Dir angegebene Link führt zur kompletten Funktionsweise von Make - ich brauche nur eine kleine Untermenge davon und leider sitzt mir auch die Zeit ein wenig im Nacken...</p>
<pre><code>TARGET   := ./ReadCAE
LIBS     := -Xlinker $(LD_LIBRARY_PATH)/libboost_filesystem-gcc42-1_34_1.so
INCLUDE  := -I$(INCLUDE_PATH)
CXXFLAGS := -O2 -g -v $(LIBS) $(INCLUDE)
CXX      := g++
EXT      := cpp
BUILDDIR := build
Data     := ./subfolder/

override BUILDDIR := $(strip $(BUILDDIR))
ROOT_SOURCES  := $(wildcard *.$(EXT))
ROOT_OBJECTS  := $(patsubst %.$(EXT), $(BUILDDIR)/%.o, $(ROOT_SOURCES))
ROOT_DEPS     := $(patsubst %.$(EXT), $(BUILDDIR)/%.dep, $(ROOT_SOURCES))

DATA_SOURCES  := $(wildcard $(Data)*.$(EXT))
DATA_OBJECTS  := $(patsubst $(Data)%.$(EXT), $(BUILDDIR)/%.o, $(DATA_SOURCES))
DATA_DEPS     := $(patsubst $(Data)%.$(EXT), $(BUILDDIR)/%.dep, $(DATA_SOURCES))

SOURCES := $(ROOT_SOURCES) $(DATA_SOURCES) 
OBJECTS := $(ROOT_OBJECTS) $(DATA_OBJECTS) 
DEPS := $(ROOT_DEPS) $(DATA_DEPS) 

.PHONY: all
all: $(TARGET)

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

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

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

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

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

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

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

.PHONY: clean
clean:
	rm -rf $(BUILDDIR)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1393961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393961</guid><dc:creator><![CDATA[Winn]]></dc:creator><pubDate>Mon, 29 Oct 2007 09:58:57 GMT</pubDate></item></channel></rss>