kmod/Makefile.am

201 lines
6.1 KiB
Makefile
Raw Normal View History

2012-01-12 20:48:21 +07:00
SUBDIRS = . libkmod/docs man
DISTCLEAN_LOCAL_HOOKS =
EXTRA_DIST =
CLEANFILES =
2011-11-21 21:35:15 +07:00
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
2011-11-21 23:35:35 +07:00
-I$(top_srcdir)/libkmod \
-DROOTPREFIX=\""$(rootprefix)"\" \
2011-11-21 21:35:15 +07:00
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
${zlib_CFLAGS}
2011-11-21 21:35:15 +07:00
AM_CFLAGS = \
-fvisibility=hidden \
-ffunction-sections \
-fdata-sections
AM_LDFLAGS = \
-Wl,--gc-sections \
-Wl,--as-needed
SED_PROCESS = \
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
-e 's,@VERSION\@,$(VERSION),g' \
-e 's,@prefix\@,$(prefix),g' \
-e 's,@exec_prefix\@,$(exec_prefix),g' \
-e 's,@libdir\@,$(libdir),g' \
-e 's,@includedir\@,$(includedir),g' \
-e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \
-e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
-e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
-e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
< $< > $@ || rm $@
%.pc: %.pc.in Makefile
$(SED_PROCESS)
2012-01-17 01:53:04 +07:00
LIBKMOD_CURRENT=4
2011-11-21 23:35:35 +07:00
LIBKMOD_REVISION=0
2012-01-17 01:53:04 +07:00
LIBKMOD_AGE=3
2011-11-21 21:35:15 +07:00
noinst_LTLIBRARIES = libkmod/libkmod-util.la
libkmod_libkmod_util_la_SOURCES = libkmod/libkmod-hash.c \
libkmod/libkmod-hash.h \
libkmod/libkmod-array.c \
libkmod/libkmod-array.h \
libkmod/libkmod-util.c \
libkmod/libkmod-util.h
2011-11-21 23:35:35 +07:00
include_HEADERS = libkmod/libkmod.h
lib_LTLIBRARIES = libkmod/libkmod.la
2011-11-21 21:35:15 +07:00
2011-11-21 23:35:35 +07:00
libkmod_libkmod_la_SOURCES =\
libkmod/libkmod.h \
libkmod/libkmod-private.h \
2011-11-23 21:23:46 +07:00
libkmod/macro.h \
2011-11-22 14:38:28 +07:00
libkmod/libkmod.c \
libkmod/libkmod-list.c \
libkmod/libkmod-config.c \
libkmod/libkmod-index.c \
libkmod/libkmod-index.h \
2011-12-17 01:08:53 +07:00
libkmod/libkmod-module.c \
libkmod/libkmod-file.c \
libkmod/libkmod-elf.c
2011-11-21 21:35:15 +07:00
2011-11-21 23:35:35 +07:00
EXTRA_DIST += libkmod/libkmod.sym
2011-12-16 00:37:41 +07:00
EXTRA_DIST += libkmod/COPYING libkmod/README
2011-11-21 21:35:15 +07:00
2011-11-21 23:35:35 +07:00
libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \
-version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \
-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
libkmod_libkmod_la_DEPENDENCIES = libkmod/libkmod-util.la \
${top_srcdir}/libkmod/libkmod.sym
libkmod_libkmod_la_LIBADD = libkmod/libkmod-util.la \
${liblzma_LIBS} ${zlib_LIBS}
2011-11-21 21:35:15 +07:00
noinst_LTLIBRARIES += libkmod/libkmod-private.la
libkmod_libkmod_private_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
libkmod_libkmod_private_la_LDFLAGS = $(AM_LDFLAGS) \
-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
libkmod_libkmod_private_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES)
libkmod_libkmod_private_la_LIBADD = $(libkmod_libkmod_la_LIBADD)
2011-11-21 21:35:15 +07:00
pkgconfigdir = $(libdir)/pkgconfig
2011-11-21 23:35:35 +07:00
pkgconfig_DATA = libkmod/libkmod.pc
EXTRA_DIST += libkmod/libkmod.pc.in
CLEANFILES += libkmod/libkmod.pc
2011-11-21 21:35:15 +07:00
install-exec-hook:
if test "$(libdir)" != "$(rootlibdir)"; then \
2011-12-23 10:59:31 +07:00
$(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \
so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \
mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \
fi
uninstall-hook:
rm -f $(DESTDIR)$(rootlibdir)/libkmod.so*
if BUILD_TOOLS
2012-01-04 17:58:19 +07:00
bin_PROGRAMS = tools/kmod
noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \
tools/modprobe tools/modinfo tools/depmod
tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/kmod-lsmod.c \
tools/kmod-rmmod.c tools/kmod-insmod.c \
tools/kmod-modinfo.c tools/kmod-modprobe.c \
tools/kmod-depmod.c
tools_kmod_CPPFLAGS = $(AM_CPPFLAGS) -DKMOD_BUNDLE_TOOL=1
tools_kmod_CFLAGS = $(AM_CFLAGS)
tools_kmod_LDADD = libkmod/libkmod-util.la \
libkmod/libkmod.la
noinst_PROGRAMS = tools/kmod-nolib
tools_kmod_nolib_SOURCES = $(tools_kmod_SOURCES)
tools_kmod_nolib_CPPFLAGS = $(tools_kmod_CPPFLAGS)
tools_kmod_nolib_CFLAGS = $(tools_kmod_CFLAGS)
tools_kmod_nolib_LDADD = libkmod/libkmod-util.la \
libkmod/libkmod-private.la
${noinst_SCRIPTS}: tools/kmod-nolib
$(AM_V_GEN) ($(RM) $@; \
$(LN_S) $(notdir $<) $@)
endif
# ------------------------------------------------------------------------------
# TESTSUITE
# ------------------------------------------------------------------------------
2012-01-25 07:04:46 +07:00
# libtool will not create a shared library that is not installed. Workaround
# this by creating it by ourselves
CREATE_SHARED_OVERRIDE_LIB = \
$(AM_V_CCLD)gcc -fPIC $(AM_CPPFLAGS) $(AM_CFLAGS) -shared $^ \
-o $@ $(AM_LDFLAGS) -ldl
testsuite/uname.so: testsuite/uname.c
$(CREATE_SHARED_OVERRIDE_LIB)
testsuite/path.so: testsuite/path.c
$(CREATE_SHARED_OVERRIDE_LIB)
EXTRA_DIST += testsuite/uname.c testsuite/path.c
CLEANFILES += testsuite/uname.so testsuite/path.so
testsuite/rootfs:
$(AM_V_GEN) tar -C testsuite/ \
-xJf $(top_srcdir)/testsuite/rootfs.tar.xz
testsuite-distclean:
-rm -rf testsuite/rootfs
DISTCLEAN_LOCAL_HOOKS += testsuite-distclean
EXTRA_DIST += testsuite/rootfs.tar.xz
2012-01-25 07:04:46 +07:00
2012-01-25 05:59:54 +07:00
check_LTLIBRARIES = testsuite/libtestsuite.la
testsuite_libtestsuite_la_SOURCES = testsuite/testsuite.c \
testsuite/testsuite.h
testsuite_libtestsuite_la_DEPENDENCIES = testsuite/uname.so \
testsuite/path.so \
testsuite/rootfs
testsuite_test_testsuite_CPPFLAGS = $(AM_CPPFLAGS) \
-DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/testsuite/rootfs/\"
TESTSUITE = testsuite/test-init testsuite/test-testsuite
2012-01-25 06:53:27 +07:00
check_PROGRAMS = $(TESTSUITE)
TESTS = $(TESTSUITE)
testsuite_test_init_LDADD = testsuite/libtestsuite.la libkmod/libkmod-private.la
testsuite_test_testsuite_LDADD = testsuite/libtestsuite.la
2012-01-25 06:53:27 +07:00
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
2012-01-16 09:42:28 +07:00
distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
2012-01-16 09:42:28 +07:00
# ------------------------------------------------------------------------------
# custom release helpers
# ------------------------------------------------------------------------------
git-release:
head -1 NEWS | grep -q "kmod $(VERSION)"
git commit -a -m "kmod $(VERSION)"
git tag -m "kmod $(VERSION)" -s v$(VERSION)
git gc --prune=0
kmod-$(VERSION).tar.xz:
make distcheck
kmod-$(VERSION).tar.sign:
xz -d -c kmod-$(VERSION).tar.xz | gpg --armor --detach-sign --output kmod-$(VERSION).tar.sign
tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
scp $^ packages.profusion.mobi:/var/www/packages/kmod/