Prefer separate compilation.
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
CXXFLAGS = -std=gnu++0x -Wall
|
||||
LDLIBS = -lstdc++
|
||||
all: example-client-cpp11 example-client
|
||||
example-client-cpp11.o: example-client-cpp11.cpp easywsclient.cpp easywsclient.hpp
|
||||
example-client.o: example-client.cpp easywsclient.cpp easywsclient.hpp
|
||||
.PHONY: all clean
|
||||
all: example-client example-client-cpp11
|
||||
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
|
||||
|
||||
@@ -60,7 +60,7 @@ Put together, the usage looks like this:
|
||||
|
||||
```c++
|
||||
#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
|
||||
main()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Compile with:
|
||||
// g++ -std=gnu++0x example-client-cpp11.cpp -o example-client-cpp11
|
||||
#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 <stdio.h>
|
||||
#include <string>
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#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 <stdio.h>
|
||||
#include <string>
|
||||
|
||||
Reference in New Issue
Block a user