mathematical 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,91 @@
1
+ SOURCES = $(shell find src -name '*.c')
2
+ OBJS = $(SOURCES:.c=.o)
3
+ TESTS = $(shell find tests -name '*.c')
4
+ TESTOBJS = $(TESTS:.c=.o)
5
+
6
+ YYPREFIX=mtex2MML_yy
7
+ BISON=bison -y -v
8
+ FLEX=flex -P$(YYPREFIX) -olex.yy.c
9
+
10
+ RM=rm -rf
11
+ INSTALL=install -c
12
+ BINDIR=/usr/local/bin
13
+
14
+ CURRENT_MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
15
+ TEST_DIRECTORY := $(abspath $(dir $(CURRENT_MAKEFILE)))/tests
16
+ CLAR_FIXTURE_PATH := $(TEST_DIRECTORY)/fixtures/
17
+ CFLAGS += -fPIC -Wall -Wextra -Wno-sign-compare -DCLAR_FIXTURE_PATH=\"$(CLAR_FIXTURE_PATH)\" -pedantic -std=gnu99 -iquote inc
18
+
19
+ #### GENERAL ####
20
+
21
+ all: clean src/y.tab.o src/lex.yy.o libmtex2MML.a mtex2MML
22
+
23
+ .PHONY: clean
24
+ clean:
25
+ $(RM) build
26
+ $(RM) src/lex.yy.*
27
+ $(RM) src/*y.*
28
+ $(RM) src/*.o
29
+ $(RM) src/*.orig
30
+ $(RM) tests/*.o
31
+ $(RM) tests/.clarcache
32
+ $(RM) tests/clar.suite
33
+
34
+ src/y.tab.c:
35
+ $(BISON) -p $(YYPREFIX) -d src/mtex2MML.y
36
+ mv y.output src
37
+ mv y.tab.c src
38
+ mv y.tab.h src
39
+
40
+ src/lex.yy.c:
41
+ $(FLEX) src/mtex2MML.l
42
+ mv lex.yy.c src
43
+
44
+ src/y.tab.o: src/y.tab.c
45
+ $(CC) $(CFLAGS) -c -o src/y.tab.o src/y.tab.c
46
+
47
+ src/lex.yy.o: src/lex.yy.c src/y.tab.c
48
+ $(CC) $(CFLAGS) -c -o src/lex.yy.o src/lex.yy.c
49
+
50
+ libmtex2MML.a: $(OBJS)
51
+ $(AR) crv libmtex2MML.a $(OBJS)
52
+ mkdir -p build/
53
+ mv libmtex2MML.a build/
54
+ cp src/mtex2MML.h build/
55
+
56
+ mtex2MML: $(OBJS) src/mtex2MML.h
57
+ $(CC) $(CFLAGS) -o mtex2MML $(OBJS)
58
+ mv mtex2MML build/
59
+
60
+ install: mtex2MML
61
+ $(INSTALL) build/mtex2MML $(BINDIR)
62
+
63
+ #### TESTS #####
64
+
65
+ .PHONY: test
66
+ test: mathjax compile_test
67
+ ./tests/testrunner
68
+ cat ./tests/mathjax_summary.txt
69
+
70
+ compile_test: clar.suite tests/helpers.h tests/clar_test.h $(TESTOBJS)
71
+ $(CC) $(CFLAGS) -Wno-implicit-function-declaration $(TESTOBJS) build/libmtex2MML.a -o tests/testrunner
72
+
73
+ mathjax:
74
+ python tests/mathjax_generate.py
75
+
76
+ clar.suite:
77
+ python tests/generate.py tests/
78
+
79
+ #### OTHER ####
80
+
81
+ .PHONY: format
82
+ format:
83
+ astyle --indent=spaces=2 --style=1tbs --keep-one-line-blocks $(SOURCES) $(TESTS)
84
+
85
+ .PHONY: debug
86
+ debug:
87
+ $(CC) tests/debug/mtex2MML_debug.c -o tests/debug/mtex2MML
88
+
89
+ .PHONY: leakcheck
90
+ leakcheck:
91
+ valgrind --leak-check=full --dsymutil=yes --error-exitcode=1 ./tests/testrunner >/dev/null
@@ -1,7 +1,7 @@
1
1
  #ifndef MTEX2MML_H
2
2
  #define MTEX2MML_H
3
3
 
4
- #define MTEX2MML_VERSION "1.0.0"
4
+ #define MTEX2MML_VERSION "1.0.1"
5
5
 
6
6
  #ifdef __cplusplus
7
7
  extern "C" {