1# $Id: Makefile.am 22409 2008-01-12 05:53:37Z lha $ 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 10libroken_la_LDFLAGS = -version-info 19:0:1 11libroken_la_CPPFLAGS = -DBUILD_ROKEN_LIB 12 13# XXX this is needed for the LIBOBJS objects 14CPPFLAGS = $(libroken_la_CPPFLAGS) 15 16noinst_PROGRAMS = make-roken snprintf-test resolve-test 17 18nodist_make_roken_SOURCES = make-roken.c 19 20check_PROGRAMS = \ 21 base64-test \ 22 getaddrinfo-test \ 23 hex-test \ 24 test-readenv \ 25 parse_bytes-test \ 26 parse_reply-test \ 27 parse_time-test \ 28 snprintf-test \ 29 strpftime-test 30 31TESTS = $(check_PROGRAMS) 32 33LDADD = libroken.la $(LIB_crypt) 34make_roken_LDADD = 35 36noinst_LTLIBRARIES = libtest.la 37libtest_la_SOURCES = strftime.c strptime.c snprintf.c 38libtest_la_CFLAGS = -DTEST_SNPRINTF -DTEST_STRPFTIME 39 40parse_reply_test_SOURCES = parse_reply-test.c resolve.c 41parse_reply_test_CFLAGS = -DTEST_RESOLVE 42 43test_readenv_SOURCES = test-readenv.c test-mem.c 44 45parse_time_test_SOURCES = parse_time-test.c test-mem.c 46 47strpftime_test_SOURCES = strpftime-test.c strpftime-test.h 48strpftime_test_LDADD = libtest.la $(LDADD) 49strpftime_test_CFLAGS = -DTEST_STRPFTIME 50snprintf_test_SOURCES = snprintf-test.c snprintf-test.h 51snprintf_test_LDADD = libtest.la $(LDADD) 52snprintf_test_CFLAGS = -DTEST_SNPRINTF 53 54resolve_test_SOURCES = resolve-test.c 55 56libroken_la_SOURCES = \ 57 base64.c \ 58 bswap.c \ 59 concat.c \ 60 dumpdata.c \ 61 environment.c \ 62 eread.c \ 63 esetenv.c \ 64 ewrite.c \ 65 getaddrinfo_hostspec.c \ 66 get_default_username.c \ 67 get_window_size.c \ 68 getarg.c \ 69 getnameinfo_verified.c \ 70 getprogname.c \ 71 h_errno.c \ 72 hex.c \ 73 hostent_find_fqdn.c \ 74 issuid.c \ 75 k_getpwnam.c \ 76 k_getpwuid.c \ 77 mini_inetd.c \ 78 net_read.c \ 79 net_write.c \ 80 parse_bytes.c \ 81 parse_time.c \ 82 parse_units.c \ 83 realloc.c \ 84 resolve.c \ 85 roken_gethostby.c \ 86 rtbl.c \ 87 rtbl.h \ 88 setprogname.c \ 89 signal.c \ 90 simple_exec.c \ 91 snprintf.c \ 92 socket.c \ 93 strcollect.c \ 94 strpool.c \ 95 timeval.c \ 96 tm2time.c \ 97 unvis.c \ 98 verify.c \ 99 vis.c \ 100 vis.h \ 101 warnerr.c \ 102 write_pid.c \ 103 xdbm.h 104 105EXTRA_libroken_la_SOURCES = \ 106 err.hin \ 107 glob.hin \ 108 fnmatch.hin \ 109 ifaddrs.hin \ 110 vis.hin 111 112libroken_la_LIBADD = @LTLIBOBJS@ 113 114$(LTLIBOBJS) $(libroken_la_OBJECTS): roken.h $(XHEADERS) 115 116BUILT_SOURCES = make-roken.c roken.h 117 118if have_err_h 119err_h = 120else 121err_h = err.h 122endif 123 124if have_fnmatch_h 125fnmatch_h = 126else 127fnmatch_h = fnmatch.h 128endif 129 130if have_glob_h 131glob_h = 132else 133glob_h = glob.h 134endif 135 136if have_ifaddrs_h 137ifaddrs_h = 138else 139ifaddrs_h = ifaddrs.h 140endif 141 142if have_vis_h 143vis_h = 144else 145vis_h = vis.h 146endif 147 148## these are controlled by configure 149XHEADERS = $(err_h) $(fnmatch_h) $(glob_h) $(ifaddrs_h) $(vis_h) 150CLEANFILES += err.h fnmatch.h glob.h ifaddrs.h vis.h 151 152dist_include_HEADERS = \ 153 base64.h \ 154 getarg.h \ 155 hex.h \ 156 parse_bytes.h \ 157 parse_time.h \ 158 parse_units.h \ 159 resolve.h \ 160 roken-common.h \ 161 rtbl.h \ 162 xdbm.h 163 164if have_socket_wrapper 165libroken_la_SOURCES += socket_wrapper.c socket_wrapper.h 166dist_include_HEADERS += socket_wrapper.h 167endif 168 169build_HEADERZ = test-mem.h $(XHEADERS) 170 171nodist_include_HEADERS = roken.h 172rokenincludedir = $(includedir)/roken 173nodist_rokeninclude_HEADERS = $(XHEADERS) 174 175man_MANS = getarg.3 parse_time.3 rtbl.3 ecalloc.3 176 177SUFFIXES += .hin 178.hin.h: 179 cp $< $@ 180 181roken.h: make-roken$(EXEEXT) 182 @./make-roken$(EXEEXT) > tmp.h ;\ 183 if [ -f roken.h ] && cmp -s tmp.h roken.h ; then rm -f tmp.h ; \ 184 else rm -f roken.h; mv tmp.h roken.h; fi 185 186make-roken.c: roken.h.in roken.awk 187 $(AWK) -f $(srcdir)/roken.awk $(srcdir)/roken.h.in > make-roken.c 188 189EXTRA_DIST = \ 190 roken.awk roken.h.in \ 191 $(man_MANS) \ 192 test-mem.h \ 193 ndbm_wrap.c \ 194 ndbm_wrap.h 195