Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Have the example-building code look at LEBOOK_CFLAGS

Also add a makefile for examples_R8.

Also, "make check" now tries to build all the examples.
  • Loading branch information...
commit b564241089c72285122e6bcdcb8e161143eb755e 1 parent 1d9d9b4
Nick Mathewson authored
Showing with 36 additions and 8 deletions.
  1. +14 −2 Makefile
  2. +2 −6 examples_01/Makefile
  3. +20 −0 examples_R8/Makefile
View
16 Makefile
@@ -2,8 +2,10 @@
# asciidoc 8.4.3 is known to work. asciidoc 8.2.5 is known not to work.
ASCIIDOC=asciidoc
-GENERATED_HTML= \
- TOC.html \
+GENERATED_METAFILES= \
+ TOC.html
+
+GENERATED_CHAPTERS= \
00_about.html \
01_intro.html \
Ref0_meta.html \
@@ -16,12 +18,20 @@ GENERATED_HTML= \
Ref7_evbuffer.html \
Ref8_listener.html
+GENERATED_HTML = $(GENERATED_METAFILES) $(GENERATED_CHAPTERS)
+
all: html examples
html: $(GENERATED_HTML)
+check: examples inline_examples
+
examples:
cd examples_01 && $(MAKE)
+ cd examples_R8 && $(MAKE)
+
+inline_examples:
+ ./bin/build_examples.py *_*.txt
.SUFFIXES: .txt .html
@@ -45,6 +55,8 @@ clean:
rm -f *.o
rm -f $(GENERATED_HTML)
cd examples_01 && $(MAKE) clean
+ cd examples_R8 && $(MAKE) clean
+ rm -rf tmpcode_*
count:
wc -w *.txt
View
8 examples_01/Makefile
@@ -1,8 +1,7 @@
CC=gcc
-CFLAGS=-g -Wall -L/Users/nickm/le/lib -I/Users/nickm/le/include
+CFLAGS=-g -Wall $(LEBOOK_CFLAGS)
-GENERATED_HTML=01_intro.html
EXAMPLE_BINARIES=01_sync_webclient 01_rot13_server_forking \
01_rot13_server_select 01_rot13_server_libevent \
01_rot13_server_bufferevent
@@ -11,8 +10,6 @@ all: examples
examples: $(EXAMPLE_BINARIES)
-01_intro.html: 01_sync_webclient.c
-
01_sync_webclient: 01_sync_webclient.o
$(CC) $(CFLAGS) 01_sync_webclient.o -o 01_sync_webclient
@@ -26,7 +23,7 @@ examples: $(EXAMPLE_BINARIES)
$(CC) $(CFLAGS) 01_rot13_server_libevent.o -o 01_rot13_server_libevent -levent_core
01_rot13_server_bufferevent: 01_rot13_server_bufferevent.o
- $(CC) $(CFLAGS) /Users/nickm/le/lib/libevent_core.a 01_rot13_server_bufferevent.o -o 01_rot13_server_bufferevent
+ $(CC) $(CFLAGS) 01_rot13_server_bufferevent.o -o 01_rot13_server_bufferevent -levent_core
.c.o:
$(CC) $(CFLAGS) -c $<
@@ -35,4 +32,3 @@ clean:
rm -f *~
rm -f *.o
rm -f $(EXAMPLE_BINARIES)
- rm -f $(GENERATED_HTML)
View
20 examples_R8/Makefile
@@ -0,0 +1,20 @@
+
+CC=gcc
+CFLAGS=-g -Wall $(LEBOOK_CFLAGS)
+
+EXAMPLE_BINARIES=R8_echo_server
+
+all: examples
+
+examples: $(EXAMPLE_BINARIES)
+
+R8_echo_server: R8_echo_server.o
+ $(CC) $(CFLAGS) R8_echo_server.o -o R8_echo_server -levent_core
+
+.c.o:
+ $(CC) $(CFLAGS) -c $<
+
+clean:
+ rm -f *~
+ rm -f *.o
+ rm -f $(EXAMPLE_BINARIES)
Please sign in to comment.
Something went wrong with that request. Please try again.