| 1 |
|
| 2 |
# smartcols.h is generated, so it's stored in builddir! |
| 3 |
smartcolsincdir = $(includedir)/libsmartcols |
| 4 |
nodist_smartcolsinc_HEADERS = libsmartcols/src/libsmartcols.h |
| 5 |
|
| 6 |
usrlib_exec_LTLIBRARIES += libsmartcols.la |
| 7 |
libsmartcols_la_SOURCES= \ |
| 8 |
include/list.h \ |
| 9 |
\ |
| 10 |
libsmartcols/src/smartcolsP.h \ |
| 11 |
libsmartcols/src/iter.c \ |
| 12 |
libsmartcols/src/symbols.c \ |
| 13 |
libsmartcols/src/cell.c \ |
| 14 |
libsmartcols/src/column.c \ |
| 15 |
libsmartcols/src/line.c \ |
| 16 |
libsmartcols/src/table.c \ |
| 17 |
libsmartcols/src/print.c \ |
| 18 |
libsmartcols/src/print-api.c \ |
| 19 |
libsmartcols/src/version.c \ |
| 20 |
libsmartcols/src/calculate.c \ |
| 21 |
libsmartcols/src/grouping.c \ |
| 22 |
libsmartcols/src/walk.c \ |
| 23 |
libsmartcols/src/init.c \ |
| 24 |
\ |
| 25 |
libsmartcols/src/filter-parser.c \ |
| 26 |
libsmartcols/src/filter-scanner.c \ |
| 27 |
libsmartcols/src/filter-parser.h \ |
| 28 |
libsmartcols/src/filter-scanner.h \ |
| 29 |
\ |
| 30 |
libsmartcols/src/filter.c \ |
| 31 |
libsmartcols/src/filter-param.c \ |
| 32 |
libsmartcols/src/filter-expr.c |
| 33 |
|
| 34 |
BUILT_SOURCES += libsmartcols/src/filter-parser.c \ |
| 35 |
libsmartcols/src/filter-parser.h \ |
| 36 |
libsmartcols/src/filter-scanner.c \ |
| 37 |
libsmartcols/src/filter-scanner.h |
| 38 |
|
| 39 |
EXTRA_DIST += libsmartcols/src/filter-parser.y \ |
| 40 |
libsmartcols/src/filter-scanner.l |
| 41 |
|
| 42 |
## Generate filter parser (YACC) and tokenizer (LEX) .c and .h files. |
| 43 |
# |
| 44 |
# Note that we need advanced bison and flex features and configuration |
| 45 |
# directives to generated thread safe parser (usable in stared library), so |
| 46 |
# it's probably a bad idea to use "-y" (posix compatible) as default in |
| 47 |
# autotools. We also need to generate .c and .h files in the same time to avoid |
| 48 |
# duplicate stuff. |
| 49 |
# |
| 50 |
SCOLS_YACC_BASENAME = libsmartcols/src/filter-parser |
| 51 |
SCOLS_YACC_STEMP = $(SCOLS_YACC_BASENAME).stamp |
| 52 |
|
| 53 |
SCOLS_LEX_BASENAME = libsmartcols/src/filter-scanner |
| 54 |
SCOLS_LEX_STEMP = $(SCOLS_LEX_BASENAME).stamp |
| 55 |
|
| 56 |
|
| 57 |
$(SCOLS_YACC_STEMP): $(SCOLS_YACC_BASENAME).y |
| 58 |
@rm -f $(SCOLS_YACC_STEMP).tmp |
| 59 |
@touch -f $(SCOLS_YACC_STEMP).tmp |
| 60 |
$(AM_V_YACC) $(BISON) $< --output=${basename $@}.c --defines=${basename $@}.h |
| 61 |
@touch -f ${basename $@}.c |
| 62 |
@mv -f $(SCOLS_YACC_STEMP).tmp $@ |
| 63 |
|
| 64 |
$(SCOLS_YACC_BASENAME).c $(SCOLS_YACC_BASENAME).h: $(SCOLS_YACC_STEMP) |
| 65 |
@test -f $@ || rm -f $(SCOLS_YACC_STEMP) |
| 66 |
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(SCOLS_YACC_STEMP) |
| 67 |
|
| 68 |
|
| 69 |
$(SCOLS_LEX_STEMP): $(SCOLS_LEX_BASENAME).l |
| 70 |
@rm -f $(SCOLS_LEX_STEMP).tmp |
| 71 |
@touch -f $(SCOLS_LEX_STEMP).tmp |
| 72 |
$(AM_V_GEN) $(FLEX) --header-file=${basename $@}.h --outfile=${basename $@}.c $< |
| 73 |
@touch -f ${basename $@}.c |
| 74 |
@mv -f $(SCOLS_LEX_STEMP).tmp $@ |
| 75 |
|
| 76 |
$(SCOLS_LEX_BASENAME).c $(SCOLS_LEX_BASENAME).h: $(SCOLS_LEX_STEMP) |
| 77 |
@test -f $@ || rm -f $(SCOLS_LEX_STEMP) |
| 78 |
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $(SCOLS_LEX_STEMP) |
| 79 |
|
| 80 |
# Each part of the parser depends on the header files |
| 81 |
$(SCOLS_LEX_BASENAME).c: $(SCOLS_YACC_BASENAME).h |
| 82 |
$(SCOLS_YACC_BASENAME).c: $(SCOLS_LEX_BASENAME).h |
| 83 |
|
| 84 |
# Don't re-generate parser when use sources from tarball |
| 85 |
EXTRA_DIST += $(SCOLS_YACC_STEMP) $(SCOLS_LEX_STEMP) |
| 86 |
|
| 87 |
|
| 88 |
libsmartcols_la_LIBADD = $(LDADD) libcommon.la |
| 89 |
|
| 90 |
libsmartcols_la_CFLAGS = \ |
| 91 |
$(AM_CFLAGS) \ |
| 92 |
$(SOLIB_CFLAGS) \ |
| 93 |
-I$(ul_libsmartcols_incdir) \ |
| 94 |
-I$(top_srcdir)/libsmartcols/src |
| 95 |
|
| 96 |
EXTRA_libsmartcols_la_DEPENDENCIES = \ |
| 97 |
libsmartcols/src/libsmartcols.sym |
| 98 |
|
| 99 |
libsmartcols_la_LDFLAGS = $(SOLIB_LDFLAGS) |
| 100 |
if HAVE_VSCRIPT |
| 101 |
libsmartcols_la_LDFLAGS += $(VSCRIPT_LDFLAGS),$(top_srcdir)/libsmartcols/src/libsmartcols.sym |
| 102 |
endif |
| 103 |
libsmartcols_la_LDFLAGS += -version-info $(LIBSMARTCOLS_VERSION_INFO) |
| 104 |
|
| 105 |
EXTRA_DIST += \ |
| 106 |
libsmartcols/src/libsmartcols.sym |
| 107 |
|
| 108 |
# move lib from $(usrlib_execdir) to $(libdir) if needed |
| 109 |
install-exec-hook-libsmartcols: |
| 110 |
if test "$(usrlib_execdir)" != "$(libdir)" -a -f "$(DESTDIR)$(usrlib_execdir)/libsmartcols.so"; then \ |
| 111 |
$(MKDIR_P) $(DESTDIR)$(libdir); \ |
| 112 |
mv $(DESTDIR)$(usrlib_execdir)/libsmartcols.so.* $(DESTDIR)$(libdir); \ |
| 113 |
so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libsmartcols.so); \ |
| 114 |
so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \ |
| 115 |
(cd $(DESTDIR)$(usrlib_execdir) && \ |
| 116 |
rm -f libsmartcols.so && \ |
| 117 |
$(LN_S) $$so_img_rel_target$(libdir)/$$so_img_name libsmartcols.so); \ |
| 118 |
fi |
| 119 |
|
| 120 |
uninstall-hook-libsmartcols: |
| 121 |
rm -f $(DESTDIR)$(libdir)/libsmartcols.so* |
| 122 |
|
| 123 |
INSTALL_EXEC_HOOKS += install-exec-hook-libsmartcols |
| 124 |
UNINSTALL_HOOKS += uninstall-hook-libsmartcols |