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