Revert rpmquery/rpmverify split, ain't gonna happen this time around
[platform/upstream/rpm.git] / Makefile.am
1 # Top level Makefile for rpm
2
3 ACLOCAL_AMFLAGS = -I m4
4
5 DISTCHECK_CONFIGURE_FLAGS = --with-external-db
6
7 include $(top_srcdir)/rpm.am
8
9 CLEANFILES =
10 EXTRA_DIST = CHANGES ChangeLog CREDITS GROUPS INSTALL \
11         autodeps autogen.sh \
12         db3/configure installplatform platform.in
13 BUILT_SOURCES =
14
15 SUBDIRS = po misc
16 if WITH_INTERNAL_DB
17 SUBDIRS += db3
18 endif
19 if WITH_LUAEXT
20 SUBDIRS += luaext
21 endif
22 SUBDIRS += rpmio lib sign build scripts fileattrs doc . tests
23
24 if ENABLE_PYTHON
25 SUBDIRS += python
26 endif
27
28 if ENABLE_PLUGINS
29 SUBDIRS += plugins
30 endif
31
32 DIST_SUBDIRS = po misc luaext rpmio lib sign build python scripts fileattrs doc tests plugins
33
34 pkgconfigdir = $(libdir)/pkgconfig
35
36 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
37 AM_CPPFLAGS += -I$(top_srcdir)/build
38 AM_CPPFLAGS += -I$(top_srcdir)/lib
39 AM_CPPFLAGS += -I$(top_srcdir)/rpmio
40 AM_CPPFLAGS += @WITH_NSS_INCLUDE@
41 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
42 AM_CPPFLAGS += -I$(top_srcdir)/misc
43 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
44 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"rpmpopt-${VERSION}\""
45
46 pkginclude_HEADERS =
47 nodist_pkginclude_HEADERS =
48
49 pkginclude_HEADERS += rpmio/argv.h
50 pkginclude_HEADERS += rpmio/rpmio.h
51 pkginclude_HEADERS += rpmio/rpmurl.h
52 pkginclude_HEADERS += rpmio/rpmmacro.h
53 pkginclude_HEADERS += rpmio/rpmlog.h
54 pkginclude_HEADERS += rpmio/rpmpgp.h
55 pkginclude_HEADERS += rpmio/rpmsq.h
56 pkginclude_HEADERS += rpmio/rpmstring.h
57 pkginclude_HEADERS += rpmio/rpmsw.h
58 pkginclude_HEADERS += rpmio/rpmfileutil.h
59 pkginclude_HEADERS += rpmio/rpmutil.h
60 pkginclude_HEADERS += rpmio/rpmkeyring.h
61
62 pkginclude_HEADERS += lib/header.h
63 pkginclude_HEADERS += lib/rpmdb.h
64 pkginclude_HEADERS += lib/rpmcallback.h
65 pkginclude_HEADERS += lib/rpmcli.h
66 pkginclude_HEADERS += lib/rpmlib.h
67 pkginclude_HEADERS += lib/rpmds.h
68 pkginclude_HEADERS += lib/rpmfi.h
69 pkginclude_HEADERS += lib/rpmlegacy.h
70 pkginclude_HEADERS += lib/rpmpol.h
71 pkginclude_HEADERS += lib/rpmps.h
72 pkginclude_HEADERS += lib/rpmprob.h
73 pkginclude_HEADERS += lib/rpmtag.h
74 pkginclude_HEADERS += lib/rpmtd.h
75 pkginclude_HEADERS += lib/rpmte.h
76 pkginclude_HEADERS += lib/rpmts.h
77 pkginclude_HEADERS += lib/rpmtypes.h
78 pkginclude_HEADERS += lib/rpmvf.h
79 pkginclude_HEADERS += lib/rpmplugins.h
80
81 pkginclude_HEADERS += sign/rpmsign.h
82
83 pkginclude_HEADERS += build/rpmbuild.h
84 pkginclude_HEADERS += build/rpmfc.h
85 pkginclude_HEADERS += build/rpmspec.h
86
87
88 rpmbindir = `echo $(bindir) | $(SED) -e s,usr/bin,bin,`
89 rpmbin_PROGRAMS = rpm
90
91 bin_PROGRAMS =          rpm2cpio rpmbuild rpmdb rpmkeys rpmsign rpmspec
92
93 rpmlibexec_PROGRAMS =
94 rpmconfig_SCRIPTS =     find-provides find-requires mkinstalldirs \
95                         config.guess config.sub
96 DISTCLEANFILES = find-provides
97 DISTCLEANFILES += find-requires
98
99 noinst_LTLIBRARIES =            libcliutils.la
100 libcliutils_la_SOURCES =        cliutils.h cliutils.c
101 libcliutils_la_CPPFLAGS =       $(AM_CPPFLAGS)
102 libcliutils_la_LIBADD =         lib/librpm.la rpmio/librpmio.la
103 libcliutils_la_LIBADD +=        @WITH_POPT_LIB@
104
105 rpm_SOURCES =           rpmqv.c debug.h system.h
106 rpm_CPPFLAGS =          $(AM_CPPFLAGS) -DIAM_RPMEIU -DIAM_RPMQ -DIAM_RPMV
107 rpm_LDADD =             libcliutils.la
108 rpm_LDADD +=            lib/librpm.la rpmio/librpmio.la
109 rpm_LDADD +=            @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
110
111 rpmdb_SOURCES =         rpmdb.c debug.h system.h
112 rpmdb_CPPFLAGS =        $(AM_CPPFLAGS)
113 rpmdb_LDADD =           libcliutils.la
114 rpmdb_LDADD +=          lib/librpm.la rpmio/librpmio.la
115 rpmdb_LDADD +=          @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
116
117 rpmkeys_SOURCES =       rpmkeys.c debug.h system.h
118 rpmkeys_CPPFLAGS =      $(AM_CPPFLAGS)
119 rpmkeys_LDADD =         libcliutils.la
120 rpmkeys_LDADD +=        lib/librpm.la rpmio/librpmio.la
121 rpmkeys_LDADD +=        @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
122
123 rpmsign_SOURCES =       rpmsign.c debug.h system.h
124 rpmsign_CPPFLAGS =      $(AM_CPPFLAGS)
125 rpmsign_LDADD =         libcliutils.la
126 rpmsign_LDADD +=        sign/librpmsign.la lib/librpm.la rpmio/librpmio.la
127 rpmsign_LDADD +=        @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
128
129 rpmbuild_SOURCES =      rpmbuild.c debug.h system.h
130 rpmbuild_CPPFLAGS =     $(AM_CPPFLAGS)
131 rpmbuild_LDADD =        libcliutils.la
132 rpmbuild_LDADD +=       build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
133 rpmbuild_LDADD +=       @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
134
135 rpmspec_SOURCES =       rpmspec.c debug.h system.h
136 rpmspec_CPPFLAGS =      $(AM_CPPFLAGS)
137 rpmspec_LDADD =         libcliutils.la
138 rpmspec_LDADD +=        build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
139 rpmspec_LDADD +=        @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
140
141 rpm2cpio_SOURCES =      rpm2cpio.c debug.h system.h
142 rpm2cpio_LDADD =        lib/librpm.la rpmio/librpmio.la
143 rpm2cpio_LDADD +=       @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
144
145
146 if LIBELF
147 if LIBDWARF
148 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
149
150 rpmlibexec_PROGRAMS +=  debugedit
151 debugedit_SOURCES =     tools/debugedit.c tools/hashtab.c tools/hashtab.h
152 debugedit_LDADD =       rpmio/librpmio.la
153 debugedit_LDADD +=      @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
154
155 rpmlibexec_PROGRAMS +=  elfdeps
156 elfdeps_SOURCES =       tools/elfdeps.c
157 elfdeps_LDADD =         rpmio/librpmio.la
158 elfdeps_LDADD +=        @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
159 endif
160 endif
161
162 rpmlibexec_PROGRAMS +=  javadeps
163 javadeps_SOURCES =      tools/javadeps.c
164 javadeps_LDADD =
165
166 rpmlibexec_PROGRAMS +=  rpmdeps
167 rpmdeps_SOURCES =       tools/rpmdeps.c
168 rpmdeps_LDADD =         lib/librpm.la rpmio/librpmio.la build/librpmbuild.la @WITH_POPT_LIB@
169
170 bin_PROGRAMS +=         rpmgraph
171 rpmgraph_SOURCES =      tools/rpmgraph.c
172 rpmgraph_LDADD =        lib/librpm.la rpmio/librpmio.la @WITH_POPT_LIB@
173
174 dist_bin_SCRIPTS =      scripts/gendiff
175
176 rpmconfig_DATA = rpmrc
177 rpmrc: $(top_srcdir)/rpmrc.in
178         @$(SED) \
179           -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
180           < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
181           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
182 CLEANFILES += rpmrc.tmp rpmrc
183 EXTRA_DIST += rpmrc.in
184
185 rpmconfig_DATA += macros
186 macros: $(top_srcdir)/macros.in
187           ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.in )
188 CLEANFILES += macros
189 EXTRA_DIST += macros.in
190
191 noinst_DATA = platform
192 platform: $(top_srcdir)/platform.in
193         @$(SED) \
194           -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
195           < $(top_srcdir)/platform.in > platform.tmp \
196           && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
197 CLEANFILES += platform.tmp platform
198 EXTRA_DIST += platform.in
199
200 pkgconfig_DATA = rpm.pc
201 rpm.pc: $(top_srcdir)/rpm.pc.in
202         @$(SED) \
203           -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
204           < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
205           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
206 CLEANFILES += rpm.pc.tmp rpm.pc
207 EXTRA_DIST += rpm.pc.in
208
209 rpmconfig_DATA += rpmpopt-$(VERSION)
210 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
211         @$(SED) \
212           -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
213           -e "s,[@]BINDIR[@],$(bindir),g" \
214           < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
215           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
216 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
217 EXTRA_DIST += rpmpopt.in
218
219 usrsrcdir = $(prefix)/src
220
221 rpmvardir = $(localstatedir)/lib/rpm
222 rpmvar_DATA =
223
224 install-exec-hook:
225         @rm -f $(DESTDIR)$(bindir)/rpmquery
226         @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmquery
227         @rm -f $(DESTDIR)$(bindir)/rpmverify
228         @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmverify
229
230 install-data-local:
231         @case "@host_os@" in \
232         solaris*|linux*|darwin*) \
233            DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
234         esac
235         @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
236
237 # XXX to appease distcheck we need to remove "stuff" here...
238 uninstall-local:
239         @rm -f $(DESTDIR)$(bindir)/rpmquery
240         @rm -f $(DESTDIR)$(bindir)/rpmverify
241         @rm -rf $(DESTDIR)$(rpmconfigdir)/platform/
242
243 MAINTAINERCLEANFILES = ChangeLog
244
245 # Build hacking docs only on request
246 if HACKINGDOCS
247 if DOXYGEN
248 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
249         $(SED) \
250           -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
251           -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
252           -e "s,[@]PACKAGE[@],$(PACKAGE)," \
253           -e "s,[@]VERSION[@],$(VERSION)," \
254         < $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
255
256 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
257         @DOXYGEN@ doc/hacking.doxy
258 noinst_DATA += doc/hacking/html/index.html
259 endif
260 endif
261 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
262
263 # Always build librpm docs
264 if DOXYGEN
265 doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
266         files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
267         $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
268           -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
269           -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
270           -e "s,[@]PACKAGE[@],$(PACKAGE)," \
271           -e "s,[@]VERSION[@],$(VERSION)," \
272         < $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
273
274 doc/librpm/html/index.html: doc/librpm.doxy
275         @DOXYGEN@ doc/librpm.doxy
276 noinst_DATA += doc/librpm/html/index.html
277 endif
278 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
279 EXTRA_DIST += doc/librpm/html
280
281 if WITH_INTERNAL_DB
282 db.h:   $(top_builddir)/db3/db.h
283         $(LN_S) $(top_builddir)/db3/db.h $@
284 BUILT_SOURCES += db.h
285 endif
286 DISTCLEANFILES += db.h
287
288 clean-local:
289         rm -rf doc/hacking/html
290         rm -rf include
291
292 distclean-local:
293         rm -rf Doxytags
294         rm -f stamp-h.in db3/*.orig db3/db3lobjs
295
296 maintainer-clean-local:
297         rm -rf doc/librpm/html
298
299 $(top_srcdir)/preinstall.am: Makefile.am
300         rm -f $(top_srcdir)/preinstall.am
301         @for f in $(HEADERS); do \
302           b=`basename $$f`; \
303           echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
304           echo '        $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
305           echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
306           echo 'CLEANFILES += include/rpm/'$$b  >> $(top_srcdir)/preinstall.am; \
307          done
308
309 include/rpm/$(dirstamp):
310         @$(MKDIR_P) include/rpm
311         @: > include/rpm/$(dirstamp)
312
313 include $(top_srcdir)/preinstall.am