source: trunk/package/Makefile @ 7417

Last change on this file since 7417 was 7417, checked in by nbd, 10 years ago

make sure that /etc/rc.d exists before creating symlinks

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
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
9include $(TOPDIR)/rules.mk
10include $(TOPDIR)/.config
11include $(INCLUDE_DIR)/host.mk
12
13all: compile
14
15include $(TMP_DIR)/.packagedeps
16
17PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(prereq-y) $(prereq-m))
18DOWNLOAD_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m))
19COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
20INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
21
22$(STAMP_DIR) $(TARGET_DIR):
23        mkdir -p $@
24
25ifeq ($(QUIET),1)
26%-compile %-install: FORCE
27        $(MAKE) -C $* $(patsubst $*-%,%,$@) || { $(call MESSAGE, "*** $* $(patsubst $*-%,%,$@) failed"); false; }
28
29%-prepare %-prereq %-download %-clean: FORCE
30else
31%-prepare %-prereq %-download %-clean %-compile %-install: FORCE
32endif
33        $(MAKE) -C $* $(patsubst $*-%,%,$@)
34
35# .IGNORE: $(COMPILE_PACKAGES)
36
37$(TMP_DIR)/.packagedeps: $(TMP_DIR)/.packageinfo
38        @$(TOPDIR)/scripts/metadata.pl package_mk < $< > $@ || rm -f $@
39
40preconfig:
41clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
42prereq: $(PREREQ_PACKAGES)
43download: $(DOWNLOAD_PACKAGES)
44compile: $(COMPILE_PACKAGES)
45
46install-targets: $(INSTALL_PACKAGES)
47install:
48        rm -rf $(BUILD_DIR)/root
49        $(MAKE) install-targets
50        $(MAKE) preconfig
51        @if [ -d $(TOPDIR)/files ]; then \
52                $(CP) $(TOPDIR)/files/. $(BUILD_DIR)/root; \
53        fi
54        @mkdir -p $(BUILD_DIR)/root/etc/rc.d
55        @( \
56                cd $(BUILD_DIR)/root; \
57                for script in ./etc/init.d/*; do \
58                        grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
59                        IPKG_INSTROOT=$(BUILD_DIR)/root $(which bash) ./etc/rc.common $$script enable; \
60                done || true \
61        )
62        @-find $(BUILD_DIR)/root -name CVS   | $(XARGS) rm -rf
63        @-find $(BUILD_DIR)/root -name .svn  | $(XARGS) rm -rf
64        @-find $(BUILD_DIR)/root -name '.#*' | $(XARGS) rm -f
65
66index: $(PACKAGE_DIR)/Packages
67
68$(PACKAGE_DIR)/Packages: $(PACKAGE_DIR)/*.ipk
69        (cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages)
70
71symlinks:
72        ../scripts/feeds.sh $(CONFIG_SOURCE_FEEDS) 
73
74ifeq ($(MAKECMDGOALS),compile)
75MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
76else
77.NOTPARALLEL:
78endif
Note: See TracBrowser for help on using the repository browser.