- use automake defined pkgdata dir for lua script dir instead of hardcoded
[apt.git] / apt-pkg / Makefile.am
1
2 lib_LTLIBRARIES = libapt-pkg.la
3
4 libapt_pkg_la_LIBADD = @RPMLIBS@
5 libapt_pkg_la_LDFLAGS = -version-info 2:0:0 -release @GLIBC_VER@-@LIBSTDCPP_VER@
6
7 AM_CPPFLAGS = -DLIBDIR=\"$(libdir)\" -DPKGDATADIR=\"$(pkgdatadir)\"
8 AM_CPPFLAGS += -I$(top_srcdir)/lua/include -I$(top_srcdir)/lua/local
9
10 if WITH_LUA
11 libapt_pkg_la_LIBADD += $(top_builddir)/lua/liblua.la
12 endif
13
14 libapt_pkg_la_SOURCES = \
15         contrib/cdromutl.cc \
16         contrib/cdromutl.h \
17         contrib/cmndline.cc \
18         contrib/cmndline.h \
19         contrib/configuration.cc \
20         contrib/configuration.h \
21         contrib/crc-16.cc \
22         contrib/crc-16.h \
23         contrib/error.cc \
24         contrib/error.h \
25         contrib/fileutl.cc \
26         contrib/fileutl.h \
27         contrib/hashes.cc \
28         contrib/hashes.h \
29         contrib/md5.cc \
30         contrib/md5.h \
31         contrib/mmap.cc \
32         contrib/mmap.h \
33         contrib/progress.cc \
34         contrib/progress.h \
35         contrib/sha1.cc \
36         contrib/sha1.h \
37         contrib/sptr.h \
38         contrib/strutl.cc \
39         contrib/strutl.h \
40         contrib/system.h \
41         rpm/repomd.cc \
42         rpm/repomd.h \
43         rpm/rpmhandler.cc \
44         rpm/rpmhandler.h \
45         rpm/rpmindexfile.cc \
46         rpm/rpmindexfile.h \
47         rpm/rpmlistparser.cc \
48         rpm/rpmlistparser.h \
49         rpm/rpmmisc.h \
50         rpm/rpmpackagedata.cc \
51         rpm/rpmpackagedata.h \
52         rpm/rpmpm.cc \
53         rpm/rpmpm.h \
54         rpm/rpmshowprogress.h \
55         rpm/rpmrecords.cc \
56         rpm/rpmrecords.h \
57         rpm/rpmsrcrecords.cc \
58         rpm/rpmsrcrecords.h \
59         rpm/rpmsystem.cc \
60         rpm/rpmsystem.h \
61         rpm/rpmversion.cc \
62         rpm/rpmversion.h \
63         acquire.cc \
64         acquire.h \
65         acquire-item.cc \
66         acquire-item.h \
67         acquire-method.cc \
68         acquire-method.h \
69         acquire-worker.cc \
70         acquire-worker.h \
71         algorithms.cc \
72         algorithms.h \
73         cachefile.cc \
74         cachefile.h \
75         cacheiterators.h \
76         clean.cc \
77         clean.h \
78         depcache.cc \
79         depcache.h \
80         indexfile.cc \
81         indexfile.h \
82         init.cc \
83         init.h \
84         luaiface.cc \
85         luaiface.h \
86         orderlist.cc \
87         orderlist.h \
88         packagemanager.cc \
89         packagemanager.h \
90         pkgcache.cc \
91         pkgcachegen.cc \
92         pkgcachegen.h \
93         pkgcache.h \
94         pkgrecords.cc \
95         pkgrecords.h \
96         pkgsystem.cc \
97         pkgsystem.h \
98         policy.cc \
99         policy.h \
100         repository.cc \
101         repository.h \
102         sourcelist.cc \
103         sourcelist.h \
104         srcrecords.cc \
105         srcrecords.h \
106         tagfile.cc \
107         tagfile.h \
108         version.cc \
109         version.h \
110         versionmatch.cc \
111         versionmatch.h
112
113 PRIVATEHEADERS = contrib/system.h
114
115 includedir=${prefix}/include/apt-pkg
116 include_HEADERS = $(filter-out \
117                     $(PRIVATEHEADERS), \
118                     $(filter %.h,$(libapt_pkg_la_SOURCES)))
119
120 # This is a hack to allow us to maintain the original
121 # APT system of a a flat apt-pkg/ header directory.
122 PRIVREALHEADERS = $(PRIVATEHEADERS)
123 PRIVCOPYHEADERS = $(patsubst %.h, \
124                     $(top_builddir)/include/%.h, \
125                     $(notdir $(PRIVREALHEADERS)))
126 REALHEADERS = $(filter-out \
127                 $(PRIVREALHEADERS), \
128                 $(filter %.h,$(libapt_pkg_la_SOURCES)))
129 COPYHEADERS = $(patsubst %.h, \
130                 $(top_builddir)/include/apt-pkg/%.h, \
131                 $(notdir $(REALHEADERS)))
132 REALOBJECTS = $(patsubst %.cc,%.lo,\
133                 $(filter %.cc,$(libapt_pkg_la_SOURCES)))
134 $(REALOBJECTS): $(COPYHEADERS) $(PRIVCOPYHEADERS)
135
136 $(top_builddir)/include/apt-pkg/%: %
137         @$(mkinstalldirs) $(top_builddir)/include/apt-pkg
138         cp -f -p $< $@
139 $(top_builddir)/include/apt-pkg/%: contrib/%
140         @$(mkinstalldirs) $(top_builddir)/include/apt-pkg
141         cp -f -p $< $@
142 $(top_builddir)/include/apt-pkg/%: rpm/%
143         @$(mkinstalldirs) $(top_builddir)/include/apt-pkg
144         cp -f -p $< $@
145 $(top_builddir)/include/%: %
146         @$(mkinstalldirs) $(top_builddir)/include/apt-pkg
147         cp -f -p $< $@
148 $(top_builddir)/include/%: contrib/%
149         @$(mkinstalldirs) $(top_builddir)/include/apt-pkg
150         cp -f -p $< $@
151 $(top_builddir)/include/%: rpm/%
152         @$(mkinstalldirs) $(top_builddir)/include/apt-pkg
153         cp -f -p $< $@
154
155 clean-local:
156         rm -f $(PRIVCOPYHEADERS)
157         rm -rf $(top_builddir)/include/apt-pkg
158