- sparc-sun-solaris2.6 portability check.
[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
22 # XXX libtool can/should generate dependent libs.
23 # XXX solaris2.6 cannot use *.la with --all-static (downrev binutils/egcs?)
24 myldadd= \
25         $(top_builddir)/build/.libs/librpmbuild.a \
26         $(top_builddir)/lib/.libs/librpm.a \
27         $(top_builddir)/popt/.libs/libpopt.a \
28         @INTLLIBS@ @LIBMISC@
29
30 LDFLAGS = @LDFLAGS_STATIC@ $(myldflags)
31 LDADD = $(myldadd)
32
33 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
34 rpmbin_PROGRAMS = rpm
35
36 bin_PROGRAMS =          rpm2cpio
37 bin_SCRIPTS =           gendiff
38
39 noinst_PROGRAMS =       @BUILD_RPMCONVERT@
40
41 pkglibdir = @RPMCONFIGDIR@
42 pkglib_DATA = rpmrc rpmpopt macros
43 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
44         config.guess config.sub
45
46 noinst_HEADERS = \
47         acconfig.h      build.h         system.h
48
49 rpm_SOURCES =           build.c rpm.c
50
51 $(PROGRAMS):            $(myldadd)
52
53 .PHONY: lclint
54 lclint:
55         lclint ${DEFS} ${INCLUDES} ${rpm_SOURCES}
56
57 CVSTAG = r$(subst .,-,$(VERSION))
58
59 rpm2cpio_SOURCES =      rpm2cpio.c
60
61 rpmconvert_SOURCES =    convertdb.c oldrpmdb.c
62 ## Libmisc.a is required for rpmconvert.
63 rpmconvert_LDADD =      $(myldadd) -lgdbm
64
65 install-data-local:
66         @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
67         @rm -f $(DESTDIR)/$(libdir)/rpmrc
68         @ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
69         @rm -f $(DESTDIR)/$(libdir)/rpmpopt
70         @ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
71         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
72         @case "@build_cpu@" in \
73         *86) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/i386 ;;\
74         alpha*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/alpha ;;\
75         sparc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc;\
76                 $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/sparc64 ;;\
77         powerpc*) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/ppc ;;\
78         esac
79         @case "@build_os@" in \
80         mint) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/m68kmint ;;\
81         *) $(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@ ;;\
82         esac
83         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
84         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
85         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
86         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
87         @$(mkinstalldirs) $(DESTDIR)/var/tmp
88         ./installplatform ./rpmrc ./macros ./platform
89
90 .PHONY: tar
91 tar:
92         rm -rf /tmp/rpm-$(VERSION)
93         $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install
94         cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
95
96 .PHONY: noconfig
97 noconfig:
98         find . -name "Makefile" -exec rm {} \; 
99         rm -f *gz *rpm config.*
100
101 .PHONY: archive
102 archive: 
103         @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
104             echo " " ; \
105             echo "==> Please resolve differences between the repository and" ; \
106             echo "==> your rpm check out before tagging." ; \
107             echo " " ; \
108             cvs -n up ; \
109             echo " " ; \
110             exit 1 ; \
111         }
112         @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
113         @make dist
114         @echo " "
115         @echo "The final archive is ./rpm-$(VERSION).tar.gz."
116
117 .PHONY: nextsrpm
118 nextsrpm: all archive
119         @sudo ./rpm -ta rpm-$(VERSION).tar.gz
120
121 .PHONY: doxygen
122 doxygen: Doxyfile
123         rm -rf doxygen
124         mkdir -p doxygen
125         doxygen