summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile (renamed from makefile)20
-rw-r--r--example/filter_html.cpp17
-rw-r--r--example/makefile24
-rw-r--r--examples/Makefile29
-rw-r--r--examples/plain_to_html.cpp (renamed from example/plain_to_html.cpp)0
5 files changed, 39 insertions, 51 deletions
diff --git a/makefile b/Makefile
index 68c986c..09a764d 100644
--- a/makefile
+++ b/Makefile
@@ -1,19 +1,19 @@
# Debug mode:
# DEBUG = yes
-CC = g++
-LIB = libtexo.a
+CC = g++
+LIB = libtexo.a
-CFLAGS = -Wall
+CPPFLAGS = -Wall -ansi
ifeq '$(DEBUG)' 'yes'
-CFLAGS += -g -O0
+CPPFLAGS += -g -O0
else
-CFLAGS += -O3
+CPPFLAGS += -O3
endif
-SRC_DIR = src
-SRC = $(wildcard $(SRC_DIR)/*.cpp)
-OBJ = $(SRC:.cpp=.o)
+SRC_DIR = src
+SRC = $(wildcard $(SRC_DIR)/*.cpp)
+OBJ = $(SRC:.cpp=.o)
default: $(LIB)
@@ -25,8 +25,8 @@ endif
deps.mk: $(SRC)
$(CC) -MM $^ > $@
-%.o: %.cpp %.h
- $(CC) $(CFLAGS) -c $< -o $@
+%.o: %.cpp %.hpp
+ $(CC) $(CPPFLAGS) -c $< -o $@
$(LIB): $(OBJ)
ar rcs $@ $^
diff --git a/example/filter_html.cpp b/example/filter_html.cpp
deleted file mode 100644
index a1957c3..0000000
--- a/example/filter_html.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <stdio.h>
-#include <html.hpp>
-#include <file.hpp>
-
-int main()
-{
- TexoFileExporter exporter(stdout);
- TexoHTMLProducer producer(exporter);
- TexoHTMLImporter importer(producer);
- importer.PutStr(
- "<script>EVIL MAGIC</script></p>\n"
- "<a href='#'>Some</a> br:<br/>\n"
- "<p class='evil_too'>And paragraphs work well too...</p>\n"
- "<b>You</b> <i>can</i> <del>use</del> <ins>some</ins> <p>witchcraft.\n"
- );
- return 0;
-}
diff --git a/example/makefile b/example/makefile
deleted file mode 100644
index 39d4db7..0000000
--- a/example/makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-# Uncomment following to enable debug mode:
-# DEBUG = yes
-
-CC = g++
-EXAMPLES = plain_to_html filter_html
-
-CFLAGS = -Wall
-ifeq '$(DEBUG)' 'yes'
-CFLAGS += -g -O0
-else
-CFLAGS += -O3
-endif
-
-INCLUDE = -I ../src
-LFLAGS = -L.. -ltexo
-
-
-default: $(EXAMPLES)
-
-%: %.cpp
- $(CC) $(CFLAGS) $(INCLUDE) $< $(LFLAGS) -o $@
-
-clean:
- rm -f $(EXAMPLES)
diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644
index 0000000..be725ae
--- /dev/null
+++ b/examples/Makefile
@@ -0,0 +1,29 @@
+# Uncomment following to enable debug mode:
+# DEBUG = yes
+
+CC = g++
+EXAMPLES = plain_to_html
+
+CPPFLAGS = -Wall -ansi
+ifeq '$(DEBUG)' 'yes'
+CPPFLAGS += -g -O0
+else
+CPPFLAGS += -O3
+endif
+
+INCLUDE = -I../src
+LFLAGS = -L.. -ltexo
+
+TEXO = ../libtexo.a
+
+
+default: $(EXAMPLES)
+
+$(TEXO):
+ cd ..; $(MAKE)
+
+%: %.cpp $(TEXO)
+ $(CC) $(CPPFLAGS) $(INCLUDE) $< $(LFLAGS) -o $@
+
+clean:
+ rm -f $(EXAMPLES)
diff --git a/example/plain_to_html.cpp b/examples/plain_to_html.cpp
index 9a81652..9a81652 100644
--- a/example/plain_to_html.cpp
+++ b/examples/plain_to_html.cpp