• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# © 2019 and later: Unicode, Inc. and others.
2# License & terms of use: http://www.unicode.org/copyright.html
3#******************************************************************************
4## Makefile.in for ICU - test/fuzzer
5
6## Source directory information
7srcdir = @srcdir@
8top_srcdir = @top_srcdir@
9
10top_builddir = ../..
11
12## All the flags and other definitions are included here.
13include $(top_builddir)/icudefs.mk
14
15## Build directory information
16subdir = test/fuzzer
17
18## Extra files to remove for 'make clean'
19CLEANFILES = *~ $(DEPS) $(TESTXML)
20
21## Target information
22TARGET = all_fuzzers
23
24BUILDDIR := $(CURR_SRCCODE_FULL_DIR)/../../
25# Simplify the path for Unix
26BUILDDIR := $(BUILDDIR:test/fuzzer/../../=)
27# Simplify the path for Windows
28BUILDDIR := $(BUILDDIR:test\\fuzzer/../../=)
29# Simplify the path for Windows 98
30BUILDDIR := $(BUILDDIR:TEST\\FUZZER/../../=)
31
32CPPFLAGS += -I$(srcdir) -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/ctestfw -I$(top_srcdir)/io
33DEFS += -D'U_TOPSRCDIR="$(top_srcdir)/"' -D'U_TOPBUILDDIR="$(BUILDDIR)"'
34LIBS = $(LIBCTESTFW) $(LIBICUTOOLUTIL) $(LIBICUIO) $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) $(LIB_M)
35
36FUZZER_TARGETS = break_iterator_fuzzer collator_compare_fuzzer collator_rulebased_fuzzer converter_fuzzer locale_fuzzer number_format_fuzzer ucasemap_fuzzer uloc_canonicalize_fuzzer uloc_for_language_tag_fuzzer uloc_get_name_fuzzer uloc_is_right_to_left_fuzzer uloc_open_keywords_fuzzer unicode_string_codepage_create_fuzzer uregex_open_fuzzer
37
38OBJECTS = $(FUZZER_TARGETS:%=%.o)
39OBJECTS += fuzzer_driver.o locale_util.o
40
41DEPS = $(OBJECTS:.o=.d)
42
43-include Makefile.local
44
45## List of phony targets
46.PHONY : all all-local install install-local clean clean-local	\
47distclean distclean-local dist dist-local check check-local xcheck	\
48check-exhaustive check-exhaustive-local all_fuzzers
49
50## Clear suffix list
51.SUFFIXES :
52
53## List of standard targets
54all: all-local
55install: install-local
56clean: clean-local
57distclean : distclean-local
58dist: dist-local
59check: all check-local
60xcheck: all xcheck-local
61
62all-local: $(TARGET)
63
64install-local:
65
66dist-local:
67
68clean-local:
69	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
70	$(RMV) $(OBJECTS) $(TARGET) $(FUZZER_TARGETS)
71
72distclean-local: clean-local
73	$(RMV) Makefile
74
75check-local: all-local
76	# Create a dummy test case file with content "abc123"
77	echo "abc123" > dummytestcase
78	$(foreach trgt,$(FUZZER_TARGETS), echo $(trgt); $(INVOKE) ./$(trgt) dummytestcase -q \
79            $(TEST_OUTPUT_OPTS) || exit \
80            $(IOTEST_OPTS);)
81
82xcheck-local: check-local
83
84Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
85	cd $(top_builddir) \
86	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
87
88all_fuzzers: $(FUZZER_TARGETS)
89
90%_fuzzer: %_fuzzer.o fuzzer_driver.o locale_util.o
91	$(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
92
93ifeq (,$(MAKECMDGOALS))
94-include $(DEPS)
95else
96ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
97ifneq ($(patsubst %install,,$(MAKECMDGOALS)),)
98-include $(DEPS)
99endif
100endif
101endif
102