2 # This is the developer's makefile, not the user's makefile.
3 # Don't use it unless you know exactly what you do!
7 AUTOCONF = autoconf-2.69
8 AUTOHEADER = autoheader-2.69
9 AUTOMAKE = automake-1.15
10 ACLOCAL = aclocal-1.15
14 MAN2HTML = groff -mandoc -Thtml
19 all : srclib/Makefile.gnulib srclib/Makefile.in \
20 configures config.h.in \
21 include/iconv.h.build.in \
22 lib/aliases.h lib/aliases_sysaix.h lib/aliases_syshpux.h lib/aliases_sysosf1.h lib/aliases_syssolaris.h \
23 lib/aliases_aix.h lib/aliases_aix_sysaix.h \
24 lib/aliases_osf1.h lib/aliases_osf1_sysosf1.h \
27 lib/flags.h lib/translit.h \
28 man/iconv.1.html man/iconv.3.html man/iconv_close.3.html man/iconv_open.3.html man/iconvctl.3.html man/iconv_open_into.3.html \
30 cd libcharset && $(MAKE) -f Makefile.devel all
31 cd preload && $(MAKE) -f Makefile.devel all
34 # Before making a new release:
35 # - check that the encoding lists in README and man/iconv_open.3 are up to date,
36 # - check that the files in libcharset/lib/ are in sync with the gnulib modules
37 # 'localcharset' and 'relocatable-lib-lgpl',
38 # - increment the version number in
42 # - update the version info in lib/Makefile.in,
44 # Making a new release:
45 # - $ ./configure CPPFLAGS=-Wall; make; make check
68 srclib/Makefile.gnulib :
69 if test -n "$$GNULIB_TOOL"; then \
70 $$GNULIB_TOOL --lib=libicrt --source-base=srclib --m4-base=srcm4 --makefile-name=Makefile.gnulib --no-libtool --local-dir=gnulib-local --no-vc-files \
71 --import $(GNULIB_MODULES); \
74 srclib/Makefile.in : srclib/Makefile.am srclib/Makefile.gnulib aclocal.m4
75 if test -n "$$GNULIB_TOOL"; then \
76 $$GNULIB_TOOL --copy-file build-aux/ar-lib; \
77 $$GNULIB_TOOL --copy-file build-aux/compile; \
79 # Make sure we get new versions of files brought in by automake.
80 (cd build-aux && rm -f ar-lib compile depcomp install-sh mdate-sh missing test-driver)
81 $(AUTOMAKE) --gnits --add-missing --copy srclib/Makefile && rm -rf autom4te.cache
83 gnulib-imported-files : force
84 if test -n "$$GNULIB_TOOL"; then \
85 for file in config.guess config.sub; do \
86 $$GNULIB_TOOL --copy-file build-aux/$$file || exit $$?; \
87 chmod a+x build-aux/$$file || exit $$?; \
92 CONFIGURES = configure
93 CONFIGURES_IN = configure.ac
95 aclocal.m4 : $(CONFIGURES_IN) srclib/Makefile.gnulib $(wildcard m4/*.m4) $(wildcard srcm4/*.m4)
96 $(ACLOCAL) -I m4 -I srcm4 --output=$@ && touch $@ && rm -rf autom4te.cache
98 configures : $(CONFIGURES)
100 AUTOCONF_FILES = aclocal.m4 $(wildcard m4/*.m4) $(wildcard srcm4/*.m4)
102 configure : configure.ac $(AUTOCONF_FILES)
103 $(AUTOCONF) && rm -rf autom4te.cache
105 check-configures : $(CONFIGURES)
106 set -e; for f in $(CONFIGURES); do bash -x -n $$f; done
108 config.h.in : configure.ac $(AUTOCONF_FILES)
109 $(AUTOHEADER) && rm -rf autom4te.cache
113 include/iconv.h.build.in : include/iconv.h.in include/export.h
114 sed -e 's/extern \([^"]\)/extern LIBICONV_DLL_EXPORTED \1/' \
115 -e '/_LIBICONV_VERSION/r include/export.h' \
119 lib/aliases.h lib/canonical.h lib/canonical_local.h : lib/encodings.def lib/encodings_local.def lib/genaliases.c
120 $(CC) $(CFLAGS) lib/genaliases.c -o genaliases
121 ./genaliases lib/aliases.gperf canonical.sh canonical_local.sh
123 $(GPERF) -m 10 lib/aliases.gperf > tmp.h
124 $(CP) tmp.h lib/aliases.h
125 sh canonical.sh > lib/canonical.h
126 sh canonical_local.sh > lib/canonical_local.h
127 $(RM) tmp.h canonical.sh canonical_local.sh
129 lib/aliases_sysaix.h lib/canonical_sysaix.h lib/canonical_local_sysaix.h : lib/encodings.def lib/encodings_local.def lib/genaliases.c
130 $(CC) $(CFLAGS) -DUSE_AIX_ALIASES lib/genaliases.c -o genaliases
131 ./genaliases lib/aliases_sysaix.gperf canonical.sh canonical_local.sh
133 $(GPERF) -m 10 lib/aliases_sysaix.gperf > tmp.h
134 $(CP) tmp.h lib/aliases_sysaix.h
135 sh canonical.sh > lib/canonical_sysaix.h
136 sh canonical_local.sh > lib/canonical_local_sysaix.h
137 $(RM) tmp.h canonical.sh canonical_local.sh
139 lib/aliases_syshpux.h lib/canonical_syshpux.h lib/canonical_local_syshpux.h : lib/encodings.def lib/encodings_local.def lib/genaliases.c
140 $(CC) $(CFLAGS) -DUSE_HPUX_ALIASES lib/genaliases.c -o genaliases
141 ./genaliases lib/aliases_syshpux.gperf canonical.sh canonical_local.sh
143 $(GPERF) -m 10 lib/aliases_syshpux.gperf > tmp.h
144 $(CP) tmp.h lib/aliases_syshpux.h
145 sh canonical.sh > lib/canonical_syshpux.h
146 sh canonical_local.sh > lib/canonical_local_syshpux.h
147 $(RM) tmp.h canonical.sh canonical_local.sh
149 lib/aliases_sysosf1.h lib/canonical_sysosf1.h lib/canonical_local_sysosf1.h : lib/encodings.def lib/encodings_local.def lib/genaliases.c
150 $(CC) $(CFLAGS) -DUSE_OSF1_ALIASES lib/genaliases.c -o genaliases
151 ./genaliases lib/aliases_sysosf1.gperf canonical.sh canonical_local.sh
153 $(GPERF) -m 10 lib/aliases_sysosf1.gperf > tmp.h
154 $(CP) tmp.h lib/aliases_sysosf1.h
155 sh canonical.sh > lib/canonical_sysosf1.h
156 sh canonical_local.sh > lib/canonical_local_sysosf1.h
157 $(RM) tmp.h canonical.sh canonical_local.sh
159 lib/aliases_syssolaris.h lib/canonical_syssolaris.h lib/canonical_local_syssolaris.h : lib/encodings.def lib/encodings_local.def lib/genaliases.c
160 $(CC) $(CFLAGS) -DUSE_SOLARIS_ALIASES lib/genaliases.c -o genaliases
161 ./genaliases lib/aliases_syssolaris.gperf canonical.sh canonical_local.sh
163 $(GPERF) -m 10 lib/aliases_syssolaris.gperf > tmp.h
164 $(CP) tmp.h lib/aliases_syssolaris.h
165 sh canonical.sh > lib/canonical_syssolaris.h
166 sh canonical_local.sh > lib/canonical_local_syssolaris.h
167 $(RM) tmp.h canonical.sh canonical_local.sh
169 lib/aliases_aix.h lib/canonical_aix.h : lib/encodings_aix.def lib/genaliases2.c
170 $(CC) $(CFLAGS) -DUSE_AIX lib/genaliases2.c -o genaliases
171 ./genaliases aix lib/aliases_aix.h lib/canonical_aix.h
174 lib/aliases_aix_sysaix.h lib/canonical_aix_sysaix.h : lib/encodings_aix.def lib/genaliases2.c
175 $(CC) $(CFLAGS) -DUSE_AIX -DUSE_AIX_ALIASES lib/genaliases2.c -o genaliases
176 ./genaliases aix lib/aliases_aix_sysaix.h lib/canonical_aix_sysaix.h
179 lib/aliases_osf1.h lib/canonical_osf1.h : lib/encodings_osf1.def lib/genaliases2.c
180 $(CC) $(CFLAGS) -DUSE_OSF1 lib/genaliases2.c -o genaliases
181 ./genaliases osf1 lib/aliases_osf1.h lib/canonical_osf1.h
184 lib/aliases_osf1_sysosf1.h lib/canonical_osf1_sysosf1.h : lib/encodings_osf1.def lib/genaliases2.c
185 $(CC) $(CFLAGS) -DUSE_OSF1 -DUSE_OSF1_ALIASES lib/genaliases2.c -o genaliases
186 ./genaliases osf1 lib/aliases_osf1_sysosf1.h lib/canonical_osf1_sysosf1.h
189 lib/aliases_dos.h lib/canonical_dos.h : lib/encodings_dos.def lib/genaliases2.c
190 $(CC) $(CFLAGS) -DUSE_DOS lib/genaliases2.c -o genaliases
191 ./genaliases dos lib/aliases_dos.h lib/canonical_dos.h
194 lib/aliases_extra.h lib/canonical_extra.h : lib/encodings_extra.def lib/genaliases2.c
195 $(CC) $(CFLAGS) -DUSE_EXTRA lib/genaliases2.c -o genaliases
196 ./genaliases extra lib/aliases_extra.h lib/canonical_extra.h
200 lib/flags.h : lib/encodings.def lib/encodings_aix.def lib/encodings_osf1.def lib/encodings_dos.def lib/encodings_extra.def lib/converters.h lib/genflags.c
201 $(CC) $(CFLAGS) lib/genflags.c -o genflags
202 ./genflags > lib/flags.h
206 lib/translit.h : lib/translit.def lib/gentranslit.c
207 $(CC) $(CFLAGS) lib/gentranslit.c -o gentranslit
208 ./gentranslit < lib/translit.def > lib/translit.h
213 $(MAN2HTML) $< > $@-t
214 grep -v '<!-- CreationDate' < $@-t > $@
219 # Move srclib/Makefile.gnulib away, so that the target 'srclib/Makefile.gnulib' will actually do something.
220 if test -f srclib/Makefile.gnulib; then \
221 mv srclib/Makefile.gnulib srclib/Makefile.gnulib~; \
223 # No need to remove the stale files. gnulib-tool does this itself, thanks to srcm4/gnulib-comp.m4.
224 # find srclib '(' -name '*.h' -o -name '*.c' -o -name '*.valgrind' ')' -exec rm -f '{}' ';'
227 totally-clean : force
228 rm -f srclib/Makefile.in
229 rm -f aclocal.m4 $(CONFIGURES) config.h.in include/iconv.h.build.in
230 rm -f lib/aliases.gperf lib/aliases_sysaix.gperf lib/aliases_syshpux.gperf lib/aliases_sysosf1.gperf lib/aliases_syssolaris.gperf
231 rm -f lib/aliases.h lib/aliases_sysaix.h lib/aliases_syshpux.h lib/aliases_sysosf1.h lib/aliases_syssolaris.h
232 rm -f lib/aliases_aix.h lib/aliases_aix_sysaix.h
233 rm -f lib/aliases_osf1.h lib/aliases_osf1_sysosf1.h
234 rm -f lib/aliases_dos.h
235 rm -f lib/aliases_extra.h
236 rm -f lib/canonical.h lib/canonical_sysaix.h lib/canonical_syshpux.h lib/canonical_sysosf1.h lib/canonical_syssolaris.h
237 rm -f lib/canonical_aix.h lib/canonical_aix_sysaix.h
238 rm -f lib/canonical_osf1.h lib/canonical_osf1_sysosf1.h
239 rm -f lib/canonical_dos.h
240 rm -f lib/canonical_extra.h
241 rm -f lib/canonical_local.h lib/canonical_local_sysaix.h lib/canonical_local_syshpux.h lib/canonical_local_sysosf1.h lib/canonical_local_syssolaris.h
244 rm -f man/iconv.1.html man/iconv.3.html man/iconv_close.3.html man/iconv_open.3.html man/iconvctl.3.html man/iconv_open_into.3.html
245 cd libcharset && $(MAKE) -f Makefile.devel totally-clean
246 cd preload && $(MAKE) -f Makefile.devel totally-clean