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