add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DIR if...
[openwrt.git] / package / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10 include $(TOPDIR)/.config
11 include $(INCLUDE_DIR)/host.mk
12
13 all: compile
14
15 include $(TMP_DIR)/.pkgdeps
16
17 PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(prereq-y) $(prereq-m))
18 DOWNLOAD_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m))
19 COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
20 INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
21
22 $(STAMP_DIR) $(TARGET_DIR):
23 mkdir -p $@
24
25 %-prereq: $(STAMP_DIR) $(TARGET_DIR)
26 $(MAKE) -C $(patsubst %-prereq,%,$@) prereq
27
28 $(eval $(call default_subtargets,$(TARGET_DIR)))
29
30 ifeq ($(SDK),1)
31 GENDEP_OPTS := -s
32 endif
33
34 $(TMP_DIR)/.pkgdeps: $(TMP_DIR)/.pkginfo
35 @$(TOPDIR)/scripts/metadata.pl package_mk $(GENDEP_OPTS) < $< > $@ || rm -f $@
36
37 preconfig:
38 clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
39 prereq: $(PREREQ_PACKAGES)
40 download: $(DOWNLOAD_PACKAGES)
41 compile: $(COMPILE_PACKAGES)
42
43 install-targets: $(INSTALL_PACKAGES)
44 install:
45 rm -rf $(BUILD_DIR)/root
46 $(MAKE) install-targets
47 $(MAKE) preconfig
48 @if [ -d $(TOPDIR)/files ]; then \
49 $(CP) $(TOPDIR)/files/. $(BUILD_DIR)/root; \
50 fi
51 @( \
52 cd $(BUILD_DIR)/root; \
53 for script in ./etc/init.d/*; do \
54 grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
55 IPKG_INSTROOT=$(BUILD_DIR)/root $(which bash) ./etc/rc.common $$script enable; \
56 done || true \
57 )
58
59 index: $(PACKAGE_DIR)/Packages
60
61 $(PACKAGE_DIR)/Packages: $(PACKAGE_DIR)/*.ipk
62 (cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages)
63
64 symlinks:
65 ../scripts/feeds.sh $(CONFIG_SOURCE_FEEDS)
66
67 ifeq ($(MAKECMDGOALS),compile)
68 MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
69 else
70 .NOTPARALLEL:
71 endif
This page took 0.067568 seconds and 5 git commands to generate.