blob: da5424e9f62a554b076515e465430a97caaa3baa [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# Makefile for uClibc
2#
3# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
4#
5# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6#
7
8top_builddir=../
9include Rules.mak
10
11ALL_SUBDIRS := $(patsubst %/Makefile,%,$(wildcard */Makefile))
12
13DIRS := $(ALL_SUBDIRS)
14ifneq ($(HAVE_SHARED)$(UCLIBC_HAS_THREADS),yy)
15 DIRS := $(filter-out dlopen,$(DIRS))
16endif
17ifneq ($(findstring -static,$(LDFLAGS)),)
18 DIRS := $(filter-out dlopen,$(DIRS))
19endif
20ifneq ($(UCLIBC_HAS_THREADS),y)
21 DIRS := $(filter-out pthread,$(DIRS))
22endif
23ifneq ($(UCLIBC_HAS_FULL_RPC),y)
24 DIRS := $(filter-out rpc,$(DIRS))
25endif
26ifneq ($(UCLIBC_HAS_REGEX),y)
27 DIRS := $(filter-out regex,$(DIRS))
28endif
29ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
30 DIRS := $(filter-out tls nptl,$(DIRS))
31endif
32ifneq ($(UCLIBC_HAS_WCHAR),y)
33 DIRS := $(filter-out locale-mbwc,$(DIRS))
34endif
35ifneq ($(UCLIBC_HAS_LOCALE),y)
36 DIRS := $(filter-out locale,$(DIRS))
37endif
38ifneq ($(UCLIBC_HAS_CRYPT_IMPL),y)
39 DIRS := $(filter-out crypt,$(DIRS))
40endif
41ifeq ($(HAS_NO_THREADS),y)
42 DIRS := $(filter-out pthread,$(DIRS))
43endif
44
45test check all: run
46
47run: compile subdirs_run
48
49compile: $(top_builddir)/$(LOCAL_INSTALL_PATH) subdirs_compile
50
51$(top_builddir)/$(LOCAL_INSTALL_PATH):
52 $(Q)$(MAKE) -C $(top_builddir) $(LOCAL_INSTALL_PATH)
53
54tags:
55 ctags -R
56
57clean: subdirs_clean
58
59subdirs: $(patsubst %, _dir_%, $(DIRS))
60subdirs_compile: $(patsubst %, _dircompile_%, $(DIRS))
61subdirs_run: $(patsubst %, _dirrun_%, $(DIRS))
62subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
63
64$(patsubst %, _dir_%, $(DIRS)) : dummy
65 $(Q)$(MAKE) -C $(patsubst _dir_%, %, $@)
66
67$(patsubst %, _dirrun_%, $(DIRS)) : dummy
68 $(Q)$(MAKE) -C $(patsubst _dirrun_%, %, $@) run
69
70$(patsubst %, _dircompile_%, $(DIRS)) : dummy
71 $(Q)$(MAKE) -C $(patsubst _dircompile_%, %, $@) compile
72
73$(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
74 $(Q)$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
75
76.PHONY: all check clean dummy subdirs_compile subdirs_run subdirs subdirs_clean test run compile