blob: 2b49398dfc2e330502a898ceb90a522fed961d3c [file] [log] [blame]
Eric Andersen85208e22002-04-12 12:05:57 +00001# Makefile for busybox
2#
Eric Andersenc7bda1c2004-03-15 08:29:22 +00003# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
Eric Andersen85208e22002-04-12 12:05:57 +00004#
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +00005# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
Eric Andersen85208e22002-04-12 12:05:57 +00006#
7
8LIBUNARCHIVE_AR:=libunarchive.a
9ifndef $(LIBUNARCHIVE_DIR)
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000010LIBUNARCHIVE_DIR:=$(top_builddir)/archival/libunarchive
Eric Andersen85208e22002-04-12 12:05:57 +000011endif
Bernhard Reutner-Fischer309dc2d2005-10-13 10:19:35 +000012srcdir=$(top_srcdir)/archival/libunarchive
Eric Andersen85208e22002-04-12 12:05:57 +000013
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000014LIBUNARCHIVE-obj:=$(LIBUNARCHIVE_DIR)/$(LIBUNARCHIVE_AR)
15LIBUNARCHIVE-pic:=$(LIBUNARCHIVE_DIR)/$(subst .a,-pic.a,$(LIBUNARCHIVE_AR))
16
17libraries-y+=$(LIBUNARCHIVE-obj)
18
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000019LIBUNARCHIVE-y:= \
20\
21 data_skip.o \
22 data_extract_all.o \
23 data_extract_to_stdout.o \
Glenn L McGrath61b79042002-10-19 10:40:55 +000024 data_extract_to_buffer.o \
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000025\
26 filter_accept_all.o \
27 filter_accept_list.o \
28 filter_accept_reject_list.o \
29\
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000030 header_skip.o \
31 header_list.o \
32 header_verbose_list.o \
33\
Glenn L McGrath237ae422002-11-03 14:05:15 +000034 archive_xread_all.o \
35 archive_xread_all_eof.o \
Glenn L McGrath237ae422002-11-03 14:05:15 +000036\
37 seek_by_char.o \
38 seek_by_jump.o \
39\
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000040 data_align.o \
Glenn L McGrath9ffd5772002-10-22 01:07:32 +000041 find_list_entry.o \
Glenn L McGrath5699b852003-11-15 23:19:05 +000042 open_transformer.o \
Glenn L McGrathe81fc5f2003-10-28 10:44:58 +000043 init_handle.o
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000044
Eric Andersen762c64f2004-04-05 13:03:34 +000045GUNZIP_FILES:= check_header_gzip.o decompress_unzip.o
Glenn L McGrathe81fc5f2003-10-28 10:44:58 +000046DPKG_FILES:= \
47 get_header_ar.o \
48 unpack_ar_archive.o \
49 get_header_tar.o \
50 filter_accept_list_reassign.o
51
Eric Andersenc7bda1c2004-03-15 08:29:22 +000052LIBUNARCHIVE-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o
Glenn L McGrathe81fc5f2003-10-28 10:44:58 +000053LIBUNARCHIVE-$(CONFIG_BUNZIP2) += decompress_bunzip2.o
Rob Landleyc1d69902006-01-20 18:28:50 +000054LIBUNARCHIVE-$(CONFIG_UNLZMA) += decompress_unlzma.o
Glenn L McGrathe81fc5f2003-10-28 10:44:58 +000055LIBUNARCHIVE-$(CONFIG_CPIO) += get_header_cpio.o
56LIBUNARCHIVE-$(CONFIG_DPKG) += $(DPKG_FILES)
57LIBUNARCHIVE-$(CONFIG_DPKG_DEB) += $(DPKG_FILES)
58LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_GZ) += $(GUNZIP_FILES) get_header_tar_gz.o
59LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_BZ2) += decompress_bunzip2.o get_header_tar_bz2.o
Rob Landleyc1d69902006-01-20 18:28:50 +000060LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_LZMA) += decompress_unlzma.o get_header_tar_lzma.o
Glenn L McGrathe81fc5f2003-10-28 10:44:58 +000061LIBUNARCHIVE-$(CONFIG_GUNZIP) += $(GUNZIP_FILES)
Eric Andersen762c64f2004-04-05 13:03:34 +000062LIBUNARCHIVE-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += decompress_uncompress.o
Eric Andersenc7bda1c2004-03-15 08:29:22 +000063LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o
Glenn L McGrathe81fc5f2003-10-28 10:44:58 +000064LIBUNARCHIVE-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o
65LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o
Glenn L McGrath7b215b92003-11-14 09:22:24 +000066LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o
Rob Landleyc1d69902006-01-20 18:28:50 +000067LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_LZMA) += decompress_unlzma.o get_header_tar_lzma.o
Glenn L McGrathe81fc5f2003-10-28 10:44:58 +000068LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_GZIP) += $(GUNZIP_FILES) get_header_tar_gz.o
Eric Andersen762c64f2004-04-05 13:03:34 +000069LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_COMPRESS) += decompress_uncompress.o
70LIBUNARCHIVE-$(CONFIG_UNCOMPRESS) += decompress_uncompress.o
Glenn L McGrathe81fc5f2003-10-28 10:44:58 +000071LIBUNARCHIVE-$(CONFIG_UNZIP) += $(GUNZIP_FILES)
Eric Andersen85208e22002-04-12 12:05:57 +000072
Eric Andersen85208e22002-04-12 12:05:57 +000073
Rob Landley2d2c8682005-09-14 15:41:18 +000074LIBUNARCHIVE-y:=$(sort $(LIBUNARCHIVE-y))
Eric Andersen85208e22002-04-12 12:05:57 +000075
Bernhard Reutner-Fischer7ca61b62006-01-15 14:04:57 +000076LIBUNARCHIVE_SRC-y:=$(patsubst %,$(srcdir)/%,$(subst .o,.c,$(LIBUNARCHIVE-y)))
77LIBUNARCHIVE_SRC-a:=$(wildcard $(srcdir)/*.c)
78LIBRARY_SRC-y+=$(LIBUNARCHIVE_SRC-y)
79LIBRARY_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 Andersen7daa0762004-10-08 07:46:08 +000085 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
86