Prefer separate compilation.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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,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
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user