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