ltq-atm/ltq-ptm: re-enable/fix reset_ppe() functionality for VR9
[openwrt/staging/dedeckeh.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 TOPDIR:=${CURDIR}
10 LC_ALL:=C
11 LANG:=C
12 TZ:=UTC
13 export TOPDIR LC_ALL LANG TZ
14
15 empty:=
16 space:= $(empty) $(empty)
17 $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt directory must not include any spaces))
18
19 world:
20
21 export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
22
23 ifneq ($(OPENWRT_BUILD),1)
24 _SINGLE=export MAKEFLAGS=$(space);
25
26 override OPENWRT_BUILD=1
27 export OPENWRT_BUILD
28 GREP_OPTIONS=
29 export GREP_OPTIONS
30 CDPATH=
31 export CDPATH
32 include $(TOPDIR)/include/debug.mk
33 include $(TOPDIR)/include/depends.mk
34 include $(TOPDIR)/include/toplevel.mk
35 else
36 include rules.mk
37 include $(INCLUDE_DIR)/depends.mk
38 include $(INCLUDE_DIR)/subdir.mk
39 include target/Makefile
40 include package/Makefile
41 include tools/Makefile
42 include toolchain/Makefile
43
44 $(toolchain/stamp-compile): $(tools/stamp-compile)
45 $(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
46 $(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
47 $(package/stamp-install): $(package/stamp-compile)
48 $(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
49 check: $(tools/stamp-check) $(toolchain/stamp-check) $(package/stamp-check)
50
51 printdb:
52 @true
53
54 prepare: $(target/stamp-compile)
55
56 clean: FORCE
57 rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages
58
59 dirclean: clean
60 rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/host $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
61 rm -rf $(TMP_DIR)
62
63 ifndef DUMP_TARGET_DB
64 $(BUILD_DIR)/.prepared: Makefile
65 @mkdir -p $$(dirname $@)
66 @touch $@
67
68 tmp/.prereq_packages: .config
69 unset ERROR; \
70 for package in $(sort $(prereq-y) $(prereq-m)); do \
71 $(_SINGLE)$(NO_TRACE_MAKE) -s -r -C package/$$package prereq || ERROR=1; \
72 done; \
73 if [ -n "$$ERROR" ]; then \
74 echo "Package prerequisite check failed."; \
75 false; \
76 fi
77 touch $@
78 endif
79
80 # check prerequisites before starting to build
81 prereq: $(target/stamp-prereq) tmp/.prereq_packages
82 @if [ ! -f "$(INCLUDE_DIR)/site/$(ARCH)" ]; then \
83 echo 'ERROR: Missing site config for architecture "$(ARCH)" !'; \
84 echo ' The missing file will cause configure scripts to fail during compilation.'; \
85 echo ' Please provide a "$(INCLUDE_DIR)/site/$(ARCH)" file and restart the build.'; \
86 exit 1; \
87 fi
88
89 checksum: FORCE
90 $(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT))
91
92 diffconfig: FORCE
93 mkdir -p $(BIN_DIR)
94 $(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.seed
95
96 prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile)
97 $(_SINGLE)$(SUBMAKE) -r diffconfig
98
99 world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
100 $(_SINGLE)$(SUBMAKE) -r package/index
101 $(_SINGLE)$(SUBMAKE) -r checksum
102
103 .PHONY: clean dirclean prereq prepare world package/symlinks package/symlinks-install package/symlinks-clean
104
105 endif