• 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 = \
37		 break_iterator_fuzzer \
38		 calendar_fuzzer collator_compare_fuzzer \
39		 collator_rulebased_fuzzer \
40		 converter_fuzzer date_format_fuzzer \
41		 date_time_pattern_generator_fuzzer \
42		 dtfmtsym_fuzzer \
43		 list_format_fuzzer locale_fuzzer \
44		 locale_morph_fuzzer \
45		 normalizer2_fuzzer \
46		 number_format_fuzzer \
47		 number_formatter_fuzzer \
48		 plurrule_fuzzer \
49		 relative_date_time_formatter_fuzzer \
50		 rule_based_break_iterator_fuzzer \
51		 timezone_create_fuzzer \
52		 time_zone_names_fuzzer \
53		 ucasemap_fuzzer \
54		 uloc_canonicalize_fuzzer \
55		 uloc_for_language_tag_fuzzer \
56		 uloc_get_name_fuzzer \
57		 uloc_is_right_to_left_fuzzer \
58		 uloc_open_keywords_fuzzer \
59		 unicodeset_fuzzer \
60		 unicode_string_codepage_create_fuzzer \
61		 uprop_fuzzer \
62		 uregex_open_fuzzer \
63
64
65OBJECTS = $(FUZZER_TARGETS:%=%.o)
66OBJECTS += fuzzer_driver.o locale_util.o
67
68DEPS = $(OBJECTS:.o=.d)
69
70-include Makefile.local
71
72## List of phony targets
73.PHONY : all all-local install install-local clean clean-local	\
74distclean distclean-local dist dist-local check check-local xcheck	\
75check-exhaustive check-exhaustive-local all_fuzzers
76
77## Clear suffix list
78.SUFFIXES :
79
80## List of standard targets
81all: all-local
82install: install-local
83clean: clean-local
84distclean : distclean-local
85dist: dist-local
86check: all check-local
87xcheck: all xcheck-local
88
89all-local: $(TARGET)
90
91install-local:
92
93dist-local:
94
95clean-local:
96	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
97	$(RMV) $(OBJECTS) $(TARGET) $(FUZZER_TARGETS)
98
99distclean-local: clean-local
100	$(RMV) Makefile
101
102check-local: all-local
103	# Create a dummy test case file with content "abc123"
104	echo "abc123" > dummytestcase
105	$(foreach trgt,$(FUZZER_TARGETS), echo $(trgt); $(INVOKE) ./$(trgt) dummytestcase -q \
106            $(TEST_OUTPUT_OPTS) || exit \
107            $(IOTEST_OPTS);)
108
109xcheck-local: check-local
110
111Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
112	cd $(top_builddir) \
113	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
114
115all_fuzzers: $(FUZZER_TARGETS)
116
117%_fuzzer: %_fuzzer.o fuzzer_driver.o locale_util.o
118	$(LINK.cc) $(OUTOPT)$@ $^ $(LIBS)
119
120ifeq (,$(MAKECMDGOALS))
121-include $(DEPS)
122else
123ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)
124ifneq ($(patsubst %install,,$(MAKECMDGOALS)),)
125-include $(DEPS)
126endif
127endif
128endif
129