summaryrefslogtreecommitdiff
path: root/libc/unistd/Makefile.in
blob: 2e6696fc04b7f724494e23b2e8cffdf617e7b9c8 (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
53
54
55
56
57
58
59
60
# Makefile for uClibc
#
# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#

CSRC:=	sleep.c usleep.c ualarm.c getpass.c sysconf.c getlogin.c \
	fpathconf.c confstr.c pathconf.c swab.c usershell.c \
	getsubopt.c
ifeq ($(ARCH_HAS_MMU),y)
CSRC+= daemon.c
endif

MSRC:=exec.c
MOBJ:=execl.o execv.o execle.o execlp.o execvp.o

ifneq ($(ARCH_HAS_MMU),y)
MOBJ+=__exec_alloc.o
endif

ifeq ($(UCLIBC_HAS_GNU_GETOPT),y)
CSRC+=getopt.c
else
CSRC+=getopt-susv3.c
endif

ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
CSRC:=$(filter-out sleep.c,$(CSRC))
endif

UNISTD_DIR:=$(top_srcdir)libc/unistd
UNISTD_OUT:=$(top_builddir)libc/unistd

UNISTD_SRC:=$(patsubst %.c,$(UNISTD_DIR)/%.c,$(CSRC))
UNISTD_OBJ:=$(patsubst %.c,$(UNISTD_OUT)/%.o,$(CSRC))

UNISTD_MSRC:=$(patsubst %.c,$(UNISTD_DIR)/%.c,$(MSRC))
UNISTD_MOBJ:=$(patsubst %.o,$(UNISTD_OUT)/%.o,$(MOBJ))

UNISTD_DEF:=$(patsubst %,-DL_%,$(subst .o,,$(notdir $(UNISTD_MOBJ))))

UNISTD_OBJS:=$(UNISTD_OBJ) $(UNISTD_MOBJ)

$(UNISTD_MOBJ): $(UNISTD_MSRC)
	$(compile.m)

$(UNISTD_MOBJ:.o=.os): $(UNISTD_MSRC)
	$(compile.m)

libc-a-y+=$(UNISTD_OBJS)
libc-so-y+=$(UNISTD_OBJS:.o=.os)

CFLAGS-multi-y+=$(UNISTD_DEF)
libc-multi-y+=$(UNISTD_SRC) $(UNISTD_MSRC)

objclean-y+=unistd_objclean

unistd_objclean:
	$(RM) $(UNISTD_OUT)/*.{o,os}