Remove rollback support
[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 SUBDIRS += lua rpmio rpmdb lib build python scripts doc . tests
20
21 DIST_SUBDIRS = po misc lua rpmio rpmdb lib build python scripts doc tests
22
23 pkgconfigdir = $(libdir)/pkgconfig
24
25 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
26 AM_CPPFLAGS += -I$(top_srcdir)/build
27 AM_CPPFLAGS += -I$(top_srcdir)/lib
28 AM_CPPFLAGS += -I$(top_builddir)/rpmdb -I$(top_srcdir)/rpmdb
29 AM_CPPFLAGS += -I$(top_srcdir)/rpmio
30 AM_CPPFLAGS += @WITH_NSS_INCLUDE@
31 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
32 AM_CPPFLAGS += -I$(top_srcdir)/misc
33 AM_CPPFLAGS += @WITH_LIBELF_INCLUDE@
34 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
35 AM_CPPFLAGS += -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\""
36 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
37
38 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
39
40 pkginclude_HEADERS =
41 nodist_pkginclude_HEADERS =
42
43 pkginclude_HEADERS += rpmio/argv.h
44 pkginclude_HEADERS += rpmio/rpmio.h
45 pkginclude_HEADERS += rpmio/rpmurl.h
46 pkginclude_HEADERS += rpmio/rpmmacro.h
47 pkginclude_HEADERS += rpmio/rpmlog.h
48 pkginclude_HEADERS += rpmio/rpmpgp.h
49 pkginclude_HEADERS += rpmio/rpmsq.h
50 pkginclude_HEADERS += rpmio/rpmstring.h
51 pkginclude_HEADERS += rpmio/rpmsw.h
52 pkginclude_HEADERS += rpmio/rpmfileutil.h
53 pkginclude_HEADERS += rpmio/rpmutil.h
54
55 pkginclude_HEADERS += rpmdb/header.h
56 pkginclude_HEADERS += rpmdb/rpmdb.h
57 nodist_pkginclude_HEADERS += rpmdb/rpmints.h
58
59 pkginclude_HEADERS += lib/rpmcallback.h
60 pkginclude_HEADERS += lib/rpmcli.h
61 pkginclude_HEADERS += lib/rpmlib.h
62 pkginclude_HEADERS += lib/rpmal.h
63 pkginclude_HEADERS += lib/rpmds.h
64 pkginclude_HEADERS += lib/rpmfi.h
65 pkginclude_HEADERS += lib/rpmgi.h
66 pkginclude_HEADERS += lib/rpmps.h
67 pkginclude_HEADERS += lib/rpmtag.h
68 pkginclude_HEADERS += lib/rpmte.h
69 pkginclude_HEADERS += lib/rpmts.h
70 pkginclude_HEADERS += lib/rpmtypes.h
71 pkginclude_HEADERS += lib/rpmvf.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
82
83 rpmlibexec_PROGRAMS =   rpmb rpmd rpmi rpmk rpmq
84 rpmconfig_SCRIPTS =     find-provides find-requires mkinstalldirs \
85                         config.guess config.sub
86 DISTCLEANFILES = find-provides
87 DISTCLEANFILES += find-requires
88
89 rpm_SOURCES =           rpmqv.c debug.h system.h
90 rpm_CPPFLAGS =          $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
91 rpm_LDADD =             build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
92 rpm_LDADD +=            @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
93
94 rpmb_SOURCES =          build.c rpmqv.c build.h debug.h system.h
95 rpmb_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMBT
96 rpmb_LDADD =            build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
97 rpmb_LDADD +=           @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
98
99 rpmd_SOURCES =          rpmqv.c debug.h system.h
100 rpmd_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMDB
101 rpmd_LDADD =            lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
102 rpmd_LDADD +=           @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
103
104 rpmi_SOURCES =          rpmqv.c debug.h system.h
105 rpmi_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMEIU
106 rpmi_LDADD =            lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
107 rpmi_LDADD +=           @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
108
109 rpmk_SOURCES =          rpmqv.c debug.h system.h
110 rpmk_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMK
111 rpmk_LDADD =            lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
112 rpmk_LDADD +=           @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
113
114 rpmq_SOURCES =          rpmqv.c debug.h system.h
115 rpmq_CPPFLAGS =         $(AM_CPPFLAGS) -DIAM_RPMQV
116 rpmq_LDADD =            build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
117 rpmq_LDADD +=           @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
118
119 rpm2cpio_SOURCES =      rpm2cpio.c debug.h system.h
120 rpm2cpio_LDADD =        lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
121 rpm2cpio_LDADD +=       @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
122
123
124 if LIBELF
125 if LIBDWARF
126 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
127
128 rpmlibexec_PROGRAMS +=  debugedit
129 debugedit_SOURCES =     tools/debugedit.c tools/hashtab.c tools/hashtab.h
130 debugedit_LDADD =       rpmio/librpmio.la
131 debugedit_LDADD +=      @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
132 endif
133 endif
134
135 rpmlibexec_PROGRAMS +=  javadeps
136 javadeps_SOURCES =      tools/javadeps.c
137 javadeps_LDADD =
138
139 rpmlibexec_PROGRAMS +=  rpmcache
140 rpmcache_SOURCES =      tools/rpmcache.c
141 rpmcache_LDADD =        lib/librpm.la
142
143 rpmlibexec_PROGRAMS +=  rpmdeps
144 rpmdeps_SOURCES =       tools/rpmdeps.c
145 rpmdeps_LDADD =         build/librpmbuild.la
146
147 bin_PROGRAMS +=         rpmgraph
148 rpmgraph_SOURCES =      tools/rpmgraph.c
149 rpmgraph_LDADD =        lib/librpm.la
150
151 dist_bin_SCRIPTS =      scripts/gendiff
152
153 check_PROGRAMS =        dumpdb
154 dumpdb_SOURCES =        tools/dumpdb.c
155 dumpdb_LDADD =          lib/librpm.la
156
157 check_PROGRAMS +=       convertdb1
158 convertdb1_SOURCES =    tools/convertdb1.c
159 convertdb1_LDADD =      lib/librpm.la
160
161 check_PROGRAMS +=       rpminject
162 rpminject_SOURCES =     tools/rpminject.c
163 rpminject_LDADD =       build/librpmbuild.la
164
165 check_PROGRAMS +=       rpmsort
166 rpmsort_SOURCES =       tools/rpmsort.c
167 rpmsort_LDADD =         lib/librpm.la
168
169 rpmconfig_DATA = rpmrc
170 rpmrc: $(top_srcdir)/rpmrc.in
171         @$(SED) \
172           -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
173           < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
174           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
175 CLEANFILES += rpmrc.tmp rpmrc
176 EXTRA_DIST += rpmrc.in
177
178 rpmconfig_DATA += macros
179 macros: $(top_srcdir)/macros.in
180         @$(SED) \
181           -e "s,[@]varprefix[@],$(localstatedir),g" \
182           < $(top_srcdir)/macros.in > macros.tmp \
183           && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
184 CLEANFILES += macros.tmp macros
185 EXTRA_DIST += macros.in
186
187 noinst_DATA = platform
188 platform: $(top_srcdir)/platform.in
189         @$(SED) \
190           -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
191           < $(top_srcdir)/platform.in > platform.tmp \
192           && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
193 CLEANFILES += platform.tmp platform
194 EXTRA_DIST += platform.in
195
196 pkgconfig_DATA = rpm.pc
197 rpm.pc: $(top_srcdir)/rpm.pc.in
198         @$(SED) \
199           -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
200           < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
201           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
202 CLEANFILES += rpm.pc.tmp rpm.pc
203 EXTRA_DIST += rpm.pc.in
204
205 rpmconfig_DATA += rpmpopt-$(VERSION)
206 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
207         @$(SED) \
208           -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
209           < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
210           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
211 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
212 EXTRA_DIST += rpmpopt.in
213
214 usrsrcdir = $(prefix)/src
215
216 rpmvardir = $(localstatedir)/lib/rpm
217 rpmvar_DATA =
218
219 install-exec-hook:
220         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
221         @@LN_S@ rpmb $(DESTDIR)$(rpmlibexecdir)/rpmt
222         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
223         @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpme
224         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
225         @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpmu
226         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
227         @@LN_S@ rpmq $(DESTDIR)$(rpmlibexecdir)/rpmv
228         rm -f $(DESTDIR)$(bindir)/rpmbuild
229         @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
230         rm -f $(DESTDIR)$(bindir)/rpmquery
231         @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
232         rm -f $(DESTDIR)$(bindir)/rpmverify
233         @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
234         rm -f $(DESTDIR)$(bindir)/rpmsign
235         @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
236         rm -f $(DESTDIR)$(bindir)/rpmdb ; \
237         @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
238         for bf in e i u ; do \
239             rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
240             @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
241         done
242
243 install-data-local:
244         @case "@host_os@" in \
245         solaris*|linux*|darwin*) \
246            DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
247         esac
248         @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
249
250 # XXX to appease distcheck we need to remove "stuff" here...
251 uninstall-local:
252         @rm -rf $(DESTDIR)/$(rpmconfigdir)/platform
253         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
254         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
255         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
256         @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
257         @rm -f $(DESTDIR)$(bindir)/rpmquery
258         @rm -f $(DESTDIR)$(bindir)/rpmbuild
259         @rm -f $(DESTDIR)$(bindir)/rpmu
260         @rm -f $(DESTDIR)$(bindir)/rpmsign
261         @rm -f $(DESTDIR)$(bindir)/rpme
262         @rm -f $(DESTDIR)$(bindir)/rpmverify
263         @rm -f $(DESTDIR)$(bindir)/rpmdb
264         @rm -f $(DESTDIR)$(bindir)/rpmi
265
266 MAINTAINERCLEANFILES = ChangeLog
267
268 # Build hacking docs only on request
269 if HACKINGDOCS
270 if DOXYGEN
271 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
272         $(SED) \
273           -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
274           -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
275           -e "s,[@]PACKAGE[@],$(PACKAGE)," \
276           -e "s,[@]VERSION[@],$(VERSION)," \
277         < $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
278
279 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
280         @DOXYGEN@ doc/hacking.doxy
281 noinst_DATA += doc/hacking/html/index.html
282 endif
283 endif
284 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
285
286 # Always build librpm docs
287 if DOXYGEN
288 doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
289         files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
290         $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
291           -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
292           -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
293           -e "s,[@]PACKAGE[@],$(PACKAGE)," \
294           -e "s,[@]VERSION[@],$(VERSION)," \
295         < $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
296
297 doc/librpm/html/index.html: doc/librpm.doxy
298         @DOXYGEN@ doc/librpm.doxy
299 noinst_DATA += doc/librpm/html/index.html
300 endif
301 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
302 EXTRA_DIST += doc/librpm/html
303
304 if WITH_INTERNAL_DB
305 db.h:   $(top_builddir)/db3/db.h
306         $(LN_S) $(top_builddir)/db3/db.h $@
307 BUILT_SOURCES += db.h
308 endif
309 DISTCLEANFILES += db.h
310
311 clean-local:
312         rm -rf doc/hacking/html
313         rm -rf include
314
315 distclean-local:
316         rm -rf Doxytags
317         rm -f stamp-h.in db3/*.orig db3/db3lobjs
318
319 maintainer-clean-local:
320         rm -rf doc/librpm/html
321
322 $(top_srcdir)/preinstall.am: Makefile.am
323         rm -f $(top_srcdir)/preinstall.am
324         @for f in $(HEADERS); do \
325           b=`basename $$f`; \
326           echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
327           echo '        $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
328           echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
329           echo 'CLEANFILES += include/rpm/'$$b  >> $(top_srcdir)/preinstall.am; \
330          done
331
332 include/rpm/$(dirstamp):
333         @$(MKDIR_P) include/rpm
334         @: > include/rpm/$(dirstamp)
335
336 include $(top_srcdir)/preinstall.am