Merge from vendor branch LIBARCHIVE:
[dragonfly.git] / lib / libarchive / Makefile
CommitLineData
db6b0fac 1# $FreeBSD: src/lib/libarchive/Makefile,v 1.50 2006/09/05 05:59:45 kientzle Exp $
3ca3dfae 2# $DragonFly: src/lib/libarchive/Makefile,v 1.19 2008/05/17 21:53:39 pavalos Exp $
c4708c74
JS
3
4LIB= archive
5
3df3e748 6CONTRIBDIR= ${.CURDIR}/../../contrib/libarchive-2/libarchive
c4708c74
JS
7.PATH: ${CONTRIBDIR}
8
aa126772
PA
9VERSION!= cat ${CONTRIBDIR}/../version
10ARCHIVE_API_MAJOR!= echo ${VERSION} | sed -e 's/[^0-9]/./g' -e 's/\..*//'
11ARCHIVE_API_MINOR!= echo ${VERSION} | sed -e 's/[^0-9]/./g' -e 's/[0-9]*\.//' -e 's/\..*//'
468c6846
MD
12ARCHIVE_API_REV!= echo ${VERSION} | sed -e 's/[^0-9]/./g' -e 's/.*\.//'
13# Can't use /usr/bin/printf to format the version stamp here, because
14# that's not available during installworld. Fortunately, awk is.
15ARCHIVE_VERSION_STAMP!= echo ${ARCHIVE_API_MAJOR} ${ARCHIVE_API_MINOR} ${ARCHIVE_API_REV} | awk '{printf("%d%03d%03d",$$1,$$2,$$3)}'
16
aa126772 17SHLIB_MAJOR= 5
a47b8f9f 18CFLAGS+= -DPLATFORM_CONFIG_H=\"config.h\"
3ca3dfae 19CFLAGS+= -I${.OBJDIR} -I${.CURDIR} -I${CONTRIBDIR}
c4708c74
JS
20WARNS?= 6
21
22INCS= archive.h archive_entry.h
23
24# Note: archive.h does need to be listed here, since it's built
25SRCS= archive.h \
26 archive_check_magic.c \
27 archive_entry.c \
3df3e748 28 archive_entry_copy_stat.c \
00dda0cb 29 archive_entry_link_resolver.c \
3df3e748 30 archive_entry_stat.c \
00dda0cb 31 archive_entry_strmode.c \
c4708c74 32 archive_read.c \
c4708c74
JS
33 archive_read_data_into_fd.c \
34 archive_read_extract.c \
35 archive_read_open_fd.c \
36 archive_read_open_file.c \
db6b0fac
PA
37 archive_read_open_filename.c \
38 archive_read_open_memory.c \
c4708c74
JS
39 archive_read_support_compression_all.c \
40 archive_read_support_compression_bzip2.c \
41 archive_read_support_compression_compress.c \
42 archive_read_support_compression_gzip.c \
43 archive_read_support_compression_none.c \
b5885901 44 archive_read_support_compression_program.c \
c4708c74 45 archive_read_support_format_all.c \
b5885901 46 archive_read_support_format_ar.c \
c4708c74 47 archive_read_support_format_cpio.c \
aa126772 48 archive_read_support_format_empty.c \
720c3558 49 archive_read_support_format_iso9660.c \
9cc0534b 50 archive_read_support_format_mtree.c \
c4708c74 51 archive_read_support_format_tar.c \
720c3558 52 archive_read_support_format_zip.c \
c4708c74
JS
53 archive_string.c \
54 archive_string_sprintf.c \
55 archive_util.c \
aa126772 56 archive_virtual.c \
c4708c74 57 archive_write.c \
aa126772
PA
58 archive_write_disk.c \
59 archive_write_disk_set_standard_lookup.c \
c4708c74
JS
60 archive_write_open_fd.c \
61 archive_write_open_file.c \
db6b0fac
PA
62 archive_write_open_filename.c \
63 archive_write_open_memory.c \
c4708c74
JS
64 archive_write_set_compression_bzip2.c \
65 archive_write_set_compression_gzip.c \
66 archive_write_set_compression_none.c \
b5885901 67 archive_write_set_compression_program.c \
c4708c74 68 archive_write_set_format.c \
b5885901 69 archive_write_set_format_ar.c \
c4708c74
JS
70 archive_write_set_format_by_name.c \
71 archive_write_set_format_cpio.c \
468c6846 72 archive_write_set_format_cpio_newc.c \
c4708c74
JS
73 archive_write_set_format_pax.c \
74 archive_write_set_format_shar.c \
b5885901
PA
75 archive_write_set_format_ustar.c \
76 filter_fork.c
c4708c74 77
c4708c74
JS
78MAN= archive_entry.3 \
79 archive_read.3 \
80 archive_util.3 \
81 archive_write.3 \
95993d95 82 archive_write_disk.3 \
14194099 83 cpio.5 \
c4708c74
JS
84 libarchive.3 \
85 libarchive-formats.5 \
b5885901 86 libarchive_internals.3 \
14194099 87 mtree.5 \
c4708c74
JS
88 tar.5
89
90MLINKS+= archive_entry.3 archive_entry_acl_add_entry.3
91MLINKS+= archive_entry.3 archive_entry_acl_add_entry_w.3
92MLINKS+= archive_entry.3 archive_entry_acl_clear.3
93MLINKS+= archive_entry.3 archive_entry_acl_count.3
94MLINKS+= archive_entry.3 archive_entry_acl_next.3
95MLINKS+= archive_entry.3 archive_entry_acl_next_w.3
96MLINKS+= archive_entry.3 archive_entry_acl_reset.3
97MLINKS+= archive_entry.3 archive_entry_acl_text_w.3
b6989f5b
SW
98MLINKS+= archive_entry.3 archive_entry_atime.3
99MLINKS+= archive_entry.3 archive_entry_atime_nsec.3
c4708c74
JS
100MLINKS+= archive_entry.3 archive_entry_clear.3
101MLINKS+= archive_entry.3 archive_entry_clone.3
102MLINKS+= archive_entry.3 archive_entry_copy_fflags_text_w.3
4b967b96 103MLINKS+= archive_entry.3 archive_entry_copy_gname.3
c4708c74 104MLINKS+= archive_entry.3 archive_entry_copy_gname_w.3
b6989f5b 105MLINKS+= archive_entry.3 archive_entry_copy_hardlink.3
c4708c74
JS
106MLINKS+= archive_entry.3 archive_entry_copy_hardlink_w.3
107MLINKS+= archive_entry.3 archive_entry_copy_pathname_w.3
108MLINKS+= archive_entry.3 archive_entry_copy_stat.3
aa126772 109MLINKS+= archive_entry.3 archive_entry_copy_symlink.3
c4708c74 110MLINKS+= archive_entry.3 archive_entry_copy_symlink_w.3
4b967b96 111MLINKS+= archive_entry.3 archive_entry_copy_uname.3
c4708c74 112MLINKS+= archive_entry.3 archive_entry_copy_uname_w.3
b6989f5b 113MLINKS+= archive_entry.3 archive_entry_dev.3
e01e3f27
PA
114MLINKS+= archive_entry.3 archive_entry_devmajor.3
115MLINKS+= archive_entry.3 archive_entry_devminor.3
116MLINKS+= archive_entry.3 archive_entry_filetype.3
c4708c74
JS
117MLINKS+= archive_entry.3 archive_entry_fflags.3
118MLINKS+= archive_entry.3 archive_entry_fflags_text.3
119MLINKS+= archive_entry.3 archive_entry_free.3
120MLINKS+= archive_entry.3 archive_entry_gid.3
121MLINKS+= archive_entry.3 archive_entry_gname.3
c4708c74
JS
122MLINKS+= archive_entry.3 archive_entry_hardlink.3
123MLINKS+= archive_entry.3 archive_entry_ino.3
124MLINKS+= archive_entry.3 archive_entry_mode.3
125MLINKS+= archive_entry.3 archive_entry_mtime.3
126MLINKS+= archive_entry.3 archive_entry_mtime_nsec.3
127MLINKS+= archive_entry.3 archive_entry_new.3
e01e3f27 128MLINKS+= archive_entry.3 archive_entry_nlink.3
c4708c74
JS
129MLINKS+= archive_entry.3 archive_entry_pathname.3
130MLINKS+= archive_entry.3 archive_entry_pathname_w.3
131MLINKS+= archive_entry.3 archive_entry_rdev.3
132MLINKS+= archive_entry.3 archive_entry_rdevmajor.3
133MLINKS+= archive_entry.3 archive_entry_rdevminor.3
e01e3f27
PA
134MLINKS+= archive_entry.3 archive_entry_set_atime.3
135MLINKS+= archive_entry.3 archive_entry_set_ctime.3
136MLINKS+= archive_entry.3 archive_entry_set_dev.3
137MLINKS+= archive_entry.3 archive_entry_set_devmajor.3
138MLINKS+= archive_entry.3 archive_entry_set_devminor.3
139MLINKS+= archive_entry.3 archive_entry_set_filetype.3
c4708c74
JS
140MLINKS+= archive_entry.3 archive_entry_set_fflags.3
141MLINKS+= archive_entry.3 archive_entry_set_gid.3
142MLINKS+= archive_entry.3 archive_entry_set_gname.3
143MLINKS+= archive_entry.3 archive_entry_set_hardlink.3
144MLINKS+= archive_entry.3 archive_entry_set_link.3
145MLINKS+= archive_entry.3 archive_entry_set_mode.3
b6989f5b 146MLINKS+= archive_entry.3 archive_entry_set_mtime.3
c4708c74
JS
147MLINKS+= archive_entry.3 archive_entry_set_pathname.3
148MLINKS+= archive_entry.3 archive_entry_set_rdevmajor.3
149MLINKS+= archive_entry.3 archive_entry_set_rdevminor.3
150MLINKS+= archive_entry.3 archive_entry_set_size.3
151MLINKS+= archive_entry.3 archive_entry_set_symlink.3
152MLINKS+= archive_entry.3 archive_entry_set_uid.3
153MLINKS+= archive_entry.3 archive_entry_set_uname.3
154MLINKS+= archive_entry.3 archive_entry_size.3
155MLINKS+= archive_entry.3 archive_entry_stat.3
156MLINKS+= archive_entry.3 archive_entry_symlink.3
157MLINKS+= archive_entry.3 archive_entry_uid.3
158MLINKS+= archive_entry.3 archive_entry_uname.3
b6989f5b 159MLINKS+= archive_read.3 archive_read_close.3
c4708c74
JS
160MLINKS+= archive_read.3 archive_read_data.3
161MLINKS+= archive_read.3 archive_read_data_block.3
162MLINKS+= archive_read.3 archive_read_data_into_buffer.3
163MLINKS+= archive_read.3 archive_read_data_into_fd.3
164MLINKS+= archive_read.3 archive_read_data_skip.3
165MLINKS+= archive_read.3 archive_read_extract.3
166MLINKS+= archive_read.3 archive_read_extract_set_progress_callback.3
167MLINKS+= archive_read.3 archive_read_finish.3
168MLINKS+= archive_read.3 archive_read_new.3
169MLINKS+= archive_read.3 archive_read_next_header.3
170MLINKS+= archive_read.3 archive_read_open.3
db6b0fac
PA
171MLINKS+= archive_read.3 archive_read_open2.3
172MLINKS+= archive_read.3 archive_read_open_FILE.3
c4708c74 173MLINKS+= archive_read.3 archive_read_open_fd.3
db6b0fac
PA
174MLINKS+= archive_read.3 archive_read_open_filename.3
175MLINKS+= archive_read.3 archive_read_open_memory.3
c4708c74
JS
176MLINKS+= archive_read.3 archive_read_support_compression_all.3
177MLINKS+= archive_read.3 archive_read_support_compression_bzip2.3
178MLINKS+= archive_read.3 archive_read_support_compression_compress.3
179MLINKS+= archive_read.3 archive_read_support_compression_gzip.3
180MLINKS+= archive_read.3 archive_read_support_compression_none.3
e01e3f27 181MLINKS+= archive_read.3 archive_read_support_compression_program.3
c4708c74
JS
182MLINKS+= archive_read.3 archive_read_support_format_all.3
183MLINKS+= archive_read.3 archive_read_support_format_cpio.3
aa126772 184MLINKS+= archive_read.3 archive_read_support_format_empty.3
b6989f5b 185MLINKS+= archive_read.3 archive_read_support_format_iso9660.3
c4708c74 186MLINKS+= archive_read.3 archive_read_support_format_tar.3
b6989f5b 187MLINKS+= archive_read.3 archive_read_support_format_zip.3
aa126772 188MLINKS+= archive_util.3 archive_clear_error.3
c4708c74
JS
189MLINKS+= archive_util.3 archive_compression.3
190MLINKS+= archive_util.3 archive_compression_name.3
191MLINKS+= archive_util.3 archive_errno.3
192MLINKS+= archive_util.3 archive_error_string.3
193MLINKS+= archive_util.3 archive_format.3
194MLINKS+= archive_util.3 archive_format_name.3
195MLINKS+= archive_util.3 archive_set_error.3
b6989f5b 196MLINKS+= archive_write.3 archive_write_close.3
c4708c74
JS
197MLINKS+= archive_write.3 archive_write_data.3
198MLINKS+= archive_write.3 archive_write_finish.3
aa126772
PA
199MLINKS+= archive_write.3 archive_write_finish_entry.3
200MLINKS+= archive_write.3 archive_write_get_bytes_per_block.3
c4708c74
JS
201MLINKS+= archive_write.3 archive_write_header.3
202MLINKS+= archive_write.3 archive_write_new.3
203MLINKS+= archive_write.3 archive_write_open.3
db6b0fac 204MLINKS+= archive_write.3 archive_write_open_FILE.3
c4708c74 205MLINKS+= archive_write.3 archive_write_open_fd.3
aa126772
PA
206MLINKS+= archive_write.3 archive_write_open_filename.3
207MLINKS+= archive_write.3 archive_write_open_memory.3
c4708c74 208MLINKS+= archive_write.3 archive_write_set_bytes_in_last_block.3
aa126772 209MLINKS+= archive_write.3 archive_write_set_bytes_per_block.3
c4708c74
JS
210MLINKS+= archive_write.3 archive_write_set_compression_bzip2.3
211MLINKS+= archive_write.3 archive_write_set_compression_gzip.3
e01e3f27
PA
212MLINKS+= archive_write.3 archive_write_set_compression_none.3
213MLINKS+= archive_write.3 archive_write_set_compression_program.3
b6989f5b 214MLINKS+= archive_write.3 archive_write_set_format_cpio.3
c4708c74 215MLINKS+= archive_write.3 archive_write_set_format_pax.3
b6989f5b 216MLINKS+= archive_write.3 archive_write_set_format_pax_restricted.3
c4708c74 217MLINKS+= archive_write.3 archive_write_set_format_shar.3
b6989f5b 218MLINKS+= archive_write.3 archive_write_set_format_shar_binary.3
c4708c74 219MLINKS+= archive_write.3 archive_write_set_format_ustar.3
95993d95
PA
220MLINKS+= archive_write_disk.3 archive_write_disk_close.3
221MLINKS+= archive_write_disk.3 archive_write_disk_data.3
222MLINKS+= archive_write_disk.3 archive_write_disk_finish.3
223MLINKS+= archive_write_disk.3 archive_write_disk_finish_entry.3
224MLINKS+= archive_write_disk.3 archive_write_disk_header.3
225MLINKS+= archive_write_disk.3 archive_write_disk_new.3
226MLINKS+= archive_write_disk.3 archive_write_disk_set_group_lookup.3
227MLINKS+= archive_write_disk.3 archive_write_disk_set_options.3
228MLINKS+= archive_write_disk.3 archive_write_disk_set_skip_file.3
229MLINKS+= archive_write_disk.3 archive_write_disk_set_standard_lookup.3
230MLINKS+= archive_write_disk.3 archive_write_disk_set_user_lookup.3
c4708c74
JS
231MLINKS+= libarchive.3 archive.3
232
233# Build archive.h from archive.h.in
234archive.h: archive.h.in Makefile
235 cat ${CONTRIBDIR}/archive.h.in | \
3df3e748 236 sed 's/@ARCHIVE_VERSION@/${VERSION}/g' | \
db6b0fac 237 sed 's/@SHLIB_MAJOR@/${SHLIB_MAJOR}/g' | \
00dda0cb
PA
238 sed 's/@LIBARCHIVE_VERSION_STRING@/${VERSION}/g' | \
239 sed 's/@LIBARCHIVE_VERSION@/${ARCHIVE_VERSION_STAMP}/g' | \
db6b0fac 240 sed 's|@ARCHIVE_H_INCLUDE_INTTYPES_H@|#include <inttypes.h> /* For int64_t */|g' | \
c4708c74
JS
241 cat > archive.h
242
243# archive.h needs to be cleaned
244CLEANFILES+= archive.h
245
246.include <bsd.lib.mk>