fix verbose output with dash as /bin/sh
[librecmc/librecmc.git] / Makefile
1 # Makefile for OpenWrt
2 #
3 # Copyright (C) 2007 OpenWrt.org
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 all: world
10
11 TOPDIR:=${CURDIR}
12 LC_ALL:=C
13 LANG:=C
14 IS_TTY:=${shell tty -s && echo 1 || echo 0}
15 export TOPDIR LC_ALL LANG IS_TTY
16
17 ifneq ($(OPENWRT_BUILD),1)
18   export OPENWRT_BUILD:=1
19   include $(TOPDIR)/include/toplevel.mk
20 else
21   include $(TOPDIR)/include/host.mk
22
23   include rules.mk
24   include $(INCLUDE_DIR)/depends.mk
25   include $(INCLUDE_DIR)/subdir.mk
26   include tools/Makefile
27   include toolchain/Makefile
28
29 clean: FORCE
30         rm -rf build_* bin tmp
31
32 dirclean: clean
33         rm -rf staging_dir_* toolchain_build_* tool_build
34
35 distclean: dirclean config-clean symlinkclean docs/clean
36         rm -rf dl
37
38 toolchain/% package/% target/%: FORCE
39         $(MAKE) -C $(patsubst %/$*,%,$@) $*
40
41 world: .config $(tools/stamp) $(toolchain/stamp) FORCE
42         $(MAKE) target/compile
43         $(MAKE) package/compile
44         $(MAKE) package/install
45         $(MAKE) target/install
46         $(MAKE) package/index
47
48 endif