Add support for C++ examples
For convenience, we link C examples using g++ as well, which should not cause any problems.
This commit is contained in:
parent
587753aceb
commit
08d55e3b9b
2 changed files with 10 additions and 2 deletions
|
@ -8,7 +8,8 @@ build: build-src build-manual
|
|||
|
||||
build-snippets:
|
||||
for p in en-US/* ; do test -d $$p && mkdir -p $$p/snippets; done
|
||||
python scripts/split-snippets.py . src/*.c src/*.java src/*.py
|
||||
python scripts/split-snippets.py . \
|
||||
src/*.c src/*.cpp src/*.java src/*.py
|
||||
|
||||
build-manual: build-snippets
|
||||
publican build --format=html,epub,pdf --lang=en-US
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
.PHONY: build-sources
|
||||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CWARNFLAGS = -Wall -W -Wno-unused-parameter -Werror=implicit-function-declaration
|
||||
CXXWARNFLAGS = -Wall -W
|
||||
CFLAGS = -std=gnu99 -O2 $(CWARNFLAGS) -g
|
||||
CXXFLAGS = -std=c++03 -O2 $(CXXWARNFLAGS) -g
|
||||
LDFLAGS = -g
|
||||
|
||||
# List files which should only be compiled for syntax checking.
|
||||
compile_only += C-Pointers-remaining
|
||||
|
@ -42,11 +46,14 @@ clean-src:
|
|||
src/%.o: src/%.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) $(CFLAGS_$(basename $(notdir $@))) -c $< -o $@
|
||||
|
||||
src/%.o: src/%.cpp
|
||||
$(CXX) $(CXXFLAGS) $(DEFINES) $(CFLAGS_$(basename $(notdir $@))) -c $< -o $@
|
||||
|
||||
src/%.class: src/%.java
|
||||
javac -source 1.6 -target 1.6 -Xlint:all $^
|
||||
|
||||
src/%: src/%.o
|
||||
$(CC) $^ -o $@ $(LIBS_$(notdir $@))
|
||||
$(CXX) $(LDFLAGS) $^ -o $@ $(LIBS_$(notdir $@))
|
||||
|
||||
src/TLS-Client-GNUTLS: src/tcp_connect.o
|
||||
src/TLS-Client-OpenSSL: src/tcp_connect.o src/x509_check_host.o
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue