csomh / source-git / rpm

Forked from source-git/rpm 4 years ago
Clone
2ff057
# Top level Makefile for rpm
2ff057
2ff057
ACLOCAL_AMFLAGS = -I m4
2ff057
2ff057
DISTCHECK_CONFIGURE_FLAGS = --with-external-db --enable-python
2ff057
2ff057
include $(top_srcdir)/rpm.am
2ff057
AM_CFLAGS = @RPMCFLAGS@
2ff057
2ff057
CLEANFILES =
2ff057
EXTRA_DIST = ChangeLog CREDITS INSTALL \
2ff057
	autogen.sh db3/configure installplatform platform.in
2ff057
BUILT_SOURCES =
2ff057
2ff057
SUBDIRS = po misc
2ff057
if WITH_INTERNAL_DB
2ff057
SUBDIRS += db3
2ff057
endif
2ff057
if WITH_LUA
2ff057
SUBDIRS += luaext
2ff057
endif
2ff057
SUBDIRS += rpmio lib sign build scripts fileattrs doc .
2ff057
2ff057
if ENABLE_PYTHON
2ff057
SUBDIRS += python
2ff057
endif
2ff057
2ff057
if ENABLE_PLUGINS
2ff057
SUBDIRS += plugins
2ff057
endif
2ff057
2ff057
if HAVE_FAKECHROOT
2ff057
SUBDIRS += tests
2ff057
endif
2ff057
2ff057
DIST_SUBDIRS = po misc luaext rpmio lib sign build python scripts fileattrs doc tests plugins
2ff057
2ff057
pkgconfigdir = $(libdir)/pkgconfig
2ff057
2ff057
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
2ff057
AM_CPPFLAGS += -I$(top_srcdir)/build
2ff057
AM_CPPFLAGS += -I$(top_srcdir)/lib
2ff057
AM_CPPFLAGS += -I$(top_srcdir)/rpmio
2ff057
AM_CPPFLAGS += @WITH_BEECRYPT_INCLUDE@
2ff057
AM_CPPFLAGS += @WITH_NSS_INCLUDE@
2ff057
AM_CPPFLAGS += @WITH_OPENSSL_INCLUDE@
2ff057
AM_CPPFLAGS += @WITH_POPT_INCLUDE@
2ff057
AM_CPPFLAGS += -I$(top_srcdir)/misc
2ff057
AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
2ff057
AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"rpmpopt-${VERSION}\""
2ff057
2ff057
pkginclude_HEADERS =
2ff057
nodist_pkginclude_HEADERS =
2ff057
2ff057
pkginclude_HEADERS += rpmio/argv.h
2ff057
pkginclude_HEADERS += rpmio/rpmio.h
2ff057
pkginclude_HEADERS += rpmio/rpmurl.h
2ff057
pkginclude_HEADERS += rpmio/rpmmacro.h
2ff057
pkginclude_HEADERS += rpmio/rpmlog.h
2ff057
pkginclude_HEADERS += rpmio/rpmpgp.h
2ff057
pkginclude_HEADERS += rpmio/rpmsq.h
2ff057
pkginclude_HEADERS += rpmio/rpmstring.h
2ff057
pkginclude_HEADERS += rpmio/rpmstrpool.h
2ff057
pkginclude_HEADERS += rpmio/rpmsw.h
2ff057
pkginclude_HEADERS += rpmio/rpmfileutil.h
2ff057
pkginclude_HEADERS += rpmio/rpmutil.h
2ff057
pkginclude_HEADERS += rpmio/rpmkeyring.h
2ff057
pkginclude_HEADERS += rpmio/rpmbase64.h
2ff057
2ff057
pkginclude_HEADERS += lib/header.h
2ff057
pkginclude_HEADERS += lib/rpmdb.h
2ff057
pkginclude_HEADERS += lib/rpmcallback.h
2ff057
pkginclude_HEADERS += lib/rpmcli.h
2ff057
pkginclude_HEADERS += lib/rpmlib.h
2ff057
pkginclude_HEADERS += lib/rpmds.h
2ff057
pkginclude_HEADERS += lib/rpmfi.h
2ff057
pkginclude_HEADERS += lib/rpmfiles.h
2ff057
pkginclude_HEADERS += lib/rpmpol.h
2ff057
pkginclude_HEADERS += lib/rpmps.h
2ff057
pkginclude_HEADERS += lib/rpmprob.h
2ff057
pkginclude_HEADERS += lib/rpmtag.h
2ff057
pkginclude_HEADERS += lib/rpmtd.h
2ff057
pkginclude_HEADERS += lib/rpmte.h
2ff057
pkginclude_HEADERS += lib/rpmts.h
2ff057
pkginclude_HEADERS += lib/rpmtypes.h
2ff057
pkginclude_HEADERS += lib/rpmvf.h
2ff057
pkginclude_HEADERS += lib/rpmarchive.h
2ff057
2ff057
pkginclude_HEADERS += sign/rpmsign.h
2ff057
2ff057
pkginclude_HEADERS += build/rpmbuild.h
2ff057
pkginclude_HEADERS += build/rpmfc.h
2ff057
pkginclude_HEADERS += build/rpmspec.h
2ff057
2ff057
2ff057
bin_PROGRAMS =		rpm rpm2cpio rpmbuild rpmdb rpmkeys rpmsign rpmspec
2ff057
if WITH_ARCHIVE
2ff057
bin_PROGRAMS += 	rpm2archive 
2ff057
endif
2ff057
2ff057
rpmlibexec_PROGRAMS =
2ff057
rpmconfig_SCRIPTS =	mkinstalldirs \
2ff057
			config.guess config.sub
2ff057
2ff057
noinst_LTLIBRARIES = 		libcliutils.la
2ff057
libcliutils_la_SOURCES = 	cliutils.h cliutils.c
2ff057
libcliutils_la_CPPFLAGS =	$(AM_CPPFLAGS)
2ff057
libcliutils_la_LIBADD = 	lib/librpm.la rpmio/librpmio.la
2ff057
libcliutils_la_LIBADD +=	@WITH_POPT_LIB@
2ff057
2ff057
rpm_SOURCES =		rpmqv.c debug.h system.h
2ff057
rpm_CPPFLAGS =		$(AM_CPPFLAGS) -DIAM_RPMEIU -DIAM_RPMQ -DIAM_RPMV
2ff057
rpm_LDADD =		libcliutils.la
2ff057
rpm_LDADD +=		lib/librpm.la rpmio/librpmio.la
2ff057
rpm_LDADD +=		@WITH_POPT_LIB@
2ff057
2ff057
rpmdb_SOURCES =		rpmdb.c debug.h system.h
2ff057
rpmdb_CPPFLAGS =	$(AM_CPPFLAGS)
2ff057
rpmdb_LDADD =		libcliutils.la
2ff057
rpmdb_LDADD +=		lib/librpm.la rpmio/librpmio.la
2ff057
rpmdb_LDADD +=		@WITH_POPT_LIB@
2ff057
2ff057
rpmkeys_SOURCES =	rpmkeys.c debug.h system.h
2ff057
rpmkeys_CPPFLAGS =	$(AM_CPPFLAGS)
2ff057
rpmkeys_LDADD =		libcliutils.la
2ff057
rpmkeys_LDADD +=	lib/librpm.la rpmio/librpmio.la
2ff057
rpmkeys_LDADD +=	@WITH_POPT_LIB@
2ff057
2ff057
rpmsign_SOURCES =	rpmsign.c debug.h system.h
2ff057
rpmsign_CPPFLAGS =	$(AM_CPPFLAGS)
2ff057
rpmsign_LDADD =		libcliutils.la
2ff057
rpmsign_LDADD +=	sign/librpmsign.la lib/librpm.la rpmio/librpmio.la
2ff057
rpmsign_LDADD +=	@WITH_POPT_LIB@
2ff057
2ff057
rpmbuild_SOURCES =	rpmbuild.c debug.h system.h
2ff057
rpmbuild_CPPFLAGS =	$(AM_CPPFLAGS)
2ff057
rpmbuild_LDADD =	libcliutils.la
2ff057
rpmbuild_LDADD +=	build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
2ff057
rpmbuild_LDADD += 	@WITH_POPT_LIB@
2ff057
2ff057
rpmspec_SOURCES =	rpmspec.c debug.h system.h
2ff057
rpmspec_CPPFLAGS =	$(AM_CPPFLAGS)
2ff057
rpmspec_LDADD =		libcliutils.la
2ff057
rpmspec_LDADD +=	build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
2ff057
rpmspec_LDADD +=	@WITH_POPT_LIB@
2ff057
2ff057
rpm2cpio_SOURCES =	rpm2cpio.c debug.h system.h
2ff057
rpm2cpio_LDADD =	lib/librpm.la rpmio/librpmio.la
2ff057
rpm2cpio_LDADD +=	@WITH_POPT_LIB@
2ff057
2ff057
rpm2archive_SOURCES =	rpm2archive.c debug.h system.h
2ff057
rpm2archive_LDADD =	lib/librpm.la rpmio/librpmio.la
2ff057
rpm2archive_LDADD +=	@WITH_POPT_LIB@ @WITH_ARCHIVE_LIB@
2ff057
2ff057
2ff057
if LIBELF
2ff057
if LIBDWARF
2ff057
if LIBDW
2ff057
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
2ff057
2ff057
rpmlibexec_PROGRAMS +=	debugedit
2ff057
debugedit_SOURCES =	tools/debugedit.c tools/hashtab.c tools/hashtab.h
2ff057
debugedit_LDADD =	rpmio/librpmio.la
2ff057
debugedit_LDADD +=	@WITH_LIBELF_LIB@ @WITH_POPT_LIB@
2ff057
if HAVE_LIBDW_STRTAB
2ff057
debugedit_LDADD +=	@WITH_LIBDW_LIB@
2ff057
else
2ff057
debugedit_LDADD +=	@WITH_LIBDW_LIB@ -lebl
2ff057
endif # HAVE_LIBDW_STRTAB
2ff057
endif # LIBDW
2ff057
endif # LIBDWARF
2ff057
rpmlibexec_PROGRAMS +=	elfdeps
2ff057
elfdeps_SOURCES =	tools/elfdeps.c
2ff057
elfdeps_LDADD =		rpmio/librpmio.la
2ff057
elfdeps_LDADD +=	@WITH_LIBELF_LIB@ @WITH_POPT_LIB@
2ff057
2ff057
rpmlibexec_PROGRAMS +=	sepdebugcrcfix
2ff057
sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c
2ff057
sepdebugcrcfix_LDADD =	@WITH_LIBELF_LIB@
2ff057
endif #LIBELF
2ff057
2ff057
rpmlibexec_PROGRAMS +=	rpmdeps
2ff057
rpmdeps_SOURCES =	tools/rpmdeps.c
2ff057
rpmdeps_LDADD =		lib/librpm.la rpmio/librpmio.la build/librpmbuild.la @WITH_POPT_LIB@
2ff057
2ff057
bin_PROGRAMS +=		rpmgraph
2ff057
rpmgraph_SOURCES =	tools/rpmgraph.c
2ff057
rpmgraph_LDADD =	lib/librpm.la rpmio/librpmio.la @WITH_POPT_LIB@
2ff057
2ff057
dist_bin_SCRIPTS =	scripts/gendiff
2ff057
2ff057
rpmconfig_DATA = rpmrc
2ff057
rpmrc: $(top_srcdir)/rpmrc.in
2ff057
	@$(SED) \
2ff057
	  -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
2ff057
	  < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
2ff057
	  && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
2ff057
CLEANFILES += rpmrc.tmp rpmrc
2ff057
EXTRA_DIST += rpmrc.in
2ff057
2ff057
noinst_DATA = macros
2ff057
macros: $(top_srcdir)/macros.in
2ff057
	  ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.in )
2ff057
CLEANFILES += macros
2ff057
EXTRA_DIST += macros.in
2ff057
2ff057
# Used for the testsuite to test creating debuginfo packages
2ff057
EXTRA_DIST += macros.debug
2ff057
2ff057
noinst_DATA += platform
2ff057
platform: $(top_srcdir)/platform.in
2ff057
	@$(SED) \
2ff057
	  -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
2ff057
	  < $(top_srcdir)/platform.in > platform.tmp \
2ff057
	  && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
2ff057
CLEANFILES += platform.tmp platform
2ff057
EXTRA_DIST += platform.in
2ff057
2ff057
pkgconfig_DATA = rpm.pc
2ff057
rpm.pc: $(top_srcdir)/rpm.pc.in
2ff057
	@$(SED) \
2ff057
	  -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
2ff057
	  < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
2ff057
	  && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
2ff057
CLEANFILES += rpm.pc.tmp rpm.pc
2ff057
EXTRA_DIST += rpm.pc.in
2ff057
2ff057
rpmconfig_DATA += rpmpopt-$(VERSION)
2ff057
rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
2ff057
	@$(SED) \
2ff057
	  -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
2ff057
	  -e "s,[@]BINDIR[@],$(bindir),g" \
2ff057
	  < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
2ff057
	  && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
2ff057
CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
2ff057
EXTRA_DIST += rpmpopt.in
2ff057
2ff057
usrsrcdir = $(prefix)/src
2ff057
2ff057
rpmvardir = $(localstatedir)/lib/rpm
2ff057
rpmvar_DATA =
2ff057
2ff057
install-exec-hook:
2ff057
	@rm -f $(DESTDIR)$(bindir)/rpmquery
2ff057
	@LN_S@ $(rpm_symlink_prefix)rpm $(DESTDIR)$(bindir)/rpmquery
2ff057
	@rm -f $(DESTDIR)$(bindir)/rpmverify
2ff057
	@LN_S@  $(rpm_symlink_prefix)rpm $(DESTDIR)$(bindir)/rpmverify
2ff057
2ff057
install-data-local:
2ff057
	DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" \
2ff057
		$(SHELL) $(top_srcdir)/installplatform \
2ff057
			rpmrc platform macros \
2ff057
			$(RPMCANONVENDOR) $(RPMCANONOS) $(RPMCANONGNU)
2ff057
	@$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
2ff057
	@$(MKDIR_P) $(DESTDIR)$(rpmconfigdir)/macros.d
2ff057
2ff057
# XXX to appease distcheck we need to remove "stuff" here...
2ff057
uninstall-local:
2ff057
	@rm -f $(DESTDIR)$(bindir)/rpmquery
2ff057
	@rm -f $(DESTDIR)$(bindir)/rpmverify
2ff057
	@rm -rf $(DESTDIR)$(rpmconfigdir)/platform/
2ff057
	@rm -f $(DESTDIR)$(rpmconfigdir)/macros
2ff057
	@rm -rf $(DESTDIR)$(rpmconfigdir)/macros.d
2ff057
2ff057
MAINTAINERCLEANFILES = ChangeLog
2ff057
2ff057
# Build hacking docs only on request
2ff057
if HACKINGDOCS
2ff057
if DOXYGEN
2ff057
doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader.h Makefile.am
2ff057
	$(SED) \
2ff057
	  -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
2ff057
	  -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
2ff057
	  -e "s,[@]PACKAGE[@],$(PACKAGE)," \
2ff057
	  -e "s,[@]VERSION[@],$(VERSION)," \
2ff057
	< $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
2ff057
2ff057
doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
2ff057
	@DOXYGEN@ doc/hacking.doxy
2ff057
noinst_DATA += doc/hacking/html/index.html
2ff057
endif
2ff057
endif
2ff057
EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader.h
2ff057
2ff057
# Always build librpm docs
2ff057
if DOXYGEN
2ff057
doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader.h Makefile.am configure.ac $(pkginclude_HEADERS)
2ff057
	files=`echo " $(pkginclude_HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
2ff057
	$(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
2ff057
	  -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
2ff057
	  -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
2ff057
	  -e "s,[@]PACKAGE[@],$(PACKAGE)," \
2ff057
	  -e "s,[@]VERSION[@],$(VERSION)," \
2ff057
	< $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
2ff057
2ff057
doc/librpm/html/index.html: doc/librpm.doxy
2ff057
	@DOXYGEN@ doc/librpm.doxy
2ff057
noinst_DATA += doc/librpm/html/index.html
2ff057
endif
2ff057
EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader.h
2ff057
EXTRA_DIST += doc/librpm/html
2ff057
2ff057
if WITH_INTERNAL_DB
2ff057
db.h:	$(top_builddir)/db3/db.h
2ff057
	$(LN_S) $(top_builddir)/db3/db.h $@
2ff057
BUILT_SOURCES += db.h
2ff057
endif
2ff057
DISTCLEANFILES = db.h
2ff057
2ff057
ChangeLog:
2ff057
	touch ChangeLog
2ff057
2ff057
dist-hook:
2ff057
	if [ -d .git ] && [ -x $(command -v git) ]; then git log --no-merges > $(distdir)/ChangeLog; fi
2ff057
2ff057
clean-local:
2ff057
	rm -rf doc/hacking/html
2ff057
	rm -rf include
2ff057
2ff057
distclean-local:
2ff057
	rm -rf doc/librpm.doxy doc/librpm/html
2ff057
	rm -rf Doxytags
2ff057
	rm -f stamp-h.in db3/*.orig db3/db3lobjs
2ff057
2ff057
$(top_srcdir)/preinstall.am: Makefile.am
2ff057
	rm -f $(top_srcdir)/preinstall.am
2ff057
	@for f in $(HEADERS); do \
2ff057
	  b=`basename $$f`; \
2ff057
	  echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
2ff057
	  echo '	$$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
2ff057
	  echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
2ff057
	  echo 'CLEANFILES += include/rpm/'$$b  >> $(top_srcdir)/preinstall.am; \
2ff057
	 done
2ff057
2ff057
include/rpm/$(dirstamp):
2ff057
	@$(MKDIR_P) include/rpm
2ff057
	@: > include/rpm/$(dirstamp)
2ff057
2ff057
include $(top_srcdir)/preinstall.am