Remove RPM_BUILD_ROOT.
[platform/upstream/rpm.git] / lib / Makefile.am
1 # Makefile for rpm library.
2
3 LINT = splint
4
5 AM_CPPFLAGS = -I. \
6         -I$(top_srcdir) \
7         -I$(top_srcdir)/build \
8         -I$(top_srcdir)/rpmdb \
9         -I$(top_srcdir)/rpmio \
10         @WITH_BEECRYPT_INCLUDE@ \
11         @WITH_POPT_INCLUDE@ \
12         -I$(top_srcdir)/misc \
13         @INCPATH@
14
15 EXTRA_DIST = getdate.y
16
17 EXTRA_PROGRAMS =
18
19 pkgincdir = $(pkgincludedir)
20 pkginc_HEADERS = \
21         misc.h rpmcli.h rpmlib.h \
22         rpmal.h rpmds.h rpmfi.h rpmgi.h rpmps.h rpmsx.h rpmte.h rpmts.h \
23         stringbuf.h
24
25 LIBS =
26
27 usrlibdir = $(libdir)
28 usrlib_LTLIBRARIES = librpm.la
29 librpm_la_SOURCES = \
30         cpio.c cpio.h depends.c formats.c fs.c fsm.c fsm.h getdate.c \
31         manifest.c manifest.h misc.c package.c \
32         poptALL.c poptI.c poptQV.c psm.c psm.h query.c \
33         rpmal.c rpmchecksig.c rpmds.c rpmfi.c rpmgi.c rpminstall.c \
34         rpmlead.c rpmlead.h rpmlibprov.c rpmps.c rpmrc.c rpmsx.c rpmte.c rpmts.c \
35         rpmvercmp.c signature.c signature.h stringbuf.c transaction.c \
36         verify.c rpmlock.c rpmlock.h
37 librpm_la_LDFLAGS = -release 4.4 $(LDFLAGS) \
38         $(top_builddir)/rpmdb/librpmdb.la \
39         $(top_builddir)/rpmio/librpmio.la \
40         @WITH_POPT_LIB@ \
41         @WITH_SELINUX_LIB@ \
42         @LIBINTL@
43
44 getdate.c: getdate.y
45         @echo expect 10 shift/reduce conflicts
46         $(YACC) $(srcdir)/getdate.y
47         -@if test -f y.tab.c; then \
48          { echo "/*@-globstate -statictrans -unqualifiedtrans -noparams @*/";\
49            echo "/*@-retvalint -usedef -varuse -nullderef -nullassign @*/";\
50            echo "/*@-readonlytrans -modunconnomods -compdef -noeffectuncon @*/";\
51            echo "/*@-globs -evalorderuncon -modobserveruncon -modnomods @*/";\
52            echo "/*@unused@*/";\
53            sed  -e 's,y.tab.c,getdate.c,' y.tab.c \
54                 -e 's,^YYSTYPE ,static &,' \
55                 -e 's,^short ,static &,' \
56                 -e 's,^const short ,static &,' \
57                 -e 's,^int yydebug,/*@unused@*/ static &,' \
58                 -e 's,^int ,static &,' ;\
59            echo "/*@=globs =evalorderuncon =modobserveruncon =modnomods @*/";\
60            echo "/*@=readonlytrans =modunconnomods =compdef =noeffectuncon @*/";\
61            echo "/*@=retvalint =usedef =varuse =nullderef =nullassign @*/";\
62            echo "/*@=globstate =statictrans =unqualifiedtrans =noparams @*/";\
63          } > getdate.c ;\
64            rm -f y.tab.c; \
65         else \
66            if test -f getdate.tab.c ; then \
67                mv getdate.tab.c getdate.c ; \
68            else \
69                echo '*** Unable to create getdate.c' ;\
70            fi ;\
71         fi
72
73 BUILT_SOURCES = getdate.c # rpmlib.lcd
74
75 rpmlib.lcd: Makefile.am ${librpm_la_SOURCES} ${pkginc_HEADERS}
76         -lclint ${DEFS} ${AM_CPPFLAGS} ${librpm_la_SOURCES} -dump $@ 2>/dev/null
77
78 .PHONY: sources
79 sources:
80         @echo $(librpm_la_SOURCES:%=lib/%)
81
82 .PHONY: lint
83 lint:
84         $(LINT) $(DEFS) $(AM_CPPFLAGS) $(librpm_la_SOURCES)
85
86 if SELINUX
87 EXTRA_PROGRAMS += setfiles
88 setfiles_SOURCES = setfiles.c
89 setfiles_LDFLAGS = @LDFLAGS_STATIC@
90 setfiles_LDADD = -lselinux \
91         ../rpmio/librpmio.la \
92         @WITH_POPT_LIB@
93 endif
94
95 EXTRA_PROGRAMS += tds
96 tds_SOURCES = tds.c
97 tds_LDADD = librpm.la   
98  
99 EXTRA_PROGRAMS += trb
100 trb_SOURCES = trb.c
101 #trb_LDFLAGS = @LDFLAGS_STATIC@
102 trb_LDADD = librpm.la
103  
104 EXTRA_PROGRAMS += tthread
105 tthread_SOURCES = tthread.c
106 tthread_LDFLAGS =
107 tthread_LDADD = librpm.la @WITH_LIBELF_LIB@
108  
109 EXTRA_PROGRAMS += tsystem
110 tsystem_SOURCES = tsystem.c
111 tsystem_LDFLAGS =
112 tsystem_LDADD = ../rpmio/librpmio.la @WITH_POPT_LIB@
113  
114 EXTRA_PROGRAMS += tre
115 tre_SOURCES = tre.c
116 tre_LDFLAGS = 
117 tre_LDADD = librpm.la -lselinux
118  
119 EXTRA_PROGRAMS += tcpu
120 tcpu_SOURCES = tcpu.c
121 # tcpu_LDFLAGS = @LDFLAGS_STATIC@
122 tcpu_LDADD = librpm.la
123  
124 EXTRA_PROGRAMS += tplatform
125 tplatform_SOURCES = tplatform.c
126 # tplatform_LDFLAGS = @LDFLAGS_STATIC@
127 tplatform_LDADD = librpm.la
128  
129 EXTRA_PROGRAMS += tgi
130 tgi_SOURCES = tgi.c
131 # tgi_LDFLAGS = @LDFLAGS_STATIC@
132 tgi_LDADD = librpm.la
133
134 CLEANFILES = $(EXTRA_PROGRAMS)