Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 1 | # Makefile for busybox |
| 2 | # |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 3 | # Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 4 | # |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 5 | # Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 6 | # |
| 7 | |
| 8 | LIBUNARCHIVE_AR:=libunarchive.a |
| 9 | ifndef $(LIBUNARCHIVE_DIR) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 10 | LIBUNARCHIVE_DIR:=$(top_builddir)/archival/libunarchive |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 11 | endif |
Bernhard Reutner-Fischer | 309dc2d | 2005-10-13 10:19:35 +0000 | [diff] [blame] | 12 | srcdir=$(top_srcdir)/archival/libunarchive |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 13 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 14 | LIBUNARCHIVE-obj:=$(LIBUNARCHIVE_DIR)/$(LIBUNARCHIVE_AR) |
| 15 | LIBUNARCHIVE-pic:=$(LIBUNARCHIVE_DIR)/$(subst .a,-pic.a,$(LIBUNARCHIVE_AR)) |
| 16 | |
| 17 | libraries-y+=$(LIBUNARCHIVE-obj) |
| 18 | |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 19 | LIBUNARCHIVE-y:= \ |
| 20 | \ |
| 21 | data_skip.o \ |
| 22 | data_extract_all.o \ |
| 23 | data_extract_to_stdout.o \ |
Glenn L McGrath | 61b7904 | 2002-10-19 10:40:55 +0000 | [diff] [blame] | 24 | data_extract_to_buffer.o \ |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 25 | \ |
| 26 | filter_accept_all.o \ |
| 27 | filter_accept_list.o \ |
| 28 | filter_accept_reject_list.o \ |
| 29 | \ |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 30 | header_skip.o \ |
| 31 | header_list.o \ |
| 32 | header_verbose_list.o \ |
| 33 | \ |
Glenn L McGrath | 237ae42 | 2002-11-03 14:05:15 +0000 | [diff] [blame] | 34 | archive_xread_all.o \ |
| 35 | archive_xread_all_eof.o \ |
Glenn L McGrath | 237ae42 | 2002-11-03 14:05:15 +0000 | [diff] [blame] | 36 | \ |
| 37 | seek_by_char.o \ |
| 38 | seek_by_jump.o \ |
| 39 | \ |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 40 | data_align.o \ |
Glenn L McGrath | 9ffd577 | 2002-10-22 01:07:32 +0000 | [diff] [blame] | 41 | find_list_entry.o \ |
Glenn L McGrath | 5699b85 | 2003-11-15 23:19:05 +0000 | [diff] [blame] | 42 | open_transformer.o \ |
Glenn L McGrath | e81fc5f | 2003-10-28 10:44:58 +0000 | [diff] [blame] | 43 | init_handle.o |
Glenn L McGrath | 7ca04f3 | 2002-09-25 02:47:48 +0000 | [diff] [blame] | 44 | |
Eric Andersen | 762c64f | 2004-04-05 13:03:34 +0000 | [diff] [blame] | 45 | GUNZIP_FILES:= check_header_gzip.o decompress_unzip.o |
Glenn L McGrath | e81fc5f | 2003-10-28 10:44:58 +0000 | [diff] [blame] | 46 | DPKG_FILES:= \ |
| 47 | get_header_ar.o \ |
| 48 | unpack_ar_archive.o \ |
| 49 | get_header_tar.o \ |
| 50 | filter_accept_list_reassign.o |
| 51 | |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 52 | LIBUNARCHIVE-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o |
Glenn L McGrath | e81fc5f | 2003-10-28 10:44:58 +0000 | [diff] [blame] | 53 | LIBUNARCHIVE-$(CONFIG_BUNZIP2) += decompress_bunzip2.o |
Rob Landley | c1d6990 | 2006-01-20 18:28:50 +0000 | [diff] [blame] | 54 | LIBUNARCHIVE-$(CONFIG_UNLZMA) += decompress_unlzma.o |
Glenn L McGrath | e81fc5f | 2003-10-28 10:44:58 +0000 | [diff] [blame] | 55 | LIBUNARCHIVE-$(CONFIG_CPIO) += get_header_cpio.o |
| 56 | LIBUNARCHIVE-$(CONFIG_DPKG) += $(DPKG_FILES) |
| 57 | LIBUNARCHIVE-$(CONFIG_DPKG_DEB) += $(DPKG_FILES) |
| 58 | LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_GZ) += $(GUNZIP_FILES) get_header_tar_gz.o |
| 59 | LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_BZ2) += decompress_bunzip2.o get_header_tar_bz2.o |
Rob Landley | c1d6990 | 2006-01-20 18:28:50 +0000 | [diff] [blame] | 60 | LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_LZMA) += decompress_unlzma.o get_header_tar_lzma.o |
Glenn L McGrath | e81fc5f | 2003-10-28 10:44:58 +0000 | [diff] [blame] | 61 | LIBUNARCHIVE-$(CONFIG_GUNZIP) += $(GUNZIP_FILES) |
Eric Andersen | 762c64f | 2004-04-05 13:03:34 +0000 | [diff] [blame] | 62 | LIBUNARCHIVE-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += decompress_uncompress.o |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 63 | LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o |
Glenn L McGrath | e81fc5f | 2003-10-28 10:44:58 +0000 | [diff] [blame] | 64 | LIBUNARCHIVE-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o |
| 65 | LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o |
Glenn L McGrath | 7b215b9 | 2003-11-14 09:22:24 +0000 | [diff] [blame] | 66 | LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o |
Rob Landley | c1d6990 | 2006-01-20 18:28:50 +0000 | [diff] [blame] | 67 | LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_LZMA) += decompress_unlzma.o get_header_tar_lzma.o |
Glenn L McGrath | e81fc5f | 2003-10-28 10:44:58 +0000 | [diff] [blame] | 68 | LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_GZIP) += $(GUNZIP_FILES) get_header_tar_gz.o |
Eric Andersen | 762c64f | 2004-04-05 13:03:34 +0000 | [diff] [blame] | 69 | LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_COMPRESS) += decompress_uncompress.o |
| 70 | LIBUNARCHIVE-$(CONFIG_UNCOMPRESS) += decompress_uncompress.o |
Glenn L McGrath | e81fc5f | 2003-10-28 10:44:58 +0000 | [diff] [blame] | 71 | LIBUNARCHIVE-$(CONFIG_UNZIP) += $(GUNZIP_FILES) |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 72 | |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 73 | |
Rob Landley | 2d2c868 | 2005-09-14 15:41:18 +0000 | [diff] [blame] | 74 | LIBUNARCHIVE-y:=$(sort $(LIBUNARCHIVE-y)) |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 75 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 76 | LIBUNARCHIVE_SRC-y:=$(patsubst %,$(srcdir)/%,$(subst .o,.c,$(LIBUNARCHIVE-y))) |
| 77 | LIBUNARCHIVE_SRC-a:=$(wildcard $(srcdir)/*.c) |
| 78 | LIBRARY_SRC-y+=$(LIBUNARCHIVE_SRC-y) |
| 79 | LIBRARY_SRC-a+=$(LIBUNARCHIVE_SRC-a) |
| 80 | |
| 81 | $(LIBUNARCHIVE_DIR)/$(LIBUNARCHIVE_AR): $(patsubst %,$(LIBUNARCHIVE_DIR)/%,$(LIBUNARCHIVE-y)) |
| 82 | $(AR) $(ARFLAGS) $(@) $(^) |
| 83 | |
| 84 | $(LIBUNARCHIVE_DIR)/%.o: $(srcdir)/%.c |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 85 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< |
| 86 | |