-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
40 lines (30 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.PHONY: test
CXXFLAGS:=-std=c++11 -fPIC -I include -I libs/gherkin-c/include -I libs/gherkin-c/src -I libs/fmem/build/gen
lib:
@make lib-static
@make lib-shared
lib-static: gherkin-c fmem
$(CXX) $(CXXFLAGS) -c src/parser.cpp -o p.o
$(CXX) $(CXXFLAGS) -c src/compiler.cpp -o c.o
ar x libs/gherkin-c/libs/libgherkin.a
ar x libs/fmem/build/libfmem.a
ar rvs libgherkin-cpp.a *.o
lib-shared:
$(CXX) $(CXXFLAGS) -fPIC -shared -o libgherkin-cpp.so *.o
gherkin-c:
cd libs/gherkin-c && make libs
fmem:
@-rm -rf libs/fmem/build
cd libs/fmem && mkdir build && cd build && LDFLAGS="-fPIC" CFLAGS="-fPIC" cmake .. -DBUILD_TESTING=0 && make
test:
$(CXX) $(CXXFLAGS) test/main.cpp libgherkin-cpp.a -o test.out
make `find test/testdata -iname "*.feature" | xargs -I% echo %.test`
%.feature.test:
@valgrind --leak-check=full --error-exitcode=-1 ./test.out $*.feature > $*.feature.tmp
diff $*.feature.out $*.feature.tmp
@rm -f $*.feature.tmp
test/testdata/good/i18n_fr.feature.test:
@
clean:
rm -f *.o *.a *.so *.out
rm -rf libs/fmem/build