1# $Id$ 2 3include $(top_srcdir)/Makefile.am.common 4 5ACLOCAL_AMFLAGS = -I ../../cf 6 7CLEANFILES = roken.h make-roken.c $(XHEADERS) 8 9lib_LTLIBRARIES = libroken.la 10 11libroken_la_LDFLAGS = -version-info 19:0:1 12libroken_la_CPPFLAGS = -DBUILD_ROKEN_LIB 13 14if versionscript 15libroken_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map 16endif 17 18AM_CPPFLAGS += $(libroken_la_CPPFLAGS) 19if HAVE_DBHEADER 20AM_CPPFLAGS += -I$(DBHEADER) 21endif 22 23noinst_PROGRAMS = snprintf-test resolve-test rkpty 24 25check_PROGRAMS = \ 26 base64-test \ 27 getaddrinfo-test \ 28 getifaddrs-test \ 29 hex-test \ 30 test-readenv \ 31 parse_bytes-test \ 32 parse_reply-test \ 33 parse_time-test \ 34 snprintf-test \ 35 strpftime-test \ 36 tsearch-test 37 38TESTS = $(check_PROGRAMS) 39 40LDADD = libroken.la 41make_roken_LDADD = 42 43noinst_LTLIBRARIES = libtest.la 44libtest_la_SOURCES = strftime.c strptime.c snprintf.c tsearch.c 45libtest_la_CFLAGS = -DTEST_SNPRINTF -DTEST_STRPFTIME 46 47parse_reply_test_SOURCES = parse_reply-test.c resolve.c 48parse_reply_test_CFLAGS = -DTEST_RESOLVE 49 50test_readenv_SOURCES = test-readenv.c test-mem.c 51 52rkpty_LDADD = $(LIB_openpty) $(LDADD) 53 54parse_time_test_SOURCES = parse_time-test.c test-mem.c 55 56strpftime_test_SOURCES = strpftime-test.c strpftime-test.h 57strpftime_test_LDADD = libtest.la $(LDADD) 58strpftime_test_CFLAGS = -DTEST_STRPFTIME 59snprintf_test_SOURCES = snprintf-test.c 60snprintf_test_LDADD = libtest.la $(LDADD) 61snprintf_test_CFLAGS = -DTEST_SNPRINTF 62tsearch_test_SOURCES = tsearch-test.c 63tsearch_test_LDADD = libtest.la $(LDADD) 64tsearch_test_CFLAGS = -DTEST_TSEARCH 65 66resolve_test_SOURCES = resolve-test.c 67 68libroken_la_SOURCES = \ 69 base64.c \ 70 bswap.c \ 71 concat.c \ 72 cloexec.c \ 73 ct.c \ 74 doxygen.c \ 75 dumpdata.c \ 76 environment.c \ 77 eread.c \ 78 esetenv.c \ 79 ewrite.c \ 80 getaddrinfo_hostspec.c \ 81 get_default_username.c \ 82 get_window_size.c \ 83 getarg.c \ 84 getnameinfo_verified.c \ 85 getprogname.c \ 86 h_errno.c \ 87 hex.c \ 88 hostent_find_fqdn.c \ 89 issuid.c \ 90 k_getpwnam.c \ 91 k_getpwuid.c \ 92 mini_inetd.c \ 93 net_read.c \ 94 net_write.c \ 95 parse_bytes.c \ 96 parse_time.c \ 97 parse_units.c \ 98 qsort.c \ 99 rand.c \ 100 realloc.c \ 101 resolve.c \ 102 roken_gethostby.c \ 103 rtbl.c \ 104 rtbl.h \ 105 setprogname.c \ 106 signal.c \ 107 simple_exec.c \ 108 snprintf.c \ 109 socket.c \ 110 strcollect.c \ 111 strerror_r.c \ 112 strpool.c \ 113 timeval.c \ 114 tm2time.c \ 115 unvis.c \ 116 verify.c \ 117 vis.c \ 118 warnerr.c \ 119 write_pid.c \ 120 xfree.c \ 121 xdbm.h 122 123EXTRA_libroken_la_SOURCES = \ 124 err.hin \ 125 glob.hin \ 126 fnmatch.hin \ 127 ifaddrs.hin \ 128 search.hin \ 129 vis.hin 130 131libroken_la_LIBADD = @LTLIBOBJS@ $(LIB_crypt) 132 133$(LTLIBOBJS) $(libroken_la_OBJECTS): roken.h $(XHEADERS) 134 135BUILT_SOURCES = roken.h 136 137if have_err_h 138err_h = 139else 140err_h = err.h 141endif 142 143if have_fnmatch_h 144fnmatch_h = 145else 146fnmatch_h = fnmatch.h 147endif 148 149if have_glob_h 150glob_h = 151else 152glob_h = glob.h 153endif 154 155if have_ifaddrs_h 156ifaddrs_h = 157else 158ifaddrs_h = ifaddrs.h 159endif 160 161if have_search_h 162search_h = 163else 164search_h = search.h 165endif 166 167if have_vis_h 168vis_h = 169else 170vis_h = vis.h 171endif 172 173## these are controlled by configure 174XHEADERS = $(err_h) $(fnmatch_h) $(glob_h) $(ifaddrs_h) $(search_h) $(vis_h) 175CLEANFILES += err.h fnmatch.h glob.h ifaddrs.h search.h vis.h 176 177dist_include_HEADERS = \ 178 base64.h \ 179 getarg.h \ 180 hex.h \ 181 parse_bytes.h \ 182 parse_time.h \ 183 parse_units.h \ 184 resolve.h \ 185 roken-common.h \ 186 rtbl.h \ 187 xdbm.h 188 189if have_socket_wrapper 190libroken_la_SOURCES += socket_wrapper.c socket_wrapper.h 191dist_include_HEADERS += socket_wrapper.h 192endif 193 194build_HEADERZ = test-mem.h $(XHEADERS) 195 196nodist_include_HEADERS = roken.h 197rokenincludedir = $(includedir)/roken 198nodist_rokeninclude_HEADERS = $(XHEADERS) 199 200man_MANS = getarg.3 parse_time.3 rtbl.3 ecalloc.3 201 202SUFFIXES += .hin 203.hin.h: 204 cp $< $@ 205 206# Make make-roken deprecated in 1.4 when we know that roken-h-process.pl works 207if !CROSS_COMPILE 208 209noinst_PROGRAMS += make-roken 210BUILT_SOURCES += make-roken.c 211 212nodist_make_roken_SOURCES = make-roken.c 213 214roken.h: make-roken$(EXEEXT) 215 @./make-roken$(EXEEXT) > tmp.h ;\ 216 if [ -f roken.h ] && cmp -s tmp.h roken.h ; then rm -f tmp.h ; \ 217 else rm -f roken.h; mv tmp.h roken.h; fi 218 219make-roken.c: roken.h.in roken.awk 220 $(AWK) -f $(srcdir)/roken.awk $(srcdir)/roken.h.in > make-roken.c 221 222else 223 224roken.h: $(top_srcdir)/cf/roken-h-process.pl roken.h.in 225 perl $(top_srcdir)/cf/roken-h-process.pl \ 226 -c $(top_builddir)/include/config.h \ 227 -p $(srcdir)/roken.h.in -o roken.h 228 229endif 230 231 232EXTRA_DIST = \ 233 NTMakefile \ 234 roken.awk roken.h.in \ 235 $(man_MANS) \ 236 test-mem.h \ 237 ndbm_wrap.c \ 238 ndbm_wrap.h \ 239 version-script.map 240