2006-07-21 17:15:06 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
|
2005-03-06 11:34:52 +08:00
|
|
|
include $(TOPDIR)/rules.mk
|
2006-05-16 08:32:57 +08:00
|
|
|
include $(TOPDIR)/.config
|
2006-10-14 20:18:39 +08:00
|
|
|
include $(INCLUDE_DIR)/host.mk
|
2006-05-16 08:32:57 +08:00
|
|
|
|
2007-03-16 11:02:31 +08:00
|
|
|
all: compile
|
|
|
|
|
|
|
|
include $(TMP_DIR)/.pkgdeps
|
|
|
|
|
2006-10-13 01:45:22 +08:00
|
|
|
PREREQ_PACKAGES:=$(patsubst %,%-prereq,$(prereq-y) $(prereq-m))
|
2006-07-29 19:30:06 +08:00
|
|
|
DOWNLOAD_PACKAGES:=$(patsubst %,%-download,$(package-y) $(package-m))
|
2005-07-18 06:52:59 +08:00
|
|
|
COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
|
|
|
|
INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
|
2005-04-11 04:28:17 +08:00
|
|
|
|
2006-05-11 04:32:22 +08:00
|
|
|
$(STAMP_DIR) $(TARGET_DIR):
|
2005-07-19 08:48:36 +08:00
|
|
|
mkdir -p $@
|
|
|
|
|
2006-07-29 19:30:06 +08:00
|
|
|
%-prereq: $(STAMP_DIR) $(TARGET_DIR)
|
2006-08-04 02:30:00 +08:00
|
|
|
$(MAKE) -C $(patsubst %-prereq,%,$@) prereq
|
2006-07-29 19:30:06 +08:00
|
|
|
|
2007-02-26 08:41:53 +08:00
|
|
|
$(eval $(call default_subtargets,$(TARGET_DIR)))
|
2005-03-06 11:34:52 +08:00
|
|
|
|
2006-06-21 11:17:13 +08:00
|
|
|
ifeq ($(SDK),1)
|
|
|
|
GENDEP_OPTS := -s
|
|
|
|
endif
|
2006-05-16 08:32:57 +08:00
|
|
|
|
2006-11-12 09:38:24 +08:00
|
|
|
$(TMP_DIR)/.pkgdeps: $(TMP_DIR)/.pkginfo
|
2007-03-16 11:02:31 +08:00
|
|
|
@$(TOPDIR)/scripts/metadata.pl package_mk $(GENDEP_OPTS) < $< > $@ || rm -f $@
|
2006-05-16 08:32:57 +08:00
|
|
|
|
2007-03-16 11:02:31 +08:00
|
|
|
preconfig:
|
2006-05-16 08:32:57 +08:00
|
|
|
clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m))
|
2006-07-29 19:30:06 +08:00
|
|
|
prereq: $(PREREQ_PACKAGES)
|
|
|
|
download: $(DOWNLOAD_PACKAGES)
|
2007-02-16 09:06:23 +08:00
|
|
|
compile: $(COMPILE_PACKAGES)
|
2007-01-15 07:37:40 +08:00
|
|
|
|
2006-12-20 15:00:30 +08:00
|
|
|
install-targets: $(INSTALL_PACKAGES)
|
2006-06-01 04:58:13 +08:00
|
|
|
install:
|
|
|
|
rm -rf $(BUILD_DIR)/root
|
|
|
|
$(MAKE) install-targets
|
2007-03-16 11:02:31 +08:00
|
|
|
$(MAKE) preconfig
|
2006-12-01 22:01:31 +08:00
|
|
|
@if [ -d $(TOPDIR)/files ]; then \
|
|
|
|
$(CP) $(TOPDIR)/files/. $(BUILD_DIR)/root; \
|
|
|
|
fi
|
2006-10-16 05:03:30 +08:00
|
|
|
@( \
|
|
|
|
cd $(BUILD_DIR)/root; \
|
|
|
|
for script in ./etc/init.d/*; do \
|
|
|
|
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
|
|
|
|
IPKG_INSTROOT=$(BUILD_DIR)/root $(which bash) ./etc/rc.common $$script enable; \
|
2007-03-16 11:02:31 +08:00
|
|
|
done || true \
|
2006-10-16 05:03:30 +08:00
|
|
|
)
|
2006-05-16 08:32:57 +08:00
|
|
|
|
2006-08-02 21:06:58 +08:00
|
|
|
index: $(PACKAGE_DIR)/Packages
|
|
|
|
|
|
|
|
$(PACKAGE_DIR)/Packages: $(PACKAGE_DIR)/*.ipk
|
2006-10-11 07:04:00 +08:00
|
|
|
(cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages)
|
2006-07-31 01:09:22 +08:00
|
|
|
|
2007-02-01 02:33:04 +08:00
|
|
|
symlinks:
|
|
|
|
../scripts/feeds.sh $(CONFIG_SOURCE_FEEDS)
|
2006-08-04 02:30:00 +08:00
|
|
|
|
2007-02-16 09:12:05 +08:00
|
|
|
ifeq ($(MAKECMDGOALS),compile)
|
2006-08-04 02:30:00 +08:00
|
|
|
MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)
|
|
|
|
else
|
|
|
|
.NOTPARALLEL:
|
|
|
|
endif
|