From 7b09f265c1deb12c9e6778c4d92473d66fc5406b Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Wed, 16 Oct 2019 19:34:47 +0300 Subject: [texo] Starting rewriting... --- Makefile | 35 +++++++++++++++++++++++++++++++++++ example/filter_html.cpp | 17 ----------------- example/makefile | 24 ------------------------ example/plain_to_html.cpp | 21 --------------------- examples/Makefile | 29 +++++++++++++++++++++++++++++ examples/plain_to_html.cpp | 21 +++++++++++++++++++++ makefile | 35 ----------------------------------- 7 files changed, 85 insertions(+), 97 deletions(-) create mode 100644 Makefile delete mode 100644 example/filter_html.cpp delete mode 100644 example/makefile delete mode 100644 example/plain_to_html.cpp create mode 100644 examples/Makefile create mode 100644 examples/plain_to_html.cpp delete mode 100644 makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..09a764d --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +# Debug mode: +# DEBUG = yes + +CC = g++ +LIB = libtexo.a + +CPPFLAGS = -Wall -ansi +ifeq '$(DEBUG)' 'yes' +CPPFLAGS += -g -O0 +else +CPPFLAGS += -O3 +endif + +SRC_DIR = src +SRC = $(wildcard $(SRC_DIR)/*.cpp) +OBJ = $(SRC:.cpp=.o) + + +default: $(LIB) + +ifneq "clean" "$(MAKECMDGOALS)" +-include deps.mk +endif + +deps.mk: $(SRC) + $(CC) -MM $^ > $@ + +%.o: %.cpp %.hpp + $(CC) $(CPPFLAGS) -c $< -o $@ + +$(LIB): $(OBJ) + ar rcs $@ $^ + +clean: + rm -f $(OBJ) $(LIB) deps.mk 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 -#include -#include - -int main() -{ - TexoFileExporter exporter(stdout); - TexoHTMLProducer producer(exporter); - TexoHTMLImporter importer(producer); - importer.PutStr( - "

\n" - "Some br:
\n" - "

And paragraphs work well too...

\n" - "You can use some

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/example/plain_to_html.cpp b/example/plain_to_html.cpp deleted file mode 100644 index 9a81652..0000000 --- a/example/plain_to_html.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include -#include - - -int main() -{ - TexoFileExporter exporter(stdout); - TexoHTMLProducer producer(exporter); - TexoPlainImporter importer(producer); - importer.PutStr( - "I am a little cute line. \n" - "I am another and that's fine. \n" - "But I am as long as a pine,\n" - "so lets drink a glass of wine.\n\n" - "Second paragraph was started here. \n" - "Take your bananas and go home, seer.\n" - ); - return 0; -} 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/examples/plain_to_html.cpp b/examples/plain_to_html.cpp new file mode 100644 index 0000000..9a81652 --- /dev/null +++ b/examples/plain_to_html.cpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include + + +int main() +{ + TexoFileExporter exporter(stdout); + TexoHTMLProducer producer(exporter); + TexoPlainImporter importer(producer); + importer.PutStr( + "I am a little cute line. \n" + "I am another and that's fine. \n" + "But I am as long as a pine,\n" + "so lets drink a glass of wine.\n\n" + "Second paragraph was started here. \n" + "Take your bananas and go home, seer.\n" + ); + return 0; +} diff --git a/makefile b/makefile deleted file mode 100644 index 68c986c..0000000 --- a/makefile +++ /dev/null @@ -1,35 +0,0 @@ -# Debug mode: -# DEBUG = yes - -CC = g++ -LIB = libtexo.a - -CFLAGS = -Wall -ifeq '$(DEBUG)' 'yes' -CFLAGS += -g -O0 -else -CFLAGS += -O3 -endif - -SRC_DIR = src -SRC = $(wildcard $(SRC_DIR)/*.cpp) -OBJ = $(SRC:.cpp=.o) - - -default: $(LIB) - -ifneq "clean" "$(MAKECMDGOALS)" --include deps.mk -endif - -deps.mk: $(SRC) - $(CC) -MM $^ > $@ - -%.o: %.cpp %.h - $(CC) $(CFLAGS) -c $< -o $@ - -$(LIB): $(OBJ) - ar rcs $@ $^ - -clean: - rm -f $(OBJ) $(LIB) deps.mk -- cgit v1.2.3