comparison mupdf-source/thirdparty/gumbo-parser/Makefile.am @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 # Googletest magic. Gumbo relies on Googletest for its unittests, and
2 # Googletest (by design) does not provide a "make install" option. Instead,
3 # we'll assume you copy (or symlink) the Googletest distribution into a 'gtest'
4 # directory inside the main library directory, and then provide rules to build
5 # it automatically. This approach (and these rules) are copied from the
6 # protobuf distribution.
7
8 ACLOCAL_AMFLAGS = -I m4
9
10 if !HAVE_SHARED_LIBGTEST
11
12 # Build gtest before we build protobuf tests.  We don't add gtest to SUBDIRS
13 # because then "make check" would also build and run all of gtest's own tests,
14 # which takes a lot of time and is generally not useful to us.  Also, we don't
15 # want "make install" to recurse into gtest since we don't want to overwrite
16 # the installed version of gtest if there is one.
17 check-local: gtest/lib/libgtest.la gtest/lib/libgtest_main.la
18
19 gtest/lib/libgtest.la gtest/lib/libgtest_main.la: gtest/Makefile
20 @echo "Making lib/libgtest.a lib/libgtest_main.a in gtest"
21 @cd gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
22
23 gtest/Makefile: gtest/configure
24 @cd gtest && ./configure
25
26 # We would like to clean gtest when "make clean" is invoked.  But we have to
27 # be careful because clean-local is also invoked during "make distclean", but
28 # "make distclean" already recurses into gtest because it's listed among the
29 # DIST_SUBDIRS.  distclean will delete gtest/Makefile, so if we then try to
30 # cd to the directory again and "make clean" it will fail.  So, check that the
31 # Makefile exists before recursing.
32 clean-local:
33 @if test -e gtest/Makefile; then \
34 echo "Making clean in gtest"; \
35 cd gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \
36 fi
37
38 endif !HAVE_SHARED_LIBGTEST
39
40 gentags: src/tag.in
41 @python gentags.py $<
42 @gperf -LANSI-C --ignore-case -m200 $< |python genperf.py >src/tag_gperf.h
43
44 lib_LTLIBRARIES = libgumbo.la
45 libgumbo_la_CFLAGS = -Wall
46 libgumbo_la_LDFLAGS = -version-info 1:0:0 -no-undefined
47 libgumbo_la_SOURCES = \
48 src/attribute.c \
49 src/attribute.h \
50 src/char_ref.c \
51 src/char_ref.h \
52 src/error.c \
53 src/error.h \
54 src/insertion_mode.h \
55 src/parser.c \
56 src/parser.h \
57 src/string_buffer.c \
58 src/string_buffer.h \
59 src/string_piece.c \
60 src/string_piece.h \
61 src/tag.c \
62 src/tag_enum.h \
63 src/tag_gperf.h \
64 src/tag_strings.h \
65 src/tag_sizes.h \
66 src/token_type.h \
67 src/tokenizer.c \
68 src/tokenizer.h \
69 src/tokenizer_states.h \
70 src/utf8.c \
71 src/utf8.h \
72 src/util.c \
73 src/util.h \
74 src/vector.c \
75 src/vector.h
76 include_HEADERS = src/gumbo.h src/tag_enum.h
77
78 pkgconfigdir = $(libdir)/pkgconfig
79 pkgconfig_DATA = gumbo.pc
80
81 check_PROGRAMS = gumbo_test
82 TESTS = gumbo_test
83 gumbo_test_CPPFLAGS = \
84 -I"$(srcdir)/." \
85 -I"$(srcdir)/src" \
86 -I"$(srcdir)/gtest/include"
87 gumbo_test_SOURCES = \
88 tests/attribute.cc \
89 tests/char_ref.cc \
90 tests/parser.cc \
91 tests/string_buffer.cc \
92 tests/string_piece.cc \
93 tests/tokenizer.cc \
94 tests/test_utils.cc \
95 tests/utf8.cc \
96 tests/vector.cc
97 gumbo_test_DEPENDENCIES = libgumbo.la
98 gumbo_test_LDADD = libgumbo.la
99
100 if HAVE_SHARED_LIBGTEST
101 # FIXME(bnoordhuis) Should be configurable by the user.
102 gumbo_test_LDADD += -lgtest -lgtest_main
103 else
104 gumbo_test_DEPENDENCIES += check-local
105 gumbo_test_LDADD += gtest/lib/libgtest.la gtest/lib/libgtest_main.la
106 endif
107
108 noinst_PROGRAMS = clean_text find_links get_title positions_of_class benchmark serialize prettyprint
109 LDADD = libgumbo.la
110 AM_CPPFLAGS = -I"$(srcdir)/src"
111
112 clean_text_SOURCES = examples/clean_text.cc
113 find_links_SOURCES = examples/find_links.cc
114 get_title_SOURCES = examples/get_title.c
115 positions_of_class_SOURCES = examples/positions_of_class.cc
116 benchmark_SOURCES = benchmarks/benchmark.cc
117 serialize_SOURCES = examples/serialize.cc
118 prettyprint_SOURCES = examples/prettyprint.cc