Automake portability diddles.
[platform/upstream/rpm.git] / Makefile.am
1 # Top level Makefile for rpm
2
3 AUTOMAKE_OPTIONS = 1.4 foreign
4
5 EXTRA_DIST = CHANGES CREDITS GROUPS README.amiga INSTALL \
6         RPM-GPG-KEY RPM-PGP-KEY \
7         autodeps/none autodeps/*.prov autodeps/*.req autogen.sh \
8         gendiff po/*.in po/*.po po/rpm.pot \
9         python/*.am python/*.in python/*.c python/*.h python/testit \
10         rpm.magic rpmpopt rpm.spec
11
12 EXTRA_PROGRAMS = rpmconvert
13
14 # XXX TODO: python perl
15 SUBDIRS = intl po popt build lib misc tools scripts tests doc .
16
17 INCLUDES = -I$(top_srcdir)/build -I$(top_srcdir)/lib -I$(top_srcdir)/popt \
18         @INCPATH@
19
20 myldflags= -L$(top_builddir)/build -L$(top_builddir)/lib -L$(top_builddir)/popt
21 # XXX libtool generates dependent libs.
22 myldadd= $(top_builddir)/build/librpmbuild.la \
23         @INTLLIBS@ @LIBMISC@
24
25 LDFLAGS = @LDFLAGS_STATIC@ $(myldflags)
26 LDADD = $(myldadd)
27
28 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
29 rpmbin_PROGRAMS = rpm
30
31 bin_PROGRAMS =          rpm2cpio
32 bin_SCRIPTS =           gendiff
33
34 noinst_PROGRAMS =       @BUILD_RPMCONVERT@
35
36 pkglibdir = @RPMCONFIGDIR@
37 pkglib_DATA = rpmrc rpmpopt macros
38 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
39         config.guess config.sub
40
41 noinst_HEADERS = \
42         acconfig.h      build.h         system.h
43
44 rpm_SOURCES =           build.c rpm.c
45
46 $(PROGRAMS):            $(myldadd)
47
48 .PHONY: lclint
49 lclint:
50         lclint ${DEFS} ${INCLUDES} ${rpm_SOURCES}
51
52 CVSTAG = r$(subst .,-,$(VERSION))
53
54 rpm2cpio_SOURCES =      rpm2cpio.c
55
56 rpmconvert_SOURCES =    convertdb.c oldrpmdb.c
57 ## Libmisc.a is required for rpmconvert.
58 rpmconvert_LDADD =      $(myldadd) -lgdbm
59
60 install-data-local:
61         @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
62         @rm -f $(DESTDIR)/$(libdir)/rpmrc
63         @ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
64         @rm -f $(DESTDIR)/$(libdir)/rpmpopt
65         @ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
66         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
67         @case "@build_cpu@" in \
68         *86) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i386 ;;\
69         alpha*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/alpha ;;\
70         sparc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc;\
71                 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc64 ;;\
72         powerpc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/ppc ;;\
73         esac
74         @case "@build_os@" in \
75         mint) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/m68kmint ;;\
76         *) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@ ;;\
77         esac
78         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
79         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
80         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
81         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
82         @$(mkinstalldirs) $(DESTDIR)/var/tmp
83
84 .PHONY: tar
85 tar:
86         rm -rf /tmp/rpm-$(VERSION)
87         $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install
88         cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
89
90 .PHONY: noconfig
91 noconfig:
92         find . -name "Makefile" -exec rm {} \; 
93         rm -f *gz *rpm config.*
94
95 .PHONY: archive
96 archive: 
97         @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
98             echo " " ; \
99             echo "==> Please resolve differences between the repository and" ; \
100             echo "==> your rpm check out before tagging." ; \
101             echo " " ; \
102             cvs -n up ; \
103             echo " " ; \
104             exit 1 ; \
105         }
106         @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
107         @make dist
108         @echo " "
109         @echo "The final archive is ./rpm-$(VERSION).tar.gz."
110
111 .PHONY: nextsrpm
112 nextsrpm: all archive
113         @sudo ./rpm -ta rpm-$(VERSION).tar.gz
114
115 .PHONY: doxygen
116 doxygen: Doxyfile
117         rm -rf doxygen
118         mkdir -p doxygen
119         doxygen