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