Prefer separate compilation.

This commit is contained in:
David Baird
2013-09-27 04:03:28 -06:00
parent f453367866
commit 9b7a5c9575
4 changed files with 12 additions and 6 deletions
+9 -3
View File
@@ -1,5 +1,11 @@
CXXFLAGS = -std=gnu++0x -Wall CXXFLAGS = -std=gnu++0x -Wall
LDLIBS = -lstdc++ LDLIBS = -lstdc++
all: example-client-cpp11 example-client .PHONY: all clean
example-client-cpp11.o: example-client-cpp11.cpp easywsclient.cpp easywsclient.hpp all: example-client example-client-cpp11
example-client.o: example-client.cpp easywsclient.cpp easywsclient.hpp clean:
-rm example-client example-client-cpp11 *.o
example-client-cpp11: example-client-cpp11.o easywsclient.o
example-client-cpp11.o: example-client-cpp11.cpp easywsclient.hpp
example-client: example-client.o easywsclient.o
example-client.o: example-client.cpp easywsclient.hpp
easywsclient.o: easywsclient.cpp easywsclient.hpp
+1 -1
View File
@@ -60,7 +60,7 @@ Put together, the usage looks like this:
```c++ ```c++
#include "easywsclient.hpp" #include "easywsclient.hpp"
#include "easywsclient.cpp" // <-- include only if you don't want compile separately //#include "easywsclient.cpp" // <-- include only if you don't want compile separately
int int
main() main()
+1 -1
View File
@@ -1,7 +1,7 @@
// Compile with: // Compile with:
// g++ -std=gnu++0x example-client-cpp11.cpp -o example-client-cpp11 // g++ -std=gnu++0x example-client-cpp11.cpp -o example-client-cpp11
#include "easywsclient.hpp" #include "easywsclient.hpp"
#include "easywsclient.cpp" // <-- include only if you don't want compile separately //#include "easywsclient.cpp" // <-- include only if you don't want compile separately
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
+1 -1
View File
@@ -1,5 +1,5 @@
#include "easywsclient.hpp" #include "easywsclient.hpp"
#include "easywsclient.cpp" // <-- include only if you don't want compile separately //#include "easywsclient.cpp" // <-- include only if you don't want compile separately
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>