c2015b3a411ec9d6736805a7ac842861927f1976
[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 $(TOPDIR)/.pkgdeps
12
13 PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(package-y) $(package-m))
14 DOWNLOAD_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m))
15 COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
16 INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
17
18 $(STAMP_DIR) $(TARGET_DIR):
19 mkdir -p $@
20
21 %-prereq: $(STAMP_DIR) $(TARGET_DIR)
22 $(MAKE) -C $(patsubst %-prereq,%,$@) prereq MAKEFLAGS="$(BUILD_MAKEFLAGS)"
23
24 %-download: $(STAMP_DIR) $(TARGET_DIR)
25 $(MAKE) -C $(patsubst %-download,%,$@) download MAKEFLAGS="$(BUILD_MAKEFLAGS)"
26
27 %-prepare: $(STAMP_DIR) $(TARGET_DIR)
28 $(MAKE) -C $(patsubst %-prepare,%,$@) prepare MAKEFLAGS="$(BUILD_MAKEFLAGS)"
29
30 %-compile: $(STAMP_DIR) $(TARGET_DIR)
31 $(MAKE) -C $(patsubst %-compile,%,$@) compile MAKEFLAGS="$(BUILD_MAKEFLAGS)"
32
33 %-install: $(STAMP_DIR) $(TARGET_DIR)
34 $(MAKE) -C $(patsubst %-install,%,$@) install MAKEFLAGS="$(BUILD_MAKEFLAGS)"
35
36 %-clean: $(STAMP_DIR) $(TARGET_DIR)
37 $(MAKE) -C $(patsubst %-clean,%,$@) clean MAKEFLAGS="$(BUILD_MAKEFLAGS)"
38
39 ifeq ($(SDK),1)
40 GENDEP_OPTS := -s
41 endif
42
43 $(TOPDIR)/.pkgdeps: $(TOPDIR)/.pkginfo
44 @$(TOPDIR)/scripts/gen_deps.pl $(GENDEP_OPTS) < $< > $@ || rm -f $@
45
46 all: compile
47 clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
48 prereq: $(PREREQ_PACKAGES)
49 download: $(DOWNLOAD_PACKAGES)
50 compile-targets: $(COMPILE_PACKAGES)
51 compile:
52 $(MAKE) -j$(CONFIG_JLEVEL) compile-targets
53 install-targets: base-files-install $(INSTALL_PACKAGES)
54 install:
55 rm -rf $(BUILD_DIR)/root
56 $(MAKE) install-targets
57
58 index: $(PACKAGE_DIR)/Packages
59
60 $(PACKAGE_DIR)/Packages: $(PACKAGE_DIR)/*.ipk
61 (cd $(PACKAGE_DIR); $(STAGING_DIR)/usr/bin/ipkg-make-index . > Packages)
62
This page took 0.036563 seconds and 3 git commands to generate.