Makefile.am 10.3 KB
Newer Older
1 2
# Top level Makefile for rpm

3 4
ACLOCAL_AMFLAGS = -I m4

5
DISTCHECK_CONFIGURE_FLAGS = --with-external-db --enable-python
6 7

include $(top_srcdir)/rpm.am
8
AM_CFLAGS = @RPMCFLAGS@
9 10

CLEANFILES =
11
EXTRA_DIST = ChangeLog CREDITS INSTALL \
12
	autogen.sh db3/configure installplatform platform.in
13 14 15 16 17 18
BUILT_SOURCES =

SUBDIRS = po misc
if WITH_INTERNAL_DB
SUBDIRS += db3
endif
19
if WITH_LUA
20 21
SUBDIRS += luaext
endif
22
SUBDIRS += rpmio lib sign build scripts fileattrs doc .
23

24 25 26 27 28 29 30 31
if ENABLE_PYTHON
SUBDIRS += python
endif

if ENABLE_PLUGINS
SUBDIRS += plugins
endif

32 33 34 35
if HAVE_FAKECHROOT
SUBDIRS += tests
endif

36
DIST_SUBDIRS = po misc luaext rpmio lib sign build python scripts fileattrs doc tests plugins
37 38 39 40 41 42 43

pkgconfigdir = $(libdir)/pkgconfig

AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
AM_CPPFLAGS += -I$(top_srcdir)/build
AM_CPPFLAGS += -I$(top_srcdir)/lib
AM_CPPFLAGS += -I$(top_srcdir)/rpmio
44
AM_CPPFLAGS += @WITH_BEECRYPT_INCLUDE@
45
AM_CPPFLAGS += @WITH_NSS_INCLUDE@
46
AM_CPPFLAGS += @WITH_OPENSSL_INCLUDE@
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
AM_CPPFLAGS += @WITH_POPT_INCLUDE@
AM_CPPFLAGS += -I$(top_srcdir)/misc
AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"rpmpopt-${VERSION}\""

pkginclude_HEADERS =
nodist_pkginclude_HEADERS =

pkginclude_HEADERS += rpmio/argv.h
pkginclude_HEADERS += rpmio/rpmio.h
pkginclude_HEADERS += rpmio/rpmurl.h
pkginclude_HEADERS += rpmio/rpmmacro.h
pkginclude_HEADERS += rpmio/rpmlog.h
pkginclude_HEADERS += rpmio/rpmpgp.h
pkginclude_HEADERS += rpmio/rpmsq.h
pkginclude_HEADERS += rpmio/rpmstring.h
63
pkginclude_HEADERS += rpmio/rpmstrpool.h
64 65 66 67
pkginclude_HEADERS += rpmio/rpmsw.h
pkginclude_HEADERS += rpmio/rpmfileutil.h
pkginclude_HEADERS += rpmio/rpmutil.h
pkginclude_HEADERS += rpmio/rpmkeyring.h
68
pkginclude_HEADERS += rpmio/rpmbase64.h
69 70 71 72 73 74 75 76

pkginclude_HEADERS += lib/header.h
pkginclude_HEADERS += lib/rpmdb.h
pkginclude_HEADERS += lib/rpmcallback.h
pkginclude_HEADERS += lib/rpmcli.h
pkginclude_HEADERS += lib/rpmlib.h
pkginclude_HEADERS += lib/rpmds.h
pkginclude_HEADERS += lib/rpmfi.h
77
pkginclude_HEADERS += lib/rpmfiles.h
78
pkginclude_HEADERS += lib/rpmpol.h
79
pkginclude_HEADERS += lib/rpmps.h
80
pkginclude_HEADERS += lib/rpmprob.h
81 82 83 84 85 86
pkginclude_HEADERS += lib/rpmtag.h
pkginclude_HEADERS += lib/rpmtd.h
pkginclude_HEADERS += lib/rpmte.h
pkginclude_HEADERS += lib/rpmts.h
pkginclude_HEADERS += lib/rpmtypes.h
pkginclude_HEADERS += lib/rpmvf.h
87
pkginclude_HEADERS += lib/rpmarchive.h
88

89 90
pkginclude_HEADERS += sign/rpmsign.h

91 92 93 94 95
pkginclude_HEADERS += build/rpmbuild.h
pkginclude_HEADERS += build/rpmfc.h
pkginclude_HEADERS += build/rpmspec.h


96
bin_PROGRAMS =		rpm rpm2cpio rpmbuild rpmdb rpmkeys rpmsign rpmspec
97 98 99
if WITH_ARCHIVE
bin_PROGRAMS += 	rpm2archive 
endif
100 101

rpmlibexec_PROGRAMS =
102
rpmconfig_SCRIPTS =	mkinstalldirs \
103 104
			config.guess config.sub

105 106 107 108 109
noinst_LTLIBRARIES = 		libcliutils.la
libcliutils_la_SOURCES = 	cliutils.h cliutils.c
libcliutils_la_CPPFLAGS =	$(AM_CPPFLAGS)
libcliutils_la_LIBADD = 	lib/librpm.la rpmio/librpmio.la
libcliutils_la_LIBADD +=	@WITH_POPT_LIB@
110

111 112 113 114
rpm_SOURCES =		rpmqv.c debug.h system.h
rpm_CPPFLAGS =		$(AM_CPPFLAGS) -DIAM_RPMEIU -DIAM_RPMQ -DIAM_RPMV
rpm_LDADD =		libcliutils.la
rpm_LDADD +=		lib/librpm.la rpmio/librpmio.la
115
rpm_LDADD +=		@WITH_POPT_LIB@
116 117 118 119 120

rpmdb_SOURCES =		rpmdb.c debug.h system.h
rpmdb_CPPFLAGS =	$(AM_CPPFLAGS)
rpmdb_LDADD =		libcliutils.la
rpmdb_LDADD +=		lib/librpm.la rpmio/librpmio.la
121
rpmdb_LDADD +=		@WITH_POPT_LIB@
122 123 124 125 126

rpmkeys_SOURCES =	rpmkeys.c debug.h system.h
rpmkeys_CPPFLAGS =	$(AM_CPPFLAGS)
rpmkeys_LDADD =		libcliutils.la
rpmkeys_LDADD +=	lib/librpm.la rpmio/librpmio.la
127
rpmkeys_LDADD +=	@WITH_POPT_LIB@
128 129 130 131 132

rpmsign_SOURCES =	rpmsign.c debug.h system.h
rpmsign_CPPFLAGS =	$(AM_CPPFLAGS)
rpmsign_LDADD =		libcliutils.la
rpmsign_LDADD +=	sign/librpmsign.la lib/librpm.la rpmio/librpmio.la
133
rpmsign_LDADD +=	@WITH_POPT_LIB@
134 135 136 137 138

rpmbuild_SOURCES =	rpmbuild.c debug.h system.h
rpmbuild_CPPFLAGS =	$(AM_CPPFLAGS)
rpmbuild_LDADD =	libcliutils.la
rpmbuild_LDADD +=	build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
139
rpmbuild_LDADD += 	@WITH_POPT_LIB@
140 141 142 143 144

rpmspec_SOURCES =	rpmspec.c debug.h system.h
rpmspec_CPPFLAGS =	$(AM_CPPFLAGS)
rpmspec_LDADD =		libcliutils.la
rpmspec_LDADD +=	build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
145
rpmspec_LDADD +=	@WITH_POPT_LIB@
146 147 148

rpm2cpio_SOURCES =	rpm2cpio.c debug.h system.h
rpm2cpio_LDADD =	lib/librpm.la rpmio/librpmio.la
149
rpm2cpio_LDADD +=	@WITH_POPT_LIB@
150

151 152
rpm2archive_SOURCES =	rpm2archive.c debug.h system.h
rpm2archive_LDADD =	lib/librpm.la rpmio/librpmio.la
153
rpm2archive_LDADD +=	@WITH_POPT_LIB@ @WITH_ARCHIVE_LIB@
154

155 156 157

if LIBELF
if LIBDWARF
158
if LIBDW
159 160 161 162 163 164
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh

rpmlibexec_PROGRAMS +=	debugedit
debugedit_SOURCES =	tools/debugedit.c tools/hashtab.c tools/hashtab.h
debugedit_LDADD =	rpmio/librpmio.la
debugedit_LDADD +=	@WITH_LIBELF_LIB@ @WITH_POPT_LIB@
165 166 167 168 169 170 171
if HAVE_LIBDW_STRTAB
debugedit_LDADD +=	@WITH_LIBDW_LIB@
else
debugedit_LDADD +=	@WITH_LIBDW_LIB@ -lebl
endif # HAVE_LIBDW_STRTAB
endif # LIBDW
endif # LIBDWARF
172 173 174 175
rpmlibexec_PROGRAMS +=	elfdeps
elfdeps_SOURCES =	tools/elfdeps.c
elfdeps_LDADD =		rpmio/librpmio.la
elfdeps_LDADD +=	@WITH_LIBELF_LIB@ @WITH_POPT_LIB@
176 177 178 179

rpmlibexec_PROGRAMS +=	sepdebugcrcfix
sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c
sepdebugcrcfix_LDADD =	@WITH_LIBELF_LIB@
180
endif #LIBELF
181 182 183

rpmlibexec_PROGRAMS +=	rpmdeps
rpmdeps_SOURCES =	tools/rpmdeps.c
184
rpmdeps_LDADD =		lib/librpm.la rpmio/librpmio.la build/librpmbuild.la @WITH_POPT_LIB@
185 186 187

bin_PROGRAMS +=		rpmgraph
rpmgraph_SOURCES =	tools/rpmgraph.c
188
rpmgraph_LDADD =	lib/librpm.la rpmio/librpmio.la @WITH_POPT_LIB@
189 190 191 192 193 194 195 196 197 198 199 200

dist_bin_SCRIPTS =	scripts/gendiff

rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
	@$(SED) \
	  -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
	  < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
	  && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
CLEANFILES += rpmrc.tmp rpmrc
EXTRA_DIST += rpmrc.in

201
noinst_DATA = macros
202 203 204 205 206
macros: $(top_srcdir)/macros.in
	  ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.in )
CLEANFILES += macros
EXTRA_DIST += macros.in

207 208 209
# Used for the testsuite to test creating debuginfo packages
EXTRA_DIST += macros.debug

210
noinst_DATA += platform
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
platform: $(top_srcdir)/platform.in
	@$(SED) \
	  -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
	  < $(top_srcdir)/platform.in > platform.tmp \
	  && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
CLEANFILES += platform.tmp platform
EXTRA_DIST += platform.in

pkgconfig_DATA = rpm.pc
rpm.pc: $(top_srcdir)/rpm.pc.in
	@$(SED) \
	  -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
	  < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
	  && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
CLEANFILES += rpm.pc.tmp rpm.pc
EXTRA_DIST += rpm.pc.in

rpmconfig_DATA += rpmpopt-$(VERSION)
rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
	@$(SED) \
	  -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
232
	  -e "s,[@]BINDIR[@],$(bindir),g" \
233 234 235 236 237 238 239 240 241 242 243
	  < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
	  && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
EXTRA_DIST += rpmpopt.in

usrsrcdir = $(prefix)/src

rpmvardir = $(localstatedir)/lib/rpm
rpmvar_DATA =

install-exec-hook:
244
	@rm -f $(DESTDIR)$(bindir)/rpmquery
245
	@LN_S@ $(rpm_symlink_prefix)rpm $(DESTDIR)$(bindir)/rpmquery
246
	@rm -f $(DESTDIR)$(bindir)/rpmverify
247
	@LN_S@  $(rpm_symlink_prefix)rpm $(DESTDIR)$(bindir)/rpmverify
248 249

install-data-local:
250 251
	DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" \
		$(SHELL) $(top_srcdir)/installplatform \
252
			rpmrc platform macros \
253
			$(RPMCANONVENDOR) $(RPMCANONOS) $(RPMCANONGNU)
254
	@$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
255
	@$(MKDIR_P) $(DESTDIR)$(rpmconfigdir)/macros.d
256
	@$(MKDIR_P) $(DESTDIR)$(rpmconfigdir)/lua
257 258 259 260 261

# XXX to appease distcheck we need to remove "stuff" here...
uninstall-local:
	@rm -f $(DESTDIR)$(bindir)/rpmquery
	@rm -f $(DESTDIR)$(bindir)/rpmverify
262
	@rm -rf $(DESTDIR)$(rpmconfigdir)/platform/
263
	@rm -f $(DESTDIR)$(rpmconfigdir)/macros
264
	@rm -rf $(DESTDIR)$(rpmconfigdir)/macros.d
265
	@rm -rf $(DESTDIR)$(rpmconfigdir)/lua
266 267 268 269 270 271

MAINTAINERCLEANFILES = ChangeLog

# Build hacking docs only on request
if HACKINGDOCS
if DOXYGEN
272
doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader.h Makefile.am
273 274 275 276 277 278 279 280 281 282 283 284
	$(SED) \
	  -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
	  -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
	  -e "s,[@]PACKAGE[@],$(PACKAGE)," \
	  -e "s,[@]VERSION[@],$(VERSION)," \
	< $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy

doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
	@DOXYGEN@ doc/hacking.doxy
noinst_DATA += doc/hacking/html/index.html
endif
endif
285
EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader.h
286 287 288

# Always build librpm docs
if DOXYGEN
289 290
doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader.h Makefile.am configure.ac $(pkginclude_HEADERS)
	files=`echo " $(pkginclude_HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
291 292 293 294 295 296 297 298 299 300 301
	$(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
	  -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
	  -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
	  -e "s,[@]PACKAGE[@],$(PACKAGE)," \
	  -e "s,[@]VERSION[@],$(VERSION)," \
	< $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy

doc/librpm/html/index.html: doc/librpm.doxy
	@DOXYGEN@ doc/librpm.doxy
noinst_DATA += doc/librpm/html/index.html
endif
302
EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader.h
303 304 305 306 307 308 309
EXTRA_DIST += doc/librpm/html

if WITH_INTERNAL_DB
db.h:	$(top_builddir)/db3/db.h
	$(LN_S) $(top_builddir)/db3/db.h $@
BUILT_SOURCES += db.h
endif
310
DISTCLEANFILES = db.h
311

312 313 314 315 316 317
ChangeLog:
	touch ChangeLog

dist-hook:
	if [ -d .git ] && [ -x $(command -v git) ]; then git log --no-merges > $(distdir)/ChangeLog; fi

318 319 320 321 322
clean-local:
	rm -rf doc/hacking/html
	rm -rf include

distclean-local:
323
	rm -rf doc/librpm.doxy doc/librpm/html
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
	rm -rf Doxytags
	rm -f stamp-h.in db3/*.orig db3/db3lobjs

$(top_srcdir)/preinstall.am: Makefile.am
	rm -f $(top_srcdir)/preinstall.am
	@for f in $(HEADERS); do \
	  b=`basename $$f`; \
	  echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
	  echo '	$$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
	  echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
	  echo 'CLEANFILES += include/rpm/'$$b  >> $(top_srcdir)/preinstall.am; \
	 done

include/rpm/$(dirstamp):
	@$(MKDIR_P) include/rpm
	@: > include/rpm/$(dirstamp)

include $(top_srcdir)/preinstall.am