summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2017-08-28 19:38:02 +0800
committerWill Estes <westes575@gmail.com>2017-08-31 15:54:02 -0400
commitdd1afa37e110563cfc25cf5703ae6288691c0657 (patch)
treecfc9297bb628720c58c195459c0fe870ab2132d1
parentb84ad149c90483d3bfe9f64dd7bfbfad3550116d (diff)
build: Add convenience targets to build libfl only
These are wrappers around automake- and libtool-generated targets, allowing users to build libfl only, without the main flex program. See GH-256 for discussion. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
-rw-r--r--Makefile.am26
1 files changed, 25 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 638c549..b3b0810 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,6 +49,29 @@ SUBDIRS = \
tests \
tools
+# Convenience targets to build libfl only
+# These are actually wrappers around automake- and libtool-generated targets
+
+libfl:
+ cd src && $(MAKE) $(AM_MAKEFLAGS) libfl.la libfl.pc
+
+install-libfl:
+ cd src && \
+ $(MAKE) $(AM_MAKEFLAGS) lib_LTLIBRARIES=libfl.la \
+ pkgconfig_DATA=libfl.pc install-libLTLIBRARIES install-pkgconfigDATA
+
+uninstall-libfl:
+ cd src && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ lib_LTLIBRARIES=libfl.la pkgconfig_DATA=libfl.pc \
+ uninstall-libLTLIBRARIES uninstall-pkgconfigDATA
+
+# libfl.pc is cleaned via 'distclean' target
+clean-libfl:
+ cd src && \
+ $(MAKE) $(AM_MAKEFLAGS) lib_LTLIBRARIES=libfl.la clean-libLTLIBRARIES \
+ clean-libtool
+
# Create the ChangeLog, but only if we're inside a git working directory
ChangeLog: $(srcdir)/tools/git2cl
@@ -63,4 +86,5 @@ install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT)
-.PHONY: ChangeLog indent
+.PHONY: libfl install-libfl uninstall-libfl clean-libfl \
+ ChangeLog indent