aboutsummaryrefslogtreecommitdiff
path: root/coreutils/libcoreutils/Makefile.in
blob: 1f0c19e7384f2e2edfb2f87462888dbd6a01d004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Makefile for busybox
#
# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
#
# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
#

LIBCOREUTILS_AR:=libcoreutils.a
ifndef $(LIBCOREUTILS_DIR)
LIBCOREUTILS_DIR:=$(top_builddir)/coreutils/libcoreutils
endif
srcdir=$(top_srcdir)/coreutils/libcoreutils

LIBCOREUTILS_ALL_SRC:= cp_mv_stat.c getopt_mk_fifo_nod.c

LIBCOREUTILS-y:=
LIBCOREUTILS-$(CONFIG_MKFIFO)	+= getopt_mk_fifo_nod.o
LIBCOREUTILS-$(CONFIG_MKNOD)	+= getopt_mk_fifo_nod.o
LIBCOREUTILS-$(CONFIG_INSTALL)	+= cp_mv_stat.o
LIBCOREUTILS-$(CONFIG_CP)	+= cp_mv_stat.o
LIBCOREUTILS-$(CONFIG_MV)	+= cp_mv_stat.o

LIBCOREUTILS-y:=$(sort $(LIBCOREUTILS-y))

LIBCOREUTILS_SRC-y:=$(patsubst %,$(srcdir)/%,$(subst .o,.c,$(LIBCOREUTILS-y)))
LIBCOREUTILS_SRC-a:=$(wildcard $(srcdir)/*.c)
LIBRARY_SRC-y+=$(LIBCOREUTILS_SRC-y)
LIBRARY_SRC-a+=$(LIBCOREUTILS_SRC-a)

LIBCOREUTILS-multi-obj:=$(LIBCOREUTILS_DIR)/$(subst .a,-multi.o,$(LIBCOREUTILS_AR))
LIBCOREUTILS-multi-pic:=$(LIBCOREUTILS_DIR)/$(subst .a,-pic.o,$(LIBCOREUTILS_AR))

# We do not need to build an empty non-pic object/archive
ifneq ($(strip $(LIBCOREUTILS-y)),)
libraries-y+=$(LIBCOREUTILS_DIR)/$(LIBCOREUTILS_AR)
endif
# If we are building libbusybox.so _and_ we will use it ourselves then we
# keep it as small as possible
ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
ifneq ($(strip $(LIBIPROUTE-y)),)
libraries-m+=$(LIBCOREUTILS-multi-pic)
endif
endif

LIBCOREUTILS_OBJS=$(patsubst %,$(LIBCOREUTILS_DIR)/%, $(LIBCOREUTILS-y))

$(LIBCOREUTILS_DIR)/$(LIBCOREUTILS_AR): $(patsubst %,$(LIBCOREUTILS_DIR)/%,$(LIBCOREUTILS-y))
	$(AR) $(ARFLAGS) $(@) $(^)

$(LIBCOREUTILS_DIR)/%.o: $(srcdir)/%.c
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<