target/sdk: fix parallel build calls
[openwrt/staging/chunkeey.git] / target / sdk / files / 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 TOPDIR:=${CURDIR}
10 LC_ALL:=C
11 LANG:=C
12 SDK:=1
13 export TOPDIR LC_ALL LANG SDK
14
15 world:
16
17 include $(TOPDIR)/include/host.mk
18
19 ifneq ($(OPENWRT_BUILD),1)
20 override OPENWRT_BUILD=1
21 export OPENWRT_BUILD
22
23 empty:=
24 space:= $(empty) $(empty)
25 _SINGLE=export MAKEFLAGS=$(space);
26
27 include $(TOPDIR)/include/debug.mk
28 include $(TOPDIR)/include/depends.mk
29 include $(TOPDIR)/include/toplevel.mk
30 else
31 include rules.mk
32 include $(INCLUDE_DIR)/depends.mk
33 include $(INCLUDE_DIR)/subdir.mk
34 include package/Makefile
35
36 $(package/stamp-compile): $(BUILD_DIR)/.prepared
37 $(BUILD_DIR)/.prepared: Makefile
38 @mkdir -p $$(dirname $@)
39 @mkdir -p bin/packages
40 @touch $@
41
42 clean: FORCE
43 rm -rf $(BUILD_DIR) $(BIN_DIR)
44
45 dirclean: clean
46 rm -rf $(TMP_DIR)
47
48 # check prerequisites before starting to build
49 prereq: $(package/stamp-prereq) ;
50
51 world: prepare $(package/stamp-compile) FORCE
52 @$(MAKE) package/index
53
54 .PHONY: clean dirclean prereq prepare world
55
56 endif