summaryrefslogtreecommitdiff
path: root/ldso/Makefile.in
blob: 8d3c5fcda2d0f124cd83dc0328f3f07e374cb17b (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
# 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.
#

DIRS=$(shell if test -f $(top_builddir)lib/libc.so ; then echo "ldso libdl" ; else echo "ldso" ; fi)

libs: subdirs

LN_HEADERS      := $(patsubst %, include/%, elf.h)
LN_ARCH_HEADERS := $(patsubst %, include/%, dl-startup.h dl-syscalls.h dl-sysdep.h dl-debug.h)
HEADERS         := $(LN_HEADERS) $(LN_ARCH_HEADERS) include/dl-progname.h

headers-y+=ldso_headers

ldso_headers: $(HEADERS)

$(LN_HEADERS):
	$(LN) -sf $(top_builddir)../$@ $@

$(LN_ARCH_HEADERS):
	$(LN) -sf ../ldso/$(TARGET_ARCH)/$(patsubst include/%,%,$@) $@

include/dl-progname.h:
	echo '#include "$(TARGET_ARCH)/elfinterp.c"' > $@

headers_clean-y+=ldso_headers_clean

ldso_headers_clean:
	$(RM) $(HEADERS)

clean: subdirs_clean ldso_headers_clean

subdirs: $(patsubst %, _dir_%, $(DIRS))
subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))

$(patsubst %, _dir_%, $(DIRS)): ldso_headers
	$(MAKE) -C $(patsubst _dir_%, %, $@)

$(patsubst %, _dirclean_%, $(DIRS)): dummy
	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean

.PHONY: dummy